1 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -target-feature +ssse3 -emit-llvm -o - -Werror | FileCheck %s
2 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -target-feature +ssse3 -fno-signed-char -emit-llvm -o - -Werror | FileCheck %s
3 
4 // Don't include mm_malloc.h, it's system specific.
5 #define __MM_MALLOC_H
6 
7 #include <x86intrin.h>
8 
test_mm_abs_pi8(__m64 a)9 __m64 test_mm_abs_pi8(__m64 a) {
10   // CHECK-LABEL: test_mm_abs_pi8
11   // CHECK: call x86_mmx @llvm.x86.ssse3.pabs.b
12   return _mm_abs_pi8(a);
13 }
14 
test_mm_abs_pi16(__m64 a)15 __m64 test_mm_abs_pi16(__m64 a) {
16   // CHECK-LABEL: test_mm_abs_pi16
17   // CHECK: call x86_mmx @llvm.x86.ssse3.pabs.w
18   return _mm_abs_pi16(a);
19 }
20 
test_mm_abs_pi32(__m64 a)21 __m64 test_mm_abs_pi32(__m64 a) {
22   // CHECK-LABEL: test_mm_abs_pi32
23   // CHECK: call x86_mmx @llvm.x86.ssse3.pabs.d
24   return _mm_abs_pi32(a);
25 }
26 
test_mm_add_pi8(__m64 a,__m64 b)27 __m64 test_mm_add_pi8(__m64 a, __m64 b) {
28   // CHECK-LABEL: test_mm_add_pi8
29   // CHECK: call x86_mmx @llvm.x86.mmx.padd.b
30   return _mm_add_pi8(a, b);
31 }
32 
test_mm_add_pi16(__m64 a,__m64 b)33 __m64 test_mm_add_pi16(__m64 a, __m64 b) {
34   // CHECK-LABEL: test_mm_add_pi16
35   // CHECK: call x86_mmx @llvm.x86.mmx.padd.w
36   return _mm_add_pi16(a, b);
37 }
38 
test_mm_add_pi32(__m64 a,__m64 b)39 __m64 test_mm_add_pi32(__m64 a, __m64 b) {
40   // CHECK-LABEL: test_mm_add_pi32
41   // CHECK: call x86_mmx @llvm.x86.mmx.padd.d
42   return _mm_add_pi32(a, b);
43 }
44 
test_mm_add_si64(__m64 a,__m64 b)45 __m64 test_mm_add_si64(__m64 a, __m64 b) {
46   // CHECK-LABEL: test_mm_add_si64
47   // CHECK: call x86_mmx @llvm.x86.mmx.padd.q
48   return __builtin_ia32_paddq(a, b);
49 }
50 
test_mm_adds_pi8(__m64 a,__m64 b)51 __m64 test_mm_adds_pi8(__m64 a, __m64 b) {
52   // CHECK-LABEL: test_mm_adds_pi8
53   // CHECK: call x86_mmx @llvm.x86.mmx.padds.b
54   return _mm_adds_pi8(a, b);
55 }
56 
test_mm_adds_pi16(__m64 a,__m64 b)57 __m64 test_mm_adds_pi16(__m64 a, __m64 b) {
58   // CHECK-LABEL: test_mm_adds_pi16
59   // CHECK: call x86_mmx @llvm.x86.mmx.padds.w
60   return _mm_adds_pi16(a, b);
61 }
62 
test_mm_adds_pu8(__m64 a,__m64 b)63 __m64 test_mm_adds_pu8(__m64 a, __m64 b) {
64   // CHECK-LABEL: test_mm_adds_pu8
65   // CHECK: call x86_mmx @llvm.x86.mmx.paddus.b
66   return _mm_adds_pu8(a, b);
67 }
68 
test_mm_adds_pu16(__m64 a,__m64 b)69 __m64 test_mm_adds_pu16(__m64 a, __m64 b) {
70   // CHECK-LABEL: test_mm_adds_pu16
71   // CHECK: call x86_mmx @llvm.x86.mmx.paddus.w
72   return _mm_adds_pu16(a, b);
73 }
74 
test_mm_alignr_pi8(__m64 a,__m64 b)75 __m64 test_mm_alignr_pi8(__m64 a, __m64 b) {
76   // CHECK-LABEL: test_mm_alignr_pi8
77   // CHECK: call x86_mmx @llvm.x86.mmx.palignr.b
78   return _mm_alignr_pi8(a, b, 2);
79 }
80 
test_mm_and_si64(__m64 a,__m64 b)81 __m64 test_mm_and_si64(__m64 a, __m64 b) {
82   // CHECK-LABEL: test_mm_and_si64
83   // CHECK: call x86_mmx @llvm.x86.mmx.pand
84   return _mm_and_si64(a, b);
85 }
86 
test_mm_andnot_si64(__m64 a,__m64 b)87 __m64 test_mm_andnot_si64(__m64 a, __m64 b) {
88   // CHECK-LABEL: test_mm_andnot_si64
89   // CHECK: call x86_mmx @llvm.x86.mmx.pandn
90   return _mm_andnot_si64(a, b);
91 }
92 
test_mm_avg_pu8(__m64 a,__m64 b)93 __m64 test_mm_avg_pu8(__m64 a, __m64 b) {
94   // CHECK-LABEL: test_mm_avg_pu8
95   // CHECK: call x86_mmx @llvm.x86.mmx.pavg.b
96   return _mm_avg_pu8(a, b);
97 }
98 
test_mm_avg_pu16(__m64 a,__m64 b)99 __m64 test_mm_avg_pu16(__m64 a, __m64 b) {
100   // CHECK-LABEL: test_mm_avg_pu16
101   // CHECK: call x86_mmx @llvm.x86.mmx.pavg.w
102   return _mm_avg_pu16(a, b);
103 }
104 
test_mm_cmpeq_pi8(__m64 a,__m64 b)105 __m64 test_mm_cmpeq_pi8(__m64 a, __m64 b) {
106   // CHECK-LABEL: test_mm_cmpeq_pi8
107   // CHECK: call x86_mmx @llvm.x86.mmx.pcmpeq.b
108   return _mm_cmpeq_pi8(a, b);
109 }
110 
test_mm_cmpeq_pi16(__m64 a,__m64 b)111 __m64 test_mm_cmpeq_pi16(__m64 a, __m64 b) {
112   // CHECK-LABEL: test_mm_cmpeq_pi16
113   // CHECK: call x86_mmx @llvm.x86.mmx.pcmpeq.w
114   return _mm_cmpeq_pi16(a, b);
115 }
116 
test_mm_cmpeq_pi32(__m64 a,__m64 b)117 __m64 test_mm_cmpeq_pi32(__m64 a, __m64 b) {
118   // CHECK-LABEL: test_mm_cmpeq_pi32
119   // CHECK: call x86_mmx @llvm.x86.mmx.pcmpeq.d
120   return _mm_cmpeq_pi32(a, b);
121 }
122 
test_mm_cmpgt_pi8(__m64 a,__m64 b)123 __m64 test_mm_cmpgt_pi8(__m64 a, __m64 b) {
124   // CHECK-LABEL: test_mm_cmpgt_pi8
125   // CHECK: call x86_mmx @llvm.x86.mmx.pcmpgt.b
126   return _mm_cmpgt_pi8(a, b);
127 }
128 
test_mm_cmpgt_pi16(__m64 a,__m64 b)129 __m64 test_mm_cmpgt_pi16(__m64 a, __m64 b) {
130   // CHECK-LABEL: test_mm_cmpgt_pi16
131   // CHECK: call x86_mmx @llvm.x86.mmx.pcmpgt.w
132   return _mm_cmpgt_pi16(a, b);
133 }
134 
test_mm_cmpgt_pi32(__m64 a,__m64 b)135 __m64 test_mm_cmpgt_pi32(__m64 a, __m64 b) {
136   // CHECK-LABEL: test_mm_cmpgt_pi32
137   // CHECK: call x86_mmx @llvm.x86.mmx.pcmpgt.d
138   return _mm_cmpgt_pi32(a, b);
139 }
140 
test_mm_cvt_pi2ps(__m128 a,__m64 b)141 __m128 test_mm_cvt_pi2ps(__m128 a, __m64 b) {
142   // CHECK-LABEL: test_mm_cvt_pi2ps
143   // CHECK: <4 x float> @llvm.x86.sse.cvtpi2ps
144   return _mm_cvt_pi2ps(a, b);
145 }
146 
test_mm_cvt_ps2pi(__m128 a)147 __m64 test_mm_cvt_ps2pi(__m128 a) {
148   // CHECK-LABEL: test_mm_cvt_ps2pi
149   // CHECK: call x86_mmx @llvm.x86.sse.cvtps2pi
150   return _mm_cvt_ps2pi(a);
151 }
152 
test_mm_cvtpd_pi32(__m128d a)153 __m64 test_mm_cvtpd_pi32(__m128d a) {
154   // CHECK-LABEL: test_mm_cvtpd_pi32
155   // CHECK: call x86_mmx @llvm.x86.sse.cvtpd2pi
156   return _mm_cvtpd_pi32(a);
157 }
158 
test_mm_cvtpi16_ps(__m64 a)159 __m128 test_mm_cvtpi16_ps(__m64 a) {
160   // CHECK-LABEL: test_mm_cvtpi16_ps
161   // CHECK: call <4 x float> @llvm.x86.sse.cvtpi2ps
162   return _mm_cvtpi16_ps(a);
163 }
164 
test_mm_cvtpi32_pd(__m64 a)165 __m128d test_mm_cvtpi32_pd(__m64 a) {
166   // CHECK-LABEL: test_mm_cvtpi32_pd
167   // CHECK: call <2 x double> @llvm.x86.sse.cvtpi2pd
168   return _mm_cvtpi32_pd(a);
169 }
170 
test_mm_cvtpi32_ps(__m128 a,__m64 b)171 __m128 test_mm_cvtpi32_ps(__m128 a, __m64 b) {
172   // CHECK-LABEL: test_mm_cvtpi32_ps
173   // CHECK: call <4 x float> @llvm.x86.sse.cvtpi2ps
174   return _mm_cvtpi32_ps(a, b);
175 }
176 
test_mm_cvtpi32x2_ps(__m64 a,__m64 b)177 __m128 test_mm_cvtpi32x2_ps(__m64 a, __m64 b) {
178   // CHECK-LABEL: test_mm_cvtpi32x2_ps
179   // CHECK: call <4 x float> @llvm.x86.sse.cvtpi2ps
180   // CHECK: call <4 x float> @llvm.x86.sse.cvtpi2ps
181   return _mm_cvtpi32x2_ps(a, b);
182 }
183 
test_mm_cvtps_pi16(__m128 a)184 __m64 test_mm_cvtps_pi16(__m128 a) {
185   // CHECK-LABEL: test_mm_cvtps_pi16
186   // CHECK: call x86_mmx @llvm.x86.sse.cvtps2pi
187   return _mm_cvtps_pi16(a);
188 }
189 
test_mm_cvtps_pi32(__m128 a)190 __m64 test_mm_cvtps_pi32(__m128 a) {
191   // CHECK-LABEL: test_mm_cvtps_pi32
192   // CHECK: call x86_mmx @llvm.x86.sse.cvtps2pi
193   return _mm_cvtps_pi32(a);
194 }
195 
test_mm_cvtsi32_si64(int a)196 __m64 test_mm_cvtsi32_si64(int a) {
197   // CHECK-LABEL: test_mm_cvtsi32_si64
198   // CHECK: insertelement <2 x i32>
199   return _mm_cvtsi32_si64(a);
200 }
201 
test_mm_cvtsi64_si32(__m64 a)202 int test_mm_cvtsi64_si32(__m64 a) {
203   // CHECK-LABEL: test_mm_cvtsi64_si32
204   // CHECK: extractelement <2 x i32>
205   return _mm_cvtsi64_si32(a);
206 }
207 
test_mm_cvttpd_pi32(__m128d a)208 __m64 test_mm_cvttpd_pi32(__m128d a) {
209   // CHECK-LABEL: test_mm_cvttpd_pi32
210   // CHECK: call x86_mmx @llvm.x86.sse.cvttpd2pi
211   return _mm_cvttpd_pi32(a);
212 }
213 
test_mm_cvttps_pi32(__m128 a)214 __m64 test_mm_cvttps_pi32(__m128 a) {
215   // CHECK-LABEL: test_mm_cvttps_pi32
216   // CHECK: call x86_mmx @llvm.x86.sse.cvttps2pi
217   return _mm_cvttps_pi32(a);
218 }
219 
test_m_from_int(int a)220 __m64 test_m_from_int(int a) {
221   // CHECK-LABEL: test_m_from_int
222   // CHECK: insertelement <2 x i32>
223   return _m_from_int(a);
224 }
225 
test_m_from_int64(long long a)226 __m64 test_m_from_int64(long long a) {
227   // CHECK-LABEL: test_m_from_int64
228   // CHECK: bitcast
229   return _m_from_int64(a);
230 }
231 
test_mm_hadd_pi16(__m64 a,__m64 b)232 __m64 test_mm_hadd_pi16(__m64 a, __m64 b) {
233   // CHECK-LABEL: test_mm_hadd_pi16
234   // CHECK: call x86_mmx @llvm.x86.ssse3.phadd.w
235   return _mm_hadd_pi16(a, b);
236 }
237 
test_mm_hadd_pi32(__m64 a,__m64 b)238 __m64 test_mm_hadd_pi32(__m64 a, __m64 b) {
239   // CHECK-LABEL: test_mm_hadd_pi32
240   // CHECK: call x86_mmx @llvm.x86.ssse3.phadd.d
241   return _mm_hadd_pi32(a, b);
242 }
243 
test_mm_hadds_pi16(__m64 a,__m64 b)244 __m64 test_mm_hadds_pi16(__m64 a, __m64 b) {
245   // CHECK-LABEL: test_mm_hadds_pi16
246   // CHECK: call x86_mmx @llvm.x86.ssse3.phadd.sw
247   return _mm_hadds_pi16(a, b);
248 }
249 
test_mm_hsub_pi16(__m64 a,__m64 b)250 __m64 test_mm_hsub_pi16(__m64 a, __m64 b) {
251   // CHECK-LABEL: test_mm_hsub_pi16
252   // CHECK: call x86_mmx @llvm.x86.ssse3.phsub.w
253   return _mm_hsub_pi16(a, b);
254 }
255 
test_mm_hsub_pi32(__m64 a,__m64 b)256 __m64 test_mm_hsub_pi32(__m64 a, __m64 b) {
257   // CHECK-LABEL: test_mm_hsub_pi32
258   // CHECK: call x86_mmx @llvm.x86.ssse3.phsub.d
259   return _mm_hsub_pi32(a, b);
260 }
261 
test_mm_hsubs_pi16(__m64 a,__m64 b)262 __m64 test_mm_hsubs_pi16(__m64 a, __m64 b) {
263   // CHECK-LABEL: test_mm_hsubs_pi16
264   // CHECK: call x86_mmx @llvm.x86.ssse3.phsub.sw
265   return _mm_hsubs_pi16(a, b);
266 }
267 
test_mm_madd_pi16(__m64 a,__m64 b)268 __m64 test_mm_madd_pi16(__m64 a, __m64 b) {
269   // CHECK-LABEL: test_mm_madd_pi16
270   // CHECK: call x86_mmx @llvm.x86.mmx.pmadd.wd
271   return _mm_madd_pi16(a, b);
272 }
273 
test_mm_maddubs_pi16(__m64 a,__m64 b)274 __m64 test_mm_maddubs_pi16(__m64 a, __m64 b) {
275   // CHECK-LABEL: test_mm_maddubs_pi16
276   // CHECK: call x86_mmx @llvm.x86.ssse3.pmadd.ub.sw
277   return _mm_maddubs_pi16(a, b);
278 }
279 
test_mm_maskmove_si64(__m64 d,__m64 n,char * p)280 void test_mm_maskmove_si64(__m64 d, __m64 n, char *p) {
281   // CHECK-LABEL: test_mm_maskmove_si64
282   // CHECK: call void @llvm.x86.mmx.maskmovq
283   _mm_maskmove_si64(d, n, p);
284 }
285 
test_mm_max_pi16(__m64 a,__m64 b)286 __m64 test_mm_max_pi16(__m64 a, __m64 b) {
287   // CHECK-LABEL: test_mm_max_pi16
288   // CHECK: call x86_mmx @llvm.x86.mmx.pmaxs.w
289   return _mm_max_pi16(a, b);
290 }
291 
test_mm_max_pu8(__m64 a,__m64 b)292 __m64 test_mm_max_pu8(__m64 a, __m64 b) {
293   // CHECK-LABEL: test_mm_max_pu8
294   // CHECK: call x86_mmx @llvm.x86.mmx.pmaxu.b
295   return _mm_max_pu8(a, b);
296 }
297 
test_mm_min_pi16(__m64 a,__m64 b)298 __m64 test_mm_min_pi16(__m64 a, __m64 b) {
299   // CHECK-LABEL: test_mm_min_pi16
300   // CHECK: call x86_mmx @llvm.x86.mmx.pmins.w
301   return _mm_min_pi16(a, b);
302 }
303 
test_mm_min_pu8(__m64 a,__m64 b)304 __m64 test_mm_min_pu8(__m64 a, __m64 b) {
305   // CHECK-LABEL: test_mm_min_pu8
306   // CHECK: call x86_mmx @llvm.x86.mmx.pminu.b
307   return _mm_min_pu8(a, b);
308 }
309 
test_mm_movemask_pi8(__m64 a)310 int test_mm_movemask_pi8(__m64 a) {
311   // CHECK-LABEL: test_mm_movemask_pi8
312   // CHECK: call i32 @llvm.x86.mmx.pmovmskb
313   return _mm_movemask_pi8(a);
314 }
315 
test_mm_mul_su32(__m64 a,__m64 b)316 __m64 test_mm_mul_su32(__m64 a, __m64 b) {
317   // CHECK-LABEL: test_mm_mul_su32
318   // CHECK: call x86_mmx @llvm.x86.mmx.pmulu.dq
319   return _mm_mul_su32(a, b);
320 }
321 
test_mm_mulhi_pi16(__m64 a,__m64 b)322 __m64 test_mm_mulhi_pi16(__m64 a, __m64 b) {
323   // CHECK-LABEL: test_mm_mulhi_pi16
324   // CHECK: call x86_mmx @llvm.x86.mmx.pmulh.w
325   return _mm_mulhi_pi16(a, b);
326 }
327 
test_mm_mulhi_pu16(__m64 a,__m64 b)328 __m64 test_mm_mulhi_pu16(__m64 a, __m64 b) {
329   // CHECK-LABEL: test_mm_mulhi_pu16
330   // CHECK: call x86_mmx @llvm.x86.mmx.pmulhu.w
331   return _mm_mulhi_pu16(a, b);
332 }
333 
test_mm_mulhrs_pi16(__m64 a,__m64 b)334 __m64 test_mm_mulhrs_pi16(__m64 a, __m64 b) {
335   // CHECK-LABEL: test_mm_mulhrs_pi16
336   // CHECK: call x86_mmx @llvm.x86.ssse3.pmul.hr.sw
337   return _mm_mulhrs_pi16(a, b);
338 }
339 
test_mm_mullo_pi16(__m64 a,__m64 b)340 __m64 test_mm_mullo_pi16(__m64 a, __m64 b) {
341   // CHECK-LABEL: test_mm_mullo_pi16
342   // CHECK: call x86_mmx @llvm.x86.mmx.pmull.w
343   return _mm_mullo_pi16(a, b);
344 }
345 
test_mm_or_si64(__m64 a,__m64 b)346 __m64 test_mm_or_si64(__m64 a, __m64 b) {
347   // CHECK-LABEL: test_mm_or_si64
348   // CHECK: call x86_mmx @llvm.x86.mmx.por
349   return _mm_or_si64(a, b);
350 }
351 
test_mm_packs_pi16(__m64 a,__m64 b)352 __m64 test_mm_packs_pi16(__m64 a, __m64 b) {
353   // CHECK-LABEL: test_mm_packs_pi16
354   // CHECK: call x86_mmx @llvm.x86.mmx.packsswb
355   return _mm_packs_pi16(a, b);
356 }
357 
test_mm_packs_pi32(__m64 a,__m64 b)358 __m64 test_mm_packs_pi32(__m64 a, __m64 b) {
359   // CHECK-LABEL: test_mm_packs_pi32
360   // CHECK: call x86_mmx @llvm.x86.mmx.packssdw
361   return _mm_packs_pi32(a, b);
362 }
363 
test_mm_packs_pu16(__m64 a,__m64 b)364 __m64 test_mm_packs_pu16(__m64 a, __m64 b) {
365   // CHECK-LABEL: test_mm_packs_pu16
366   // CHECK: call x86_mmx @llvm.x86.mmx.packuswb
367   return _mm_packs_pu16(a, b);
368 }
369 
test_mm_sad_pu8(__m64 a,__m64 b)370 __m64 test_mm_sad_pu8(__m64 a, __m64 b) {
371   // CHECK-LABEL: test_mm_sad_pu8
372   // CHECK: call x86_mmx @llvm.x86.mmx.psad.bw
373   return _mm_sad_pu8(a, b);
374 }
375 
test_mm_shuffle_pi8(__m64 a,__m64 b)376 __m64 test_mm_shuffle_pi8(__m64 a, __m64 b) {
377   // CHECK-LABEL: test_mm_shuffle_pi8
378   // CHECK: call x86_mmx @llvm.x86.ssse3.pshuf.b
379   return _mm_shuffle_pi8(a, b);
380 }
381 
test_mm_shuffle_pi16(__m64 a)382 __m64 test_mm_shuffle_pi16(__m64 a) {
383   // CHECK-LABEL: test_mm_shuffle_pi16
384   // CHECK: call x86_mmx @llvm.x86.sse.pshuf.w
385   return _mm_shuffle_pi16(a, 3);
386 }
387 
test_mm_sign_pi8(__m64 a,__m64 b)388 __m64 test_mm_sign_pi8(__m64 a, __m64 b) {
389   // CHECK-LABEL: test_mm_sign_pi8
390   // CHECK: call x86_mmx @llvm.x86.ssse3.psign.b
391   return _mm_sign_pi8(a, b);
392 }
393 
test_mm_sign_pi16(__m64 a,__m64 b)394 __m64 test_mm_sign_pi16(__m64 a, __m64 b) {
395   // CHECK-LABEL: test_mm_sign_pi16
396   // CHECK: call x86_mmx @llvm.x86.ssse3.psign.w
397   return _mm_sign_pi16(a, b);
398 }
399 
test_mm_sign_pi32(__m64 a,__m64 b)400 __m64 test_mm_sign_pi32(__m64 a, __m64 b) {
401   // CHECK-LABEL: test_mm_sign_pi32
402   // CHECK: call x86_mmx @llvm.x86.ssse3.psign.d
403   return _mm_sign_pi32(a, b);
404 }
405 
test_mm_sll_pi16(__m64 a,__m64 b)406 __m64 test_mm_sll_pi16(__m64 a, __m64 b) {
407   // CHECK-LABEL: test_mm_sll_pi16
408   // CHECK: call x86_mmx @llvm.x86.mmx.psll.w
409   return _mm_sll_pi16(a, b);
410 }
411 
test_mm_sll_pi32(__m64 a,__m64 b)412 __m64 test_mm_sll_pi32(__m64 a, __m64 b) {
413   // CHECK-LABEL: test_mm_sll_pi32
414   // CHECK: call x86_mmx @llvm.x86.mmx.psll.d
415   return _mm_sll_pi32(a, b);
416 }
417 
test_mm_sll_si64(__m64 a,__m64 b)418 __m64 test_mm_sll_si64(__m64 a, __m64 b) {
419   // CHECK-LABEL: test_mm_sll_si64
420   // CHECK: call x86_mmx @llvm.x86.mmx.psll.q
421   return _mm_sll_si64(a, b);
422 }
423 
test_mm_slli_pi16(__m64 a)424 __m64 test_mm_slli_pi16(__m64 a) {
425   // CHECK-LABEL: test_mm_slli_pi16
426   // CHECK: call x86_mmx @llvm.x86.mmx.pslli.w
427   return _mm_slli_pi16(a, 3);
428 }
429 
test_mm_slli_pi32(__m64 a)430 __m64 test_mm_slli_pi32(__m64 a) {
431   // CHECK-LABEL: test_mm_slli_pi32
432   // CHECK: call x86_mmx @llvm.x86.mmx.pslli.d
433   return _mm_slli_pi32(a, 3);
434 }
435 
test_mm_slli_si64(__m64 a)436 __m64 test_mm_slli_si64(__m64 a) {
437   // CHECK-LABEL: test_mm_slli_si64
438   // CHECK: call x86_mmx @llvm.x86.mmx.pslli.q
439   return _mm_slli_si64(a, 3);
440 }
441 
test_mm_sra_pi16(__m64 a,__m64 b)442 __m64 test_mm_sra_pi16(__m64 a, __m64 b) {
443   // CHECK-LABEL: test_mm_sra_pi16
444   // CHECK: call x86_mmx @llvm.x86.mmx.psra.w
445   return _mm_sra_pi16(a, b);
446 }
447 
test_mm_sra_pi32(__m64 a,__m64 b)448 __m64 test_mm_sra_pi32(__m64 a, __m64 b) {
449   // CHECK-LABEL: test_mm_sra_pi32
450   // CHECK: call x86_mmx @llvm.x86.mmx.psra.d
451   return _mm_sra_pi32(a, b);
452 }
453 
test_mm_srai_pi16(__m64 a)454 __m64 test_mm_srai_pi16(__m64 a) {
455   // CHECK-LABEL: test_mm_srai_pi16
456   // CHECK: call x86_mmx @llvm.x86.mmx.psrai.w
457   return _mm_srai_pi16(a, 3);
458 }
459 
test_mm_srai_pi32(__m64 a)460 __m64 test_mm_srai_pi32(__m64 a) {
461   // CHECK-LABEL: test_mm_srai_pi32
462   // CHECK: call x86_mmx @llvm.x86.mmx.psrai.d
463   return _mm_srai_pi32(a, 3);
464 }
465 
test_mm_srl_pi16(__m64 a,__m64 b)466 __m64 test_mm_srl_pi16(__m64 a, __m64 b) {
467   // CHECK-LABEL: test_mm_srl_pi16
468   // CHECK: call x86_mmx @llvm.x86.mmx.psrl.w
469   return _mm_srl_pi16(a, b);
470 }
471 
test_mm_srl_pi32(__m64 a,__m64 b)472 __m64 test_mm_srl_pi32(__m64 a, __m64 b) {
473   // CHECK-LABEL: test_mm_srl_pi32
474   // CHECK: call x86_mmx @llvm.x86.mmx.psrl.d
475   return _mm_srl_pi32(a, b);
476 }
477 
test_mm_srl_si64(__m64 a,__m64 b)478 __m64 test_mm_srl_si64(__m64 a, __m64 b) {
479   // CHECK-LABEL: test_mm_srl_si64
480   // CHECK: call x86_mmx @llvm.x86.mmx.psrl.q
481   return _mm_srl_si64(a, b);
482 }
483 
test_mm_srli_pi16(__m64 a)484 __m64 test_mm_srli_pi16(__m64 a) {
485   // CHECK-LABEL: test_mm_srli_pi16
486   // CHECK: call x86_mmx @llvm.x86.mmx.psrli.w
487   return _mm_srli_pi16(a, 3);
488 }
489 
test_mm_srli_pi32(__m64 a)490 __m64 test_mm_srli_pi32(__m64 a) {
491   // CHECK-LABEL: test_mm_srli_pi32
492   // CHECK: call x86_mmx @llvm.x86.mmx.psrli.d
493   return _mm_srli_pi32(a, 3);
494 }
495 
test_mm_srli_si64(__m64 a)496 __m64 test_mm_srli_si64(__m64 a) {
497   // CHECK-LABEL: test_mm_srli_si64
498   // CHECK: call x86_mmx @llvm.x86.mmx.psrli.q
499   return _mm_srli_si64(a, 3);
500 }
501 
test_mm_stream_pi(__m64 * p,__m64 a)502 void test_mm_stream_pi(__m64 *p, __m64 a) {
503   // CHECK-LABEL: test_mm_stream_pi
504   // CHECK: call void @llvm.x86.mmx.movnt.dq
505   _mm_stream_pi(p, a);
506 }
507 
test_mm_sub_pi8(__m64 a,__m64 b)508 __m64 test_mm_sub_pi8(__m64 a, __m64 b) {
509   // CHECK-LABEL: test_mm_sub_pi8
510   // CHECK: call x86_mmx @llvm.x86.mmx.psub.b
511   return _mm_sub_pi8(a, b);
512 }
513 
test_mm_sub_pi16(__m64 a,__m64 b)514 __m64 test_mm_sub_pi16(__m64 a, __m64 b) {
515   // CHECK-LABEL: test_mm_sub_pi16
516   // CHECK: call x86_mmx @llvm.x86.mmx.psub.w
517   return _mm_sub_pi16(a, b);
518 }
519 
test_mm_sub_pi32(__m64 a,__m64 b)520 __m64 test_mm_sub_pi32(__m64 a, __m64 b) {
521   // CHECK-LABEL: test_mm_sub_pi32
522   // CHECK: call x86_mmx @llvm.x86.mmx.psub.d
523   return _mm_sub_pi32(a, b);
524 }
525 
test_mm_sub_si64(__m64 a,__m64 b)526 __m64 test_mm_sub_si64(__m64 a, __m64 b) {
527   // CHECK-LABEL: test_mm_sub_si64
528   // CHECK: call x86_mmx @llvm.x86.mmx.psub.q
529   return __builtin_ia32_psubq(a, b);
530 }
531 
test_mm_subs_pi8(__m64 a,__m64 b)532 __m64 test_mm_subs_pi8(__m64 a, __m64 b) {
533   // CHECK-LABEL: test_mm_subs_pi8
534   // CHECK: call x86_mmx @llvm.x86.mmx.psubs.b
535   return _mm_subs_pi8(a, b);
536 }
537 
test_mm_subs_pi16(__m64 a,__m64 b)538 __m64 test_mm_subs_pi16(__m64 a, __m64 b) {
539   // CHECK-LABEL: test_mm_subs_pi16
540   // CHECK: call x86_mmx @llvm.x86.mmx.psubs.w
541   return _mm_subs_pi16(a, b);
542 }
543 
test_mm_subs_pu8(__m64 a,__m64 b)544 __m64 test_mm_subs_pu8(__m64 a, __m64 b) {
545   // CHECK-LABEL: test_mm_subs_pu8
546   // CHECK: call x86_mmx @llvm.x86.mmx.psubus.b
547   return _mm_subs_pu8(a, b);
548 }
549 
test_mm_subs_pu16(__m64 a,__m64 b)550 __m64 test_mm_subs_pu16(__m64 a, __m64 b) {
551   // CHECK-LABEL: test_mm_subs_pu16
552   // CHECK: call x86_mmx @llvm.x86.mmx.psubus.w
553   return _mm_subs_pu16(a, b);
554 }
555 
test_m_to_int(__m64 a)556 int test_m_to_int(__m64 a) {
557   // CHECK-LABEL: test_m_to_int
558   // CHECK: extractelement <2 x i32>
559   return _m_to_int(a);
560 }
561 
test_m_to_int64(__m64 a)562 long long test_m_to_int64(__m64 a) {
563   // CHECK-LABEL: test_m_to_int64
564   // CHECK: bitcast
565   return _m_to_int64(a);
566 }
567 
test_mm_unpackhi_pi8(__m64 a,__m64 b)568 __m64 test_mm_unpackhi_pi8(__m64 a, __m64 b) {
569   // CHECK-LABEL: test_mm_unpackhi_pi8
570   // CHECK: call x86_mmx @llvm.x86.mmx.punpckhbw
571   return _mm_unpackhi_pi8(a, b);
572 }
573 
test_mm_unpackhi_pi16(__m64 a,__m64 b)574 __m64 test_mm_unpackhi_pi16(__m64 a, __m64 b) {
575   // CHECK-LABEL: test_mm_unpackhi_pi16
576   // CHECK: call x86_mmx @llvm.x86.mmx.punpckhwd
577   return _mm_unpackhi_pi16(a, b);
578 }
579 
test_mm_unpackhi_pi32(__m64 a,__m64 b)580 __m64 test_mm_unpackhi_pi32(__m64 a, __m64 b) {
581   // CHECK-LABEL: test_mm_unpackhi_pi32
582   // CHECK: call x86_mmx @llvm.x86.mmx.punpckhdq
583   return _mm_unpackhi_pi32(a, b);
584 }
585 
test_mm_unpacklo_pi8(__m64 a,__m64 b)586 __m64 test_mm_unpacklo_pi8(__m64 a, __m64 b) {
587   // CHECK-LABEL: test_mm_unpacklo_pi8
588   // CHECK: call x86_mmx @llvm.x86.mmx.punpcklbw
589   return _mm_unpacklo_pi8(a, b);
590 }
591 
test_mm_unpacklo_pi16(__m64 a,__m64 b)592 __m64 test_mm_unpacklo_pi16(__m64 a, __m64 b) {
593   // CHECK-LABEL: test_mm_unpacklo_pi16
594   // CHECK: call x86_mmx @llvm.x86.mmx.punpcklwd
595   return _mm_unpacklo_pi16(a, b);
596 }
597 
test_mm_unpacklo_pi32(__m64 a,__m64 b)598 __m64 test_mm_unpacklo_pi32(__m64 a, __m64 b) {
599   // CHECK-LABEL: test_mm_unpacklo_pi32
600   // CHECK: call x86_mmx @llvm.x86.mmx.punpckldq
601   return _mm_unpacklo_pi32(a, b);
602 }
603 
test_mm_xor_si64(__m64 a,__m64 b)604 __m64 test_mm_xor_si64(__m64 a, __m64 b) {
605   // CHECK-LABEL: test_mm_xor_si64
606   // CHECK: call x86_mmx @llvm.x86.mmx.pxor
607   return _mm_xor_si64(a, b);
608 }
609