2007-07-10 01:35:18 +08:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel -mcpu=i486 | \
|
2007-04-16 22:20:28 +08:00
|
|
|
; RUN: grep -i ST | not grep {fadd\\|fsub\\|fdiv\\|fmul}
|
2004-04-12 04:24:01 +08:00
|
|
|
|
|
|
|
; Test that the load of the constant is folded into the operation.
|
|
|
|
|
2007-10-12 22:53:36 +08:00
|
|
|
double %foo_add(double %P) {
|
2004-04-12 04:24:01 +08:00
|
|
|
%tmp.1 = add double %P, 0x405EC00000000000
|
|
|
|
ret double %tmp.1
|
|
|
|
}
|
|
|
|
|
2007-10-12 22:53:36 +08:00
|
|
|
double %foo_mul(double %P) {
|
2004-04-12 04:24:01 +08:00
|
|
|
%tmp.1 = mul double %P, 0x405EC00000000000
|
|
|
|
ret double %tmp.1
|
|
|
|
}
|
|
|
|
|
2007-10-12 22:53:36 +08:00
|
|
|
double %foo_sub(double %P) {
|
2004-04-12 04:24:01 +08:00
|
|
|
%tmp.1 = sub double %P, 0x405EC00000000000
|
|
|
|
ret double %tmp.1
|
|
|
|
}
|
|
|
|
|
2007-10-12 22:53:36 +08:00
|
|
|
double %foo_subr(double %P) {
|
2004-04-12 04:24:01 +08:00
|
|
|
%tmp.1 = sub double 0x405EC00000000000, %P
|
|
|
|
ret double %tmp.1
|
|
|
|
}
|
|
|
|
|
2007-10-12 22:53:36 +08:00
|
|
|
double %foo_div(double %P) {
|
2004-04-12 04:24:01 +08:00
|
|
|
%tmp.1 = div double %P, 0x405EC00000000000
|
|
|
|
ret double %tmp.1
|
|
|
|
}
|
|
|
|
|
2007-10-12 22:53:36 +08:00
|
|
|
double %foo_divr(double %P) {
|
2004-04-12 04:24:01 +08:00
|
|
|
%tmp.1 = div double 0x405EC00000000000, %P
|
|
|
|
ret double %tmp.1
|
|
|
|
}
|
|
|
|
|