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