diff --git a/llvm/lib/Target/ARM/ARMInstrInfo.td b/llvm/lib/Target/ARM/ARMInstrInfo.td index 3aa4a53534aa..5cd892e9b830 100644 --- a/llvm/lib/Target/ARM/ARMInstrInfo.td +++ b/llvm/lib/Target/ARM/ARMInstrInfo.td @@ -104,10 +104,6 @@ def ldr : InstARM<(ops IntRegs:$dst, memri:$addr), "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)]>; @@ -205,3 +201,13 @@ def FMULS : InstARM<(ops FPRegs:$dst, FPRegs:$a, FPRegs:$b), def FMULD : InstARM<(ops DFPRegs:$dst, DFPRegs:$a, DFPRegs:$b), "fmuld $dst, $a, $b", [(set DFPRegs:$dst, (fmul DFPRegs:$a, DFPRegs:$b))]>; + + +// Floating Point Load +def FLDS : InstARM<(ops FPRegs:$dst, IntRegs:$addr), + "flds $dst, $addr", + [(set FPRegs:$dst, (load IntRegs:$addr))]>; + +def FLDD : InstARM<(ops DFPRegs:$dst, IntRegs:$addr), + "fldd $dst, $addr", + [(set DFPRegs:$dst, (load IntRegs:$addr))]>; diff --git a/llvm/lib/Target/ARM/README.txt b/llvm/lib/Target/ARM/README.txt index ae94b8f6bfe1..ff2e188c71b1 100644 --- a/llvm/lib/Target/ARM/README.txt +++ b/llvm/lib/Target/ARM/README.txt @@ -29,6 +29,6 @@ add r0, r1, r0 ---------------------------------------------------------- -add an offset to FLDS addressing mode +add an offset to FLDS/FLDD addressing mode ---------------------------------------------------------- diff --git a/llvm/test/Regression/CodeGen/ARM/fp.ll b/llvm/test/Regression/CodeGen/ARM/fp.ll index 50c03956fc91..c40e2fc88608 100644 --- a/llvm/test/Regression/CodeGen/ARM/fp.ll +++ b/llvm/test/Regression/CodeGen/ARM/fp.ll @@ -3,8 +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 | wc -l | grep 3 && +; RUN: llvm-as < %s | llc -march=arm | grep fmrrd | wc -l | grep 4 && ; RUN: llvm-as < %s | llc -march=arm | grep fmdrr | wc -l | grep 2 && +; RUN: llvm-as < %s | llc -march=arm | grep fldd && ; RUN: llvm-as < %s | llc -march=arm | grep flds && ; RUN: llvm-as < %s | llc -march=arm | grep ".word.*1065353216" @@ -20,6 +21,12 @@ entry: ret double %tmp } +double %h(double* %v) { +entry: + %tmp = load double* %v ; [#uses=1] + ret double %tmp +} + float %h() { entry: ret float 1.000000e+00