Implement floating point constants


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30704 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/ARMISelDAGToDAG.cpp b/lib/Target/ARM/ARMISelDAGToDAG.cpp
index e4b591d..2adf407 100644
--- a/lib/Target/ARM/ARMISelDAGToDAG.cpp
+++ b/lib/Target/ARM/ARMISelDAGToDAG.cpp
@@ -61,6 +61,9 @@
   setOperationAction(ISD::VASTART,       MVT::Other, Custom);
   setOperationAction(ISD::VAEND,         MVT::Other, Expand);
 
+  setOperationAction(ISD::ConstantFP, MVT::f64, Expand);
+  setOperationAction(ISD::ConstantFP, MVT::f32, Expand);
+
   setSchedulingPreference(SchedulingForRegPressure);
   computeRegisterProperties();
 }
diff --git a/lib/Target/ARM/ARMInstrInfo.td b/lib/Target/ARM/ARMInstrInfo.td
index d7c096f..55128de 100644
--- a/lib/Target/ARM/ARMInstrInfo.td
+++ b/lib/Target/ARM/ARMInstrInfo.td
@@ -100,6 +100,10 @@
                      "ldr $dst, $addr",
                      [(set IntRegs:$dst, (load iaddr:$addr))]>;
 
+def FLDS  : InstARM<(ops FPRegs:$dst, IntRegs:$addr),
+                     "flds $dst, $addr",
+                     [(set FPRegs:$dst, (load IntRegs:$addr))]>;
+
 def str  : InstARM<(ops IntRegs:$src, memri:$addr),
                     "str $src, $addr",
                     [(store IntRegs:$src, iaddr:$addr)]>;
diff --git a/lib/Target/ARM/README.txt b/lib/Target/ARM/README.txt
index 736d776..ae94b8f 100644
--- a/lib/Target/ARM/README.txt
+++ b/lib/Target/ARM/README.txt
@@ -28,3 +28,7 @@
 add r0, r1, r0
 
 ----------------------------------------------------------
+
+add an offset to FLDS addressing mode
+
+----------------------------------------------------------
diff --git a/test/CodeGen/ARM/fp.ll b/test/CodeGen/ARM/fp.ll
index af5a696..3cf45fc 100644
--- a/test/CodeGen/ARM/fp.ll
+++ b/test/CodeGen/ARM/fp.ll
@@ -3,7 +3,9 @@
 ; RUN: llvm-as < %s | llc -march=arm | grep fsitos &&
 ; RUN: llvm-as < %s | llc -march=arm | grep fmrs &&
 ; RUN: llvm-as < %s | llc -march=arm | grep fsitod &&
-; RUN: llvm-as < %s | llc -march=arm | grep fmrrd
+; RUN: llvm-as < %s | llc -march=arm | grep fmrrd &&
+; RUN: llvm-as < %s | llc -march=arm | grep flds &&
+; RUN: llvm-as < %s | llc -march=arm | grep ".word.*1065353216"
 
 float %f(int %a) {
 entry:
@@ -16,3 +18,8 @@
         %tmp = cast int %a to double            ; <double> [#uses=1]
         ret double %tmp
 }
+
+float %h() {
+entry:
+        ret float 1.000000e+00
+}