mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-03 09:21:02 +00:00
Handle cast float-to-float or cast double-to-double.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@512 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
56786d268f
commit
9856e0c56b
@ -325,8 +325,10 @@ ChooseConvertToFloatInstr(const InstructionNode* instrNode,
|
||||
opCode = FXTOS;
|
||||
else if (opType == Type::DoubleTy)
|
||||
opCode = FDTOS;
|
||||
else if (opType == Type::FloatTy)
|
||||
;
|
||||
else
|
||||
assert(0 && "Cannot convert this type to FLOAT on SPARC");
|
||||
assert(0 && "Cannot convert this type to FLOAT on SPARC");
|
||||
break;
|
||||
|
||||
case ToDoubleTy:
|
||||
@ -336,8 +338,10 @@ ChooseConvertToFloatInstr(const InstructionNode* instrNode,
|
||||
opCode = FXTOD;
|
||||
else if (opType == Type::FloatTy)
|
||||
opCode = FSTOD;
|
||||
else if (opType == Type::DoubleTy)
|
||||
;
|
||||
else
|
||||
assert(0 && "Cannot convert this type to DOUBLE on SPARC");
|
||||
assert(0 && "Cannot convert this type to DOUBLE on SPARC");
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -1504,8 +1508,17 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
|
||||
else
|
||||
{
|
||||
opType = subtreeRoot->leftChild()->getValue()->getType();
|
||||
mvec[0] = new MachineInstr(ChooseConvertToFloatInstr(subtreeRoot, opType));
|
||||
Set2OperandsFromInstr(mvec[0], subtreeRoot, target);
|
||||
MachineOpCode opCode = ChooseConvertToFloatInstr(subtreeRoot, opType);
|
||||
if (opCode == INVALID_OPCODE) // no conversion needed
|
||||
{
|
||||
numInstr = 0;
|
||||
forwardOperandNum = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
mvec[0] = new MachineInstr(opCode);
|
||||
Set2OperandsFromInstr(mvec[0], subtreeRoot, target);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user