forked from OSchip/llvm-project
add float -> double and double -> float conversion
llvm-svn: 30835
This commit is contained in:
parent
ff35900383
commit
9e29ec371a
|
@ -200,6 +200,11 @@ def FUITOS : InstARM<(ops FPRegs:$dst, FPRegs:$src),
|
|||
def FUITOD : InstARM<(ops DFPRegs:$dst, FPRegs:$src),
|
||||
"fuitod $dst, $src", [(set DFPRegs:$dst, (armfuitod FPRegs:$src))]>;
|
||||
|
||||
def FCVTDS : InstARM<(ops DFPRegs:$dst, FPRegs:$src),
|
||||
"fcvtds $dst, $src", [(set DFPRegs:$dst, (fextend FPRegs:$src))]>;
|
||||
|
||||
def FCVTSD : InstARM<(ops FPRegs:$dst, DFPRegs:$src),
|
||||
"fcvtsd $dst, $src", [(set FPRegs:$dst, (fround DFPRegs:$src))]>;
|
||||
|
||||
// Floating Point Arithmetic
|
||||
def FADDS : InstARM<(ops FPRegs:$dst, FPRegs:$a, FPRegs:$b),
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
; RUN: llvm-as < %s | llc -march=arm &&
|
||||
; RUN: llvm-as < %s | llc -march=arm | grep fcvtds &&
|
||||
; RUN: llvm-as < %s | llc -march=arm | grep fcvtsd
|
||||
|
||||
float %f(double %x) {
|
||||
entry:
|
||||
%tmp1 = cast double %x to float
|
||||
ret float %tmp1
|
||||
}
|
||||
|
||||
double %g(float %x) {
|
||||
entry:
|
||||
%tmp1 = cast float %x to double
|
||||
ret double %tmp1
|
||||
}
|
Loading…
Reference in New Issue