summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-03-08 22:29:47 +0000
committerChris Lattner <sabre@nondot.org>2007-03-08 22:29:47 +0000
commitce8aba03eee5ab2eb86d6c21a1feab20433ae1c9 (patch)
treefcd400743b4ee7ed1cd009392b73f5608e49e2a7
parentc8eb6b1b152e78ac12fcdd003f8d77a5ed6ef8b2 (diff)
downloadbcm5719-llvm-ce8aba03eee5ab2eb86d6c21a1feab20433ae1c9.tar.gz
bcm5719-llvm-ce8aba03eee5ab2eb86d6c21a1feab20433ae1c9.zip
implement support for floating point constants used as inline asm memory operands.
llvm-svn: 35033
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 581b402aeae..62ee06e9422 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -2882,9 +2882,14 @@ void SelectionDAGLowering::visitInlineAsm(CallInst &I) {
} 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);
}
OpenPOWER on IntegriCloud