1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc < %s -mtriple=i686-- -mattr=+x87,-sse,-sse2 -global-isel | FileCheck %s --check-prefixes=CHECK-32,GISEL_X86
3 ; RUN: llc < %s -mtriple=i686-- -mattr=+x87,-sse,-sse2 | FileCheck %s --check-prefixes=CHECK-32,SDAG_X86
4 ; RUN: llc < %s -mtriple=i686-- -mattr=+x87,-sse,-sse2 -fast-isel=true | FileCheck %s --check-prefixes=CHECK-32,SDAG_X86,FAST_X86
5 ; RUN: llc < %s -mtriple=x86_64-- -mattr=+x87,-sse,-sse2 -global-isel | FileCheck %s --check-prefixes=CHECK-64,GISEL_X64
6 ; RUN: llc < %s -mtriple=x86_64-- -mattr=+x87,-sse,-sse2 | FileCheck %s --check-prefixes=CHECK-64,SDAG_X64
7 ; RUN: llc < %s -mtriple=x86_64-- -mattr=+x87,-sse,-sse2 -fast-isel=true | FileCheck %s --check-prefixes=CHECK-64,SDAG_X64,FAST_X64
9 define x86_fp80 @f0(x86_fp80 noundef %a) nounwind {
10 ; GISEL_X86-LABEL: f0:
12 ; GISEL_X86-NEXT: pushl %ebp
13 ; GISEL_X86-NEXT: movl %esp, %ebp
14 ; GISEL_X86-NEXT: andl $-16, %esp
15 ; GISEL_X86-NEXT: subl $48, %esp
16 ; GISEL_X86-NEXT: fldt 8(%ebp)
17 ; GISEL_X86-NEXT: fldt {{\.?LCPI[0-9]+_[0-9]+}}
18 ; GISEL_X86-NEXT: fxch %st(1)
19 ; GISEL_X86-NEXT: fstpt {{[0-9]+}}(%esp)
20 ; GISEL_X86-NEXT: fstpt (%esp)
21 ; GISEL_X86-NEXT: fldt {{[0-9]+}}(%esp)
22 ; GISEL_X86-NEXT: fldt (%esp)
23 ; GISEL_X86-NEXT: faddp %st, %st(1)
24 ; GISEL_X86-NEXT: movl %ebp, %esp
25 ; GISEL_X86-NEXT: popl %ebp
26 ; GISEL_X86-NEXT: retl
30 ; SDAG_X86-NEXT: pushl %ebp
31 ; SDAG_X86-NEXT: movl %esp, %ebp
32 ; SDAG_X86-NEXT: andl $-16, %esp
33 ; SDAG_X86-NEXT: subl $48, %esp
34 ; SDAG_X86-NEXT: fldt 8(%ebp)
35 ; SDAG_X86-NEXT: fld %st(0)
36 ; SDAG_X86-NEXT: fstpt {{[0-9]+}}(%esp)
37 ; SDAG_X86-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
38 ; SDAG_X86-NEXT: fld %st(0)
39 ; SDAG_X86-NEXT: fstpt (%esp)
40 ; SDAG_X86-NEXT: faddp %st, %st(1)
41 ; SDAG_X86-NEXT: movl %ebp, %esp
42 ; SDAG_X86-NEXT: popl %ebp
45 ; GISEL_X64-LABEL: f0:
47 ; GISEL_X64-NEXT: fldt {{[0-9]+}}(%rsp)
48 ; GISEL_X64-NEXT: fldt {{\.?LCPI[0-9]+_[0-9]+}}(%rip)
49 ; GISEL_X64-NEXT: fxch %st(1)
50 ; GISEL_X64-NEXT: fstpt -{{[0-9]+}}(%rsp)
51 ; GISEL_X64-NEXT: fstpt -{{[0-9]+}}(%rsp)
52 ; GISEL_X64-NEXT: fldt -{{[0-9]+}}(%rsp)
53 ; GISEL_X64-NEXT: fldt -{{[0-9]+}}(%rsp)
54 ; GISEL_X64-NEXT: faddp %st, %st(1)
55 ; GISEL_X64-NEXT: retq
59 ; SDAG_X64-NEXT: fldt {{[0-9]+}}(%rsp)
60 ; SDAG_X64-NEXT: fld %st(0)
61 ; SDAG_X64-NEXT: fstpt -{{[0-9]+}}(%rsp)
62 ; SDAG_X64-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}(%rip)
63 ; SDAG_X64-NEXT: fld %st(0)
64 ; SDAG_X64-NEXT: fstpt -{{[0-9]+}}(%rsp)
65 ; SDAG_X64-NEXT: faddp %st, %st(1)
67 %a.addr = alloca x86_fp80, align 16
68 %x = alloca x86_fp80, align 16
69 store x86_fp80 %a, ptr %a.addr, align 16
70 store x86_fp80 0xK400A8000000000000000, ptr %x, align 16
71 %load1 = load x86_fp80, ptr %a.addr, align 16
72 %load2 = load x86_fp80, ptr %x, align 16
73 %add = fadd x86_fp80 %load1, %load2
78 define void @f1(ptr %a, ptr %b) nounwind {
79 ; GISEL_X86-LABEL: f1:
81 ; GISEL_X86-NEXT: movl {{[0-9]+}}(%esp), %eax
82 ; GISEL_X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
83 ; GISEL_X86-NEXT: fldt (%eax)
84 ; GISEL_X86-NEXT: fldt (%ecx)
85 ; GISEL_X86-NEXT: fsubrp %st, %st(1)
86 ; GISEL_X86-NEXT: fstpt (%eax)
87 ; GISEL_X86-NEXT: retl
91 ; SDAG_X86-NEXT: movl {{[0-9]+}}(%esp), %eax
92 ; SDAG_X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
93 ; SDAG_X86-NEXT: fldt (%ecx)
94 ; SDAG_X86-NEXT: fldt (%eax)
95 ; SDAG_X86-NEXT: fsubrp %st, %st(1)
96 ; SDAG_X86-NEXT: fstpt (%ecx)
101 ; CHECK-64-NEXT: fldt (%rdi)
102 ; CHECK-64-NEXT: fldt (%rsi)
103 ; CHECK-64-NEXT: fsubrp %st, %st(1)
104 ; CHECK-64-NEXT: fstpt (%rdi)
105 ; CHECK-64-NEXT: retq
106 %load1 = load x86_fp80, ptr %a, align 4
107 %load2 = load x86_fp80, ptr %b, align 4
108 %sub = fsub x86_fp80 %load1, %load2
109 store x86_fp80 %sub, ptr %a, align 4
113 define void @f2(ptr %a, ptr %b) nounwind {
114 ; GISEL_X86-LABEL: f2:
115 ; GISEL_X86: # %bb.0:
116 ; GISEL_X86-NEXT: movl {{[0-9]+}}(%esp), %eax
117 ; GISEL_X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
118 ; GISEL_X86-NEXT: fldt (%eax)
119 ; GISEL_X86-NEXT: fldt (%ecx)
120 ; GISEL_X86-NEXT: fmulp %st, %st(1)
121 ; GISEL_X86-NEXT: fstpt (%eax)
122 ; GISEL_X86-NEXT: retl
124 ; SDAG_X86-LABEL: f2:
126 ; SDAG_X86-NEXT: movl {{[0-9]+}}(%esp), %eax
127 ; SDAG_X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
128 ; SDAG_X86-NEXT: fldt (%ecx)
129 ; SDAG_X86-NEXT: fldt (%eax)
130 ; SDAG_X86-NEXT: fmulp %st, %st(1)
131 ; SDAG_X86-NEXT: fstpt (%ecx)
132 ; SDAG_X86-NEXT: retl
134 ; CHECK-64-LABEL: f2:
136 ; CHECK-64-NEXT: fldt (%rdi)
137 ; CHECK-64-NEXT: fldt (%rsi)
138 ; CHECK-64-NEXT: fmulp %st, %st(1)
139 ; CHECK-64-NEXT: fstpt (%rdi)
140 ; CHECK-64-NEXT: retq
141 %load1 = load x86_fp80, ptr %a, align 16
142 %load2 = load x86_fp80, ptr %b, align 16
143 %mul = fmul x86_fp80 %load1, %load2
144 store x86_fp80 %mul, ptr %a, align 16
148 define void @f3(ptr %a, ptr %b) nounwind {
149 ; GISEL_X86-LABEL: f3:
150 ; GISEL_X86: # %bb.0:
151 ; GISEL_X86-NEXT: movl {{[0-9]+}}(%esp), %eax
152 ; GISEL_X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
153 ; GISEL_X86-NEXT: fldt (%eax)
154 ; GISEL_X86-NEXT: fldt (%ecx)
155 ; GISEL_X86-NEXT: fdivrp %st, %st(1)
156 ; GISEL_X86-NEXT: fstpt (%eax)
157 ; GISEL_X86-NEXT: retl
159 ; SDAG_X86-LABEL: f3:
161 ; SDAG_X86-NEXT: movl {{[0-9]+}}(%esp), %eax
162 ; SDAG_X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
163 ; SDAG_X86-NEXT: fldt (%ecx)
164 ; SDAG_X86-NEXT: fldt (%eax)
165 ; SDAG_X86-NEXT: fdivrp %st, %st(1)
166 ; SDAG_X86-NEXT: fstpt (%ecx)
167 ; SDAG_X86-NEXT: retl
169 ; CHECK-64-LABEL: f3:
171 ; CHECK-64-NEXT: fldt (%rdi)
172 ; CHECK-64-NEXT: fldt (%rsi)
173 ; CHECK-64-NEXT: fdivrp %st, %st(1)
174 ; CHECK-64-NEXT: fstpt (%rdi)
175 ; CHECK-64-NEXT: retq
176 %load1 = load x86_fp80, ptr %a, align 4
177 %load2 = load x86_fp80, ptr %b, align 4
178 %div = fdiv x86_fp80 %load1, %load2
179 store x86_fp80 %div, ptr %a, align 4
183 define void @f6(ptr %a, ptr %b) nounwind {
184 ; GISEL_X86-LABEL: f6:
185 ; GISEL_X86: # %bb.0:
186 ; GISEL_X86-NEXT: movl {{[0-9]+}}(%esp), %eax
187 ; GISEL_X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
188 ; GISEL_X86-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
189 ; GISEL_X86-NEXT: flds (%eax)
190 ; GISEL_X86-NEXT: faddp %st, %st(1)
191 ; GISEL_X86-NEXT: fstps (%ecx)
192 ; GISEL_X86-NEXT: retl
194 ; SDAG_X86-LABEL: f6:
196 ; SDAG_X86-NEXT: movl {{[0-9]+}}(%esp), %eax
197 ; SDAG_X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
198 ; SDAG_X86-NEXT: flds (%ecx)
199 ; SDAG_X86-NEXT: fadds {{\.?LCPI[0-9]+_[0-9]+}}
200 ; SDAG_X86-NEXT: fstps (%eax)
201 ; SDAG_X86-NEXT: retl
203 ; GISEL_X64-LABEL: f6:
204 ; GISEL_X64: # %bb.0:
205 ; GISEL_X64-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}(%rip)
206 ; GISEL_X64-NEXT: flds (%rdi)
207 ; GISEL_X64-NEXT: faddp %st, %st(1)
208 ; GISEL_X64-NEXT: fstps (%rsi)
209 ; GISEL_X64-NEXT: retq
211 ; SDAG_X64-LABEL: f6:
213 ; SDAG_X64-NEXT: flds (%rdi)
214 ; SDAG_X64-NEXT: fadds {{\.?LCPI[0-9]+_[0-9]+}}(%rip)
215 ; SDAG_X64-NEXT: fstps (%rsi)
216 ; SDAG_X64-NEXT: retq
217 %load1 = load float, ptr %a
218 %add = fadd float %load1, 20.0
219 store float %add, ptr %b
222 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: