1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-- -x86-asm-syntax=intel -mcpu=i486 | FileCheck %s
4 ; Test that the load of the constant is folded into the operation.
7 define double @foo_add(double %P) {
8 ; CHECK-LABEL: foo_add:
10 ; CHECK-NEXT: fld qword ptr [esp + 4]
11 ; CHECK-NEXT: fadd dword ptr [{{\.?LCPI[0-9]+_[0-9]+}}]
13 %tmp.1 = fadd double %P, 1.230000e+02 ; <double> [#uses=1]
17 define double @foo_mul(double %P) {
18 ; CHECK-LABEL: foo_mul:
20 ; CHECK-NEXT: fld qword ptr [esp + 4]
21 ; CHECK-NEXT: fmul dword ptr [{{\.?LCPI[0-9]+_[0-9]+}}]
23 %tmp.1 = fmul double %P, 1.230000e+02 ; <double> [#uses=1]
27 define double @foo_sub(double %P) {
28 ; CHECK-LABEL: foo_sub:
30 ; CHECK-NEXT: fld qword ptr [esp + 4]
31 ; CHECK-NEXT: fadd dword ptr [{{\.?LCPI[0-9]+_[0-9]+}}]
33 %tmp.1 = fsub double %P, 1.230000e+02 ; <double> [#uses=1]
37 define double @foo_subr(double %P) {
38 ; CHECK-LABEL: foo_subr:
40 ; CHECK-NEXT: fld dword ptr [{{\.?LCPI[0-9]+_[0-9]+}}]
41 ; CHECK-NEXT: fsub qword ptr [esp + 4]
43 %tmp.1 = fsub double 1.230000e+02, %P ; <double> [#uses=1]
47 define double @foo_div(double %P) {
48 ; CHECK-LABEL: foo_div:
50 ; CHECK-NEXT: fld qword ptr [esp + 4]
51 ; CHECK-NEXT: fdiv dword ptr [{{\.?LCPI[0-9]+_[0-9]+}}]
53 %tmp.1 = fdiv double %P, 1.230000e+02 ; <double> [#uses=1]
57 define double @foo_divr(double %P) {
58 ; CHECK-LABEL: foo_divr:
60 ; CHECK-NEXT: fld dword ptr [{{\.?LCPI[0-9]+_[0-9]+}}]
61 ; CHECK-NEXT: fdiv qword ptr [esp + 4]
63 %tmp.1 = fdiv double 1.230000e+02, %P ; <double> [#uses=1]