diff options
| author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-09-09 20:35:34 +0000 |
|---|---|---|
| committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-09-09 20:35:34 +0000 |
| commit | b606fcb3e070045225f185db9821da363c2e1aea (patch) | |
| tree | a7976f05f5e2dd5c3826b34ad62f02416c104ed5 /llvm/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp | |
| parent | 57de997efffcbf4358ebd26d8b1c21844128560c (diff) | |
| download | bcm5719-llvm-b606fcb3e070045225f185db9821da363c2e1aea.tar.gz bcm5719-llvm-b606fcb3e070045225f185db9821da363c2e1aea.zip | |
Handle cast float-to-float or cast double-to-double.
llvm-svn: 512
Diffstat (limited to 'llvm/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp b/llvm/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp index 08dbbc53551..8f79f6674d2 100644 --- a/llvm/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp +++ b/llvm/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp @@ -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; |

