1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+3dnow | FileCheck %s
4 define x86_mmx @stack_fold_pavgusb(x86_mmx %a, x86_mmx %b) {
5 ; CHECK-LABEL: stack_fold_pavgusb:
7 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
11 ; CHECK-NEXT: pavgusb {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
12 ; CHECK-NEXT: movq2dq %mm0, %xmm0
14 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
15 %2 = call x86_mmx @llvm.x86.3dnow.pavgusb(x86_mmx %a, x86_mmx %b) nounwind readnone
18 declare x86_mmx @llvm.x86.3dnow.pavgusb(x86_mmx, x86_mmx) nounwind readnone
20 define x86_mmx @stack_fold_pf2id(x86_mmx %a) {
21 ; CHECK-LABEL: stack_fold_pf2id:
23 ; CHECK-NEXT: movq %mm0, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
27 ; CHECK-NEXT: pf2id {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
28 ; CHECK-NEXT: movq2dq %mm0, %xmm0
30 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm1},~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
31 %2 = call x86_mmx @llvm.x86.3dnow.pf2id(x86_mmx %a) nounwind readnone
34 declare x86_mmx @llvm.x86.3dnow.pf2id(x86_mmx) nounwind readnone
36 define x86_mmx @stack_fold_pf2iw(x86_mmx %a) {
37 ; CHECK-LABEL: stack_fold_pf2iw:
39 ; CHECK-NEXT: movq %mm0, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
43 ; CHECK-NEXT: pf2iw {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
44 ; CHECK-NEXT: movq2dq %mm0, %xmm0
46 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm1},~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
47 %2 = call x86_mmx @llvm.x86.3dnowa.pf2iw(x86_mmx %a) nounwind readnone
50 declare x86_mmx @llvm.x86.3dnowa.pf2iw(x86_mmx) nounwind readnone
52 define x86_mmx @stack_fold_pfacc(x86_mmx %a, x86_mmx %b) {
53 ; CHECK-LABEL: stack_fold_pfacc:
55 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
59 ; CHECK-NEXT: pfacc {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
60 ; CHECK-NEXT: movq2dq %mm0, %xmm0
62 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
63 %2 = call x86_mmx @llvm.x86.3dnow.pfacc(x86_mmx %a, x86_mmx %b) nounwind readnone
66 declare x86_mmx @llvm.x86.3dnow.pfacc(x86_mmx, x86_mmx) nounwind readnone
68 define x86_mmx @stack_fold_pfadd(x86_mmx %a, x86_mmx %b) {
69 ; CHECK-LABEL: stack_fold_pfadd:
71 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
75 ; CHECK-NEXT: pfadd {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
76 ; CHECK-NEXT: movq2dq %mm0, %xmm0
78 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
79 %2 = call x86_mmx @llvm.x86.3dnow.pfadd(x86_mmx %a, x86_mmx %b) nounwind readnone
82 declare x86_mmx @llvm.x86.3dnow.pfadd(x86_mmx, x86_mmx) nounwind readnone
84 define x86_mmx @stack_fold_pfcmpeq(x86_mmx %a, x86_mmx %b) {
85 ; CHECK-LABEL: stack_fold_pfcmpeq:
87 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
91 ; CHECK-NEXT: pfcmpeq {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
92 ; CHECK-NEXT: movq2dq %mm0, %xmm0
94 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
95 %2 = call x86_mmx @llvm.x86.3dnow.pfcmpeq(x86_mmx %a, x86_mmx %b) nounwind readnone
98 declare x86_mmx @llvm.x86.3dnow.pfcmpeq(x86_mmx, x86_mmx) nounwind readnone
100 define x86_mmx @stack_fold_pfcmpge(x86_mmx %a, x86_mmx %b) {
101 ; CHECK-LABEL: stack_fold_pfcmpge:
103 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
106 ; CHECK-NEXT: #NO_APP
107 ; CHECK-NEXT: pfcmpge {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
108 ; CHECK-NEXT: movq2dq %mm0, %xmm0
110 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
111 %2 = call x86_mmx @llvm.x86.3dnow.pfcmpge(x86_mmx %a, x86_mmx %b) nounwind readnone
114 declare x86_mmx @llvm.x86.3dnow.pfcmpge(x86_mmx, x86_mmx) nounwind readnone
116 define x86_mmx @stack_fold_pfcmpgt(x86_mmx %a, x86_mmx %b) {
117 ; CHECK-LABEL: stack_fold_pfcmpgt:
119 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
122 ; CHECK-NEXT: #NO_APP
123 ; CHECK-NEXT: pfcmpgt {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
124 ; CHECK-NEXT: movq2dq %mm0, %xmm0
126 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
127 %2 = call x86_mmx @llvm.x86.3dnow.pfcmpgt(x86_mmx %a, x86_mmx %b) nounwind readnone
130 declare x86_mmx @llvm.x86.3dnow.pfcmpgt(x86_mmx, x86_mmx) nounwind readnone
132 define x86_mmx @stack_fold_pfmax(x86_mmx %a, x86_mmx %b) {
133 ; CHECK-LABEL: stack_fold_pfmax:
135 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
138 ; CHECK-NEXT: #NO_APP
139 ; CHECK-NEXT: pfmax {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
140 ; CHECK-NEXT: movq2dq %mm0, %xmm0
142 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
143 %2 = call x86_mmx @llvm.x86.3dnow.pfmax(x86_mmx %a, x86_mmx %b) nounwind readnone
146 declare x86_mmx @llvm.x86.3dnow.pfmax(x86_mmx, x86_mmx) nounwind readnone
148 define x86_mmx @stack_fold_pfmin(x86_mmx %a, x86_mmx %b) {
149 ; CHECK-LABEL: stack_fold_pfmin:
151 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
154 ; CHECK-NEXT: #NO_APP
155 ; CHECK-NEXT: pfmin {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
156 ; CHECK-NEXT: movq2dq %mm0, %xmm0
158 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
159 %2 = call x86_mmx @llvm.x86.3dnow.pfmin(x86_mmx %a, x86_mmx %b) nounwind readnone
162 declare x86_mmx @llvm.x86.3dnow.pfmin(x86_mmx, x86_mmx) nounwind readnone
164 define x86_mmx @stack_fold_pfmul(x86_mmx %a, x86_mmx %b) {
165 ; CHECK-LABEL: stack_fold_pfmul:
167 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
170 ; CHECK-NEXT: #NO_APP
171 ; CHECK-NEXT: pfmul {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
172 ; CHECK-NEXT: movq2dq %mm0, %xmm0
174 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
175 %2 = call x86_mmx @llvm.x86.3dnow.pfmul(x86_mmx %a, x86_mmx %b) nounwind readnone
178 declare x86_mmx @llvm.x86.3dnow.pfmul(x86_mmx, x86_mmx) nounwind readnone
180 define x86_mmx @stack_fold_pfnacc(x86_mmx %a, x86_mmx %b) {
181 ; CHECK-LABEL: stack_fold_pfnacc:
183 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
186 ; CHECK-NEXT: #NO_APP
187 ; CHECK-NEXT: pfnacc {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
188 ; CHECK-NEXT: movq2dq %mm0, %xmm0
190 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
191 %2 = call x86_mmx @llvm.x86.3dnowa.pfnacc(x86_mmx %a, x86_mmx %b) nounwind readnone
194 declare x86_mmx @llvm.x86.3dnowa.pfnacc(x86_mmx, x86_mmx) nounwind readnone
196 define x86_mmx @stack_fold_pfpnacc(x86_mmx %a, x86_mmx %b) {
197 ; CHECK-LABEL: stack_fold_pfpnacc:
199 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
202 ; CHECK-NEXT: #NO_APP
203 ; CHECK-NEXT: pfpnacc {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
204 ; CHECK-NEXT: movq2dq %mm0, %xmm0
206 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
207 %2 = call x86_mmx @llvm.x86.3dnowa.pfpnacc(x86_mmx %a, x86_mmx %b) nounwind readnone
210 declare x86_mmx @llvm.x86.3dnowa.pfpnacc(x86_mmx, x86_mmx) nounwind readnone
212 define x86_mmx @stack_fold_pfrcp(x86_mmx %a) {
213 ; CHECK-LABEL: stack_fold_pfrcp:
215 ; CHECK-NEXT: movq %mm0, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
218 ; CHECK-NEXT: #NO_APP
219 ; CHECK-NEXT: pfrcp {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
220 ; CHECK-NEXT: movq2dq %mm0, %xmm0
222 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm1},~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
223 %2 = call x86_mmx @llvm.x86.3dnow.pfrcp(x86_mmx %a) nounwind readnone
226 declare x86_mmx @llvm.x86.3dnow.pfrcp(x86_mmx) nounwind readnone
228 define x86_mmx @stack_fold_pfrcpit1(x86_mmx %a, x86_mmx %b) {
229 ; CHECK-LABEL: stack_fold_pfrcpit1:
231 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
234 ; CHECK-NEXT: #NO_APP
235 ; CHECK-NEXT: pfrcpit1 {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
236 ; CHECK-NEXT: movq2dq %mm0, %xmm0
238 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
239 %2 = call x86_mmx @llvm.x86.3dnow.pfrcpit1(x86_mmx %a, x86_mmx %b) nounwind readnone
242 declare x86_mmx @llvm.x86.3dnow.pfrcpit1(x86_mmx, x86_mmx) nounwind readnone
244 define x86_mmx @stack_fold_pfrcpit2(x86_mmx %a, x86_mmx %b) {
245 ; CHECK-LABEL: stack_fold_pfrcpit2:
247 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
250 ; CHECK-NEXT: #NO_APP
251 ; CHECK-NEXT: pfrcpit2 {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
252 ; CHECK-NEXT: movq2dq %mm0, %xmm0
254 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
255 %2 = call x86_mmx @llvm.x86.3dnow.pfrcpit2(x86_mmx %a, x86_mmx %b) nounwind readnone
258 declare x86_mmx @llvm.x86.3dnow.pfrcpit2(x86_mmx, x86_mmx) nounwind readnone
260 define x86_mmx @stack_fold_pfrsqit1(x86_mmx %a, x86_mmx %b) {
261 ; CHECK-LABEL: stack_fold_pfrsqit1:
263 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
266 ; CHECK-NEXT: #NO_APP
267 ; CHECK-NEXT: pfrsqit1 {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
268 ; CHECK-NEXT: movq2dq %mm0, %xmm0
270 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
271 %2 = call x86_mmx @llvm.x86.3dnow.pfrsqit1(x86_mmx %a, x86_mmx %b) nounwind readnone
274 declare x86_mmx @llvm.x86.3dnow.pfrsqit1(x86_mmx, x86_mmx) nounwind readnone
276 define x86_mmx @stack_fold_pfrsqrt(x86_mmx %a) {
277 ; CHECK-LABEL: stack_fold_pfrsqrt:
279 ; CHECK-NEXT: movq %mm0, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
282 ; CHECK-NEXT: #NO_APP
283 ; CHECK-NEXT: pfrsqrt {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
284 ; CHECK-NEXT: movq2dq %mm0, %xmm0
286 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm1},~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
287 %2 = call x86_mmx @llvm.x86.3dnow.pfrsqrt(x86_mmx %a) nounwind readnone
290 declare x86_mmx @llvm.x86.3dnow.pfrsqrt(x86_mmx) nounwind readnone
292 define x86_mmx @stack_fold_pfsub(x86_mmx %a, x86_mmx %b) {
293 ; CHECK-LABEL: stack_fold_pfsub:
295 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
298 ; CHECK-NEXT: #NO_APP
299 ; CHECK-NEXT: pfsub {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
300 ; CHECK-NEXT: movq2dq %mm0, %xmm0
302 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
303 %2 = call x86_mmx @llvm.x86.3dnow.pfsub(x86_mmx %a, x86_mmx %b) nounwind readnone
306 declare x86_mmx @llvm.x86.3dnow.pfsub(x86_mmx, x86_mmx) nounwind readnone
308 define x86_mmx @stack_fold_pfsubr(x86_mmx %a, x86_mmx %b) {
309 ; CHECK-LABEL: stack_fold_pfsubr:
311 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
314 ; CHECK-NEXT: #NO_APP
315 ; CHECK-NEXT: pfsubr {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
316 ; CHECK-NEXT: movq2dq %mm0, %xmm0
318 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
319 %2 = call x86_mmx @llvm.x86.3dnow.pfsubr(x86_mmx %a, x86_mmx %b) nounwind readnone
322 declare x86_mmx @llvm.x86.3dnow.pfsubr(x86_mmx, x86_mmx) nounwind readnone
324 define x86_mmx @stack_fold_pi2fd(x86_mmx %a) {
325 ; CHECK-LABEL: stack_fold_pi2fd:
327 ; CHECK-NEXT: movq %mm0, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
330 ; CHECK-NEXT: #NO_APP
331 ; CHECK-NEXT: pi2fd {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
332 ; CHECK-NEXT: movq2dq %mm0, %xmm0
334 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm1},~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
335 %2 = call x86_mmx @llvm.x86.3dnow.pi2fd(x86_mmx %a) nounwind readnone
338 declare x86_mmx @llvm.x86.3dnow.pi2fd(x86_mmx) nounwind readnone
340 define x86_mmx @stack_fold_pi2fw(x86_mmx %a) {
341 ; CHECK-LABEL: stack_fold_pi2fw:
343 ; CHECK-NEXT: movq %mm0, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
346 ; CHECK-NEXT: #NO_APP
347 ; CHECK-NEXT: pi2fw {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
348 ; CHECK-NEXT: movq2dq %mm0, %xmm0
350 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm1},~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
351 %2 = call x86_mmx @llvm.x86.3dnowa.pi2fw(x86_mmx %a) nounwind readnone
354 declare x86_mmx @llvm.x86.3dnowa.pi2fw(x86_mmx) nounwind readnone
356 define x86_mmx @stack_fold_pmulhrw(x86_mmx %a, x86_mmx %b) {
357 ; CHECK-LABEL: stack_fold_pmulhrw:
359 ; CHECK-NEXT: movq %mm1, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
362 ; CHECK-NEXT: #NO_APP
363 ; CHECK-NEXT: pmulhrw {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
364 ; CHECK-NEXT: movq2dq %mm0, %xmm0
366 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
367 %2 = call x86_mmx @llvm.x86.3dnow.pmulhrw(x86_mmx %a, x86_mmx %b) nounwind readnone
370 declare x86_mmx @llvm.x86.3dnow.pmulhrw(x86_mmx, x86_mmx) nounwind readnone
372 define x86_mmx @stack_fold_pswapd(x86_mmx %a) {
373 ; CHECK-LABEL: stack_fold_pswapd:
375 ; CHECK-NEXT: movq %mm0, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
378 ; CHECK-NEXT: #NO_APP
379 ; CHECK-NEXT: pswapd {{[-0-9]+}}(%r{{[sb]}}p), %mm0 # 8-byte Folded Reload
380 ; CHECK-NEXT: # mm0 = mem[1,0]
381 ; CHECK-NEXT: movq2dq %mm0, %xmm0
383 %1 = tail call x86_mmx asm sideeffect "nop", "=y,~{mm1},~{mm2},~{mm3},~{mm4},~{mm5},~{mm6},~{mm7}"()
384 %2 = call x86_mmx @llvm.x86.3dnowa.pswapd(x86_mmx %a) nounwind readnone
387 declare x86_mmx @llvm.x86.3dnowa.pswapd(x86_mmx) nounwind readnone