2009-11-22 12:45:44 +01:00
|
|
|
; RUN: llc < %s -march=x86 -x86-asm-syntax=intel -mcpu=i486 | FileCheck %s
|
2004-04-11 22:24:01 +02:00
|
|
|
; Test that the load of the constant is folded into the operation.
|
|
|
|
|
|
|
|
|
2008-02-21 08:42:26 +01:00
|
|
|
define double @foo_add(double %P) {
|
2009-06-05 00:49:04 +02:00
|
|
|
%tmp.1 = fadd double %P, 1.230000e+02 ; <double> [#uses=1]
|
2008-02-21 08:42:26 +01:00
|
|
|
ret double %tmp.1
|
2004-04-11 22:24:01 +02:00
|
|
|
}
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-LABEL: foo_add:
|
2013-07-31 04:47:52 +02:00
|
|
|
; CHECK: fadd dword ptr
|
2004-04-11 22:24:01 +02:00
|
|
|
|
2008-02-21 08:42:26 +01:00
|
|
|
define double @foo_mul(double %P) {
|
2009-06-05 00:49:04 +02:00
|
|
|
%tmp.1 = fmul double %P, 1.230000e+02 ; <double> [#uses=1]
|
2008-02-21 08:42:26 +01:00
|
|
|
ret double %tmp.1
|
2004-04-11 22:24:01 +02:00
|
|
|
}
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-LABEL: foo_mul:
|
2013-07-31 04:47:52 +02:00
|
|
|
; CHECK: fmul dword ptr
|
2004-04-11 22:24:01 +02:00
|
|
|
|
2008-02-21 08:42:26 +01:00
|
|
|
define double @foo_sub(double %P) {
|
2009-06-05 00:49:04 +02:00
|
|
|
%tmp.1 = fsub double %P, 1.230000e+02 ; <double> [#uses=1]
|
2008-02-21 08:42:26 +01:00
|
|
|
ret double %tmp.1
|
2004-04-11 22:24:01 +02:00
|
|
|
}
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-LABEL: foo_sub:
|
2013-07-31 04:47:52 +02:00
|
|
|
; CHECK: fadd dword ptr
|
2004-04-11 22:24:01 +02:00
|
|
|
|
2008-02-21 08:42:26 +01:00
|
|
|
define double @foo_subr(double %P) {
|
2009-06-05 00:49:04 +02:00
|
|
|
%tmp.1 = fsub double 1.230000e+02, %P ; <double> [#uses=1]
|
2008-02-21 08:42:26 +01:00
|
|
|
ret double %tmp.1
|
2004-04-11 22:24:01 +02:00
|
|
|
}
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-LABEL: foo_subr:
|
2013-07-31 04:47:52 +02:00
|
|
|
; CHECK: fsub qword ptr
|
2004-04-11 22:24:01 +02:00
|
|
|
|
2008-02-21 08:42:26 +01:00
|
|
|
define double @foo_div(double %P) {
|
|
|
|
%tmp.1 = fdiv double %P, 1.230000e+02 ; <double> [#uses=1]
|
|
|
|
ret double %tmp.1
|
2004-04-11 22:24:01 +02:00
|
|
|
}
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-LABEL: foo_div:
|
2013-07-31 04:47:52 +02:00
|
|
|
; CHECK: fdiv dword ptr
|
2004-04-11 22:24:01 +02:00
|
|
|
|
2008-02-21 08:42:26 +01:00
|
|
|
define double @foo_divr(double %P) {
|
|
|
|
%tmp.1 = fdiv double 1.230000e+02, %P ; <double> [#uses=1]
|
|
|
|
ret double %tmp.1
|
|
|
|
}
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-LABEL: foo_divr:
|
2013-07-31 04:47:52 +02:00
|
|
|
; CHECK: fdiv qword ptr
|
2009-11-22 12:45:44 +01:00
|
|
|
|