[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Chris Lattner sabre at nondot.org
Thu Mar 8 14:30:04 PST 2007



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.383 -> 1.384
---
Log message:

implement support for floating point constants used as inline asm memory operands.


---
Diffs of the changes:  (+7 -2)

 SelectionDAGISel.cpp |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.383 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.384
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.383	Thu Mar  8 01:07:03 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp	Thu Mar  8 16:29:47 2007
@@ -2882,9 +2882,14 @@
       } else if (CTy == TargetLowering::C_Memory) {
         // Memory input.
         
-        // Check that the operand isn't a float.
+        // If the operand is a float, spill to a constant pool entry to get its
+        // address.
+        if (ConstantFP *Val = dyn_cast<ConstantFP>(I.getOperand(OpNum-1)))
+          InOperandVal = DAG.getConstantPool(Val, TLI.getPointerTy());
+        
         if (!MVT::isInteger(InOperandVal.getValueType())) {
-          cerr << "Match failed, can't handle floats yet!\n";
+          cerr << "Match failed, cannot handle this yet!\n";
+          InOperandVal.Val->dump();
           exit(1);
         }
         






More information about the llvm-commits mailing list