aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2001-09-09 20:35:34 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2001-09-09 20:35:34 +0000
commit9856e0c56bb13465cb7002d86ba600915ea1dc9a (patch)
treeefae11be55175ef6e9b3b65b6a0fe65842aff1da
parent56786d268feeb6d0e895b6c4cba60139285c47d6 (diff)
downloadexternal_llvm-9856e0c56bb13465cb7002d86ba600915ea1dc9a.zip
external_llvm-9856e0c56bb13465cb7002d86ba600915ea1dc9a.tar.gz
external_llvm-9856e0c56bb13465cb7002d86ba600915ea1dc9a.tar.bz2
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
-rw-r--r--lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp b/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp
index 08dbbc5..8f79f66 100644
--- a/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp
+++ b/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;