1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Implement floating point constants

llvm-svn: 30704
This commit is contained in:
Rafael Espindola 2006-10-03 17:27:58 +00:00
parent 72276ae651
commit b77754ce4d
4 changed files with 19 additions and 1 deletions

View File

@ -61,6 +61,9 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
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();
}

View File

@ -100,6 +100,10 @@ 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)]>;

View File

@ -28,3 +28,7 @@ mov r1, r1, lsl r2
add r0, r1, r0
----------------------------------------------------------
add an offset to FLDS addressing mode
----------------------------------------------------------

View File

@ -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 @@ entry:
%tmp = cast int %a to double ; <double> [#uses=1]
ret double %tmp
}
float %h() {
entry:
ret float 1.000000e+00
}