1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

Handle cast float-to-float or cast double-to-double.

llvm-svn: 512
This commit is contained in:
Vikram S. Adve 2001-09-09 20:35:34 +00:00
parent 2e74f6ba1f
commit 5458bc59fd

View File

@ -325,8 +325,10 @@ ChooseConvertToFloatInstr(const InstructionNode* instrNode,
opCode = FXTOS; opCode = FXTOS;
else if (opType == Type::DoubleTy) else if (opType == Type::DoubleTy)
opCode = FDTOS; opCode = FDTOS;
else if (opType == Type::FloatTy)
;
else else
assert(0 && "Cannot convert this type to FLOAT on SPARC"); assert(0 && "Cannot convert this type to FLOAT on SPARC");
break; break;
case ToDoubleTy: case ToDoubleTy:
@ -336,8 +338,10 @@ ChooseConvertToFloatInstr(const InstructionNode* instrNode,
opCode = FXTOD; opCode = FXTOD;
else if (opType == Type::FloatTy) else if (opType == Type::FloatTy)
opCode = FSTOD; opCode = FSTOD;
else if (opType == Type::DoubleTy)
;
else else
assert(0 && "Cannot convert this type to DOUBLE on SPARC"); assert(0 && "Cannot convert this type to DOUBLE on SPARC");
break; break;
default: default:
@ -1504,8 +1508,17 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
else else
{ {
opType = subtreeRoot->leftChild()->getValue()->getType(); opType = subtreeRoot->leftChild()->getValue()->getType();
mvec[0] = new MachineInstr(ChooseConvertToFloatInstr(subtreeRoot, opType)); MachineOpCode opCode = ChooseConvertToFloatInstr(subtreeRoot, opType);
Set2OperandsFromInstr(mvec[0], subtreeRoot, target); if (opCode == INVALID_OPCODE) // no conversion needed
{
numInstr = 0;
forwardOperandNum = 0;
}
else
{
mvec[0] = new MachineInstr(opCode);
Set2OperandsFromInstr(mvec[0], subtreeRoot, target);
}
} }
break; break;