1 ; RUN: llc < %s -march=x86 -mattr=+3dnow | FileCheck %s
3 define <8 x i8> @test_pavgusb(x86_mmx %a.coerce, x86_mmx %b.coerce) nounwind readnone {
6 %0 = bitcast x86_mmx %a.coerce to <8 x i8>
7 %1 = bitcast x86_mmx %b.coerce to <8 x i8>
8 %2 = bitcast <8 x i8> %0 to x86_mmx
9 %3 = bitcast <8 x i8> %1 to x86_mmx
10 %4 = call x86_mmx @llvm.x86.3dnow.pavgusb(x86_mmx %2, x86_mmx %3)
11 %5 = bitcast x86_mmx %4 to <8 x i8>
15 declare x86_mmx @llvm.x86.3dnow.pavgusb(x86_mmx, x86_mmx) nounwind readnone
17 define <2 x i32> @test_pf2id(<2 x float> %a) nounwind readnone {
20 %0 = bitcast <2 x float> %a to x86_mmx
21 %1 = tail call x86_mmx @llvm.x86.3dnow.pf2id(x86_mmx %0)
22 %2 = bitcast x86_mmx %1 to <2 x i32>
26 declare x86_mmx @llvm.x86.3dnow.pf2id(x86_mmx) nounwind readnone
28 define <2 x float> @test_pfacc(<2 x float> %a, <2 x float> %b) nounwind readnone {
31 %0 = bitcast <2 x float> %a to x86_mmx
32 %1 = bitcast <2 x float> %b to x86_mmx
33 %2 = tail call x86_mmx @llvm.x86.3dnow.pfacc(x86_mmx %0, x86_mmx %1)
34 %3 = bitcast x86_mmx %2 to <2 x float>
38 declare x86_mmx @llvm.x86.3dnow.pfacc(x86_mmx, x86_mmx) nounwind readnone
40 define <2 x float> @test_pfadd(<2 x float> %a, <2 x float> %b) nounwind readnone {
43 %0 = bitcast <2 x float> %a to x86_mmx
44 %1 = bitcast <2 x float> %b to x86_mmx
45 %2 = tail call x86_mmx @llvm.x86.3dnow.pfadd(x86_mmx %0, x86_mmx %1)
46 %3 = bitcast x86_mmx %2 to <2 x float>
50 declare x86_mmx @llvm.x86.3dnow.pfadd(x86_mmx, x86_mmx) nounwind readnone
52 define <2 x i32> @test_pfcmpeq(<2 x float> %a, <2 x float> %b) nounwind readnone {
55 %0 = bitcast <2 x float> %a to x86_mmx
56 %1 = bitcast <2 x float> %b to x86_mmx
57 %2 = tail call x86_mmx @llvm.x86.3dnow.pfcmpeq(x86_mmx %0, x86_mmx %1)
58 %3 = bitcast x86_mmx %2 to <2 x i32>
62 declare x86_mmx @llvm.x86.3dnow.pfcmpeq(x86_mmx, x86_mmx) nounwind readnone
64 define <2 x i32> @test_pfcmpge(<2 x float> %a, <2 x float> %b) nounwind readnone {
67 %0 = bitcast <2 x float> %a to x86_mmx
68 %1 = bitcast <2 x float> %b to x86_mmx
69 %2 = tail call x86_mmx @llvm.x86.3dnow.pfcmpge(x86_mmx %0, x86_mmx %1)
70 %3 = bitcast x86_mmx %2 to <2 x i32>
74 declare x86_mmx @llvm.x86.3dnow.pfcmpge(x86_mmx, x86_mmx) nounwind readnone
76 define <2 x i32> @test_pfcmpgt(<2 x float> %a, <2 x float> %b) nounwind readnone {
79 %0 = bitcast <2 x float> %a to x86_mmx
80 %1 = bitcast <2 x float> %b to x86_mmx
81 %2 = tail call x86_mmx @llvm.x86.3dnow.pfcmpgt(x86_mmx %0, x86_mmx %1)
82 %3 = bitcast x86_mmx %2 to <2 x i32>
86 declare x86_mmx @llvm.x86.3dnow.pfcmpgt(x86_mmx, x86_mmx) nounwind readnone
88 define <2 x float> @test_pfmax(<2 x float> %a, <2 x float> %b) nounwind readnone {
91 %0 = bitcast <2 x float> %a to x86_mmx
92 %1 = bitcast <2 x float> %b to x86_mmx
93 %2 = tail call x86_mmx @llvm.x86.3dnow.pfmax(x86_mmx %0, x86_mmx %1)
94 %3 = bitcast x86_mmx %2 to <2 x float>
98 declare x86_mmx @llvm.x86.3dnow.pfmax(x86_mmx, x86_mmx) nounwind readnone
100 define <2 x float> @test_pfmin(<2 x float> %a, <2 x float> %b) nounwind readnone {
103 %0 = bitcast <2 x float> %a to x86_mmx
104 %1 = bitcast <2 x float> %b to x86_mmx
105 %2 = tail call x86_mmx @llvm.x86.3dnow.pfmin(x86_mmx %0, x86_mmx %1)
106 %3 = bitcast x86_mmx %2 to <2 x float>
110 declare x86_mmx @llvm.x86.3dnow.pfmin(x86_mmx, x86_mmx) nounwind readnone
112 define <2 x float> @test_pfmul(<2 x float> %a, <2 x float> %b) nounwind readnone {
115 %0 = bitcast <2 x float> %a to x86_mmx
116 %1 = bitcast <2 x float> %b to x86_mmx
117 %2 = tail call x86_mmx @llvm.x86.3dnow.pfmul(x86_mmx %0, x86_mmx %1)
118 %3 = bitcast x86_mmx %2 to <2 x float>
122 declare x86_mmx @llvm.x86.3dnow.pfmul(x86_mmx, x86_mmx) nounwind readnone
124 define <2 x float> @test_pfrcp(<2 x float> %a) nounwind readnone {
127 %0 = bitcast <2 x float> %a to x86_mmx
128 %1 = tail call x86_mmx @llvm.x86.3dnow.pfrcp(x86_mmx %0)
129 %2 = bitcast x86_mmx %1 to <2 x float>
133 declare x86_mmx @llvm.x86.3dnow.pfrcp(x86_mmx) nounwind readnone
135 define <2 x float> @test_pfrcpit1(<2 x float> %a, <2 x float> %b) nounwind readnone {
138 %0 = bitcast <2 x float> %a to x86_mmx
139 %1 = bitcast <2 x float> %b to x86_mmx
140 %2 = tail call x86_mmx @llvm.x86.3dnow.pfrcpit1(x86_mmx %0, x86_mmx %1)
141 %3 = bitcast x86_mmx %2 to <2 x float>
145 declare x86_mmx @llvm.x86.3dnow.pfrcpit1(x86_mmx, x86_mmx) nounwind readnone
147 define <2 x float> @test_pfrcpit2(<2 x float> %a, <2 x float> %b) nounwind readnone {
150 %0 = bitcast <2 x float> %a to x86_mmx
151 %1 = bitcast <2 x float> %b to x86_mmx
152 %2 = tail call x86_mmx @llvm.x86.3dnow.pfrcpit2(x86_mmx %0, x86_mmx %1)
153 %3 = bitcast x86_mmx %2 to <2 x float>
157 declare x86_mmx @llvm.x86.3dnow.pfrcpit2(x86_mmx, x86_mmx) nounwind readnone
159 define <2 x float> @test_pfrsqrt(<2 x float> %a) nounwind readnone {
162 %0 = bitcast <2 x float> %a to x86_mmx
163 %1 = tail call x86_mmx @llvm.x86.3dnow.pfrsqrt(x86_mmx %0)
164 %2 = bitcast x86_mmx %1 to <2 x float>
168 declare x86_mmx @llvm.x86.3dnow.pfrsqrt(x86_mmx) nounwind readnone
170 define <2 x float> @test_pfrsqit1(<2 x float> %a, <2 x float> %b) nounwind readnone {
173 %0 = bitcast <2 x float> %a to x86_mmx
174 %1 = bitcast <2 x float> %b to x86_mmx
175 %2 = tail call x86_mmx @llvm.x86.3dnow.pfrsqit1(x86_mmx %0, x86_mmx %1)
176 %3 = bitcast x86_mmx %2 to <2 x float>
180 declare x86_mmx @llvm.x86.3dnow.pfrsqit1(x86_mmx, x86_mmx) nounwind readnone
182 define <2 x float> @test_pfsub(<2 x float> %a, <2 x float> %b) nounwind readnone {
185 %0 = bitcast <2 x float> %a to x86_mmx
186 %1 = bitcast <2 x float> %b to x86_mmx
187 %2 = tail call x86_mmx @llvm.x86.3dnow.pfsub(x86_mmx %0, x86_mmx %1)
188 %3 = bitcast x86_mmx %2 to <2 x float>
192 declare x86_mmx @llvm.x86.3dnow.pfsub(x86_mmx, x86_mmx) nounwind readnone
194 define <2 x float> @test_pfsubr(<2 x float> %a, <2 x float> %b) nounwind readnone {
197 %0 = bitcast <2 x float> %a to x86_mmx
198 %1 = bitcast <2 x float> %b to x86_mmx
199 %2 = tail call x86_mmx @llvm.x86.3dnow.pfsubr(x86_mmx %0, x86_mmx %1)
200 %3 = bitcast x86_mmx %2 to <2 x float>
204 declare x86_mmx @llvm.x86.3dnow.pfsubr(x86_mmx, x86_mmx) nounwind readnone
206 define <2 x float> @test_pi2fd(x86_mmx %a.coerce) nounwind readnone {
209 %0 = bitcast x86_mmx %a.coerce to <2 x i32>
210 %1 = bitcast <2 x i32> %0 to x86_mmx
211 %2 = call x86_mmx @llvm.x86.3dnow.pi2fd(x86_mmx %1)
212 %3 = bitcast x86_mmx %2 to <2 x float>
216 declare x86_mmx @llvm.x86.3dnow.pi2fd(x86_mmx) nounwind readnone
218 define <4 x i16> @test_pmulhrw(x86_mmx %a.coerce, x86_mmx %b.coerce) nounwind readnone {
221 %0 = bitcast x86_mmx %a.coerce to <4 x i16>
222 %1 = bitcast x86_mmx %b.coerce to <4 x i16>
223 %2 = bitcast <4 x i16> %0 to x86_mmx
224 %3 = bitcast <4 x i16> %1 to x86_mmx
225 %4 = call x86_mmx @llvm.x86.3dnow.pmulhrw(x86_mmx %2, x86_mmx %3)
226 %5 = bitcast x86_mmx %4 to <4 x i16>
230 declare x86_mmx @llvm.x86.3dnow.pmulhrw(x86_mmx, x86_mmx) nounwind readnone
232 define <2 x i32> @test_pf2iw(<2 x float> %a) nounwind readnone {
235 %0 = bitcast <2 x float> %a to x86_mmx
236 %1 = tail call x86_mmx @llvm.x86.3dnowa.pf2iw(x86_mmx %0)
237 %2 = bitcast x86_mmx %1 to <2 x i32>
241 declare x86_mmx @llvm.x86.3dnowa.pf2iw(x86_mmx) nounwind readnone
243 define <2 x float> @test_pfnacc(<2 x float> %a, <2 x float> %b) nounwind readnone {
246 %0 = bitcast <2 x float> %a to x86_mmx
247 %1 = bitcast <2 x float> %b to x86_mmx
248 %2 = tail call x86_mmx @llvm.x86.3dnowa.pfnacc(x86_mmx %0, x86_mmx %1)
249 %3 = bitcast x86_mmx %2 to <2 x float>
253 declare x86_mmx @llvm.x86.3dnowa.pfnacc(x86_mmx, x86_mmx) nounwind readnone
255 define <2 x float> @test_pfpnacc(<2 x float> %a, <2 x float> %b) nounwind readnone {
258 %0 = bitcast <2 x float> %a to x86_mmx
259 %1 = bitcast <2 x float> %b to x86_mmx
260 %2 = tail call x86_mmx @llvm.x86.3dnowa.pfpnacc(x86_mmx %0, x86_mmx %1)
261 %3 = bitcast x86_mmx %2 to <2 x float>
265 declare x86_mmx @llvm.x86.3dnowa.pfpnacc(x86_mmx, x86_mmx) nounwind readnone
267 define <2 x float> @test_pi2fw(x86_mmx %a.coerce) nounwind readnone {
270 %0 = bitcast x86_mmx %a.coerce to <2 x i32>
271 %1 = bitcast <2 x i32> %0 to x86_mmx
272 %2 = call x86_mmx @llvm.x86.3dnowa.pi2fw(x86_mmx %1)
273 %3 = bitcast x86_mmx %2 to <2 x float>
277 declare x86_mmx @llvm.x86.3dnowa.pi2fw(x86_mmx) nounwind readnone
279 define <2 x float> @test_pswapdsf(<2 x float> %a) nounwind readnone {
282 %0 = bitcast <2 x float> %a to x86_mmx
283 %1 = tail call x86_mmx @llvm.x86.3dnowa.pswapd(x86_mmx %0)
284 %2 = bitcast x86_mmx %1 to <2 x float>
288 define <2 x i32> @test_pswapdsi(<2 x i32> %a) nounwind readnone {
291 %0 = bitcast <2 x i32> %a to x86_mmx
292 %1 = tail call x86_mmx @llvm.x86.3dnowa.pswapd(x86_mmx %0)
293 %2 = bitcast x86_mmx %1 to <2 x i32>
297 declare x86_mmx @llvm.x86.3dnowa.pswapd(x86_mmx) nounwind readnone