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(x86_mmx %{{.*}}, x86_mmx %{{.*}})
48   return _mm_add_si64(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_mm_extract_pi16(__m64 a)220 int test_mm_extract_pi16(__m64 a) {
221   // CHECK-LABEL: test_mm_extract_pi16
222   // CHECK: call i32 @llvm.x86.mmx.pextr.w
223   return _mm_extract_pi16(a, 2);
224 }
225 
test_m_from_int(int a)226 __m64 test_m_from_int(int a) {
227   // CHECK-LABEL: test_m_from_int
228   // CHECK: insertelement <2 x i32>
229   return _m_from_int(a);
230 }
231 
test_m_from_int64(long long a)232 __m64 test_m_from_int64(long long a) {
233   // CHECK-LABEL: test_m_from_int64
234   // CHECK: bitcast
235   return _m_from_int64(a);
236 }
237 
test_mm_hadd_pi16(__m64 a,__m64 b)238 __m64 test_mm_hadd_pi16(__m64 a, __m64 b) {
239   // CHECK-LABEL: test_mm_hadd_pi16
240   // CHECK: call x86_mmx @llvm.x86.ssse3.phadd.w
241   return _mm_hadd_pi16(a, b);
242 }
243 
test_mm_hadd_pi32(__m64 a,__m64 b)244 __m64 test_mm_hadd_pi32(__m64 a, __m64 b) {
245   // CHECK-LABEL: test_mm_hadd_pi32
246   // CHECK: call x86_mmx @llvm.x86.ssse3.phadd.d
247   return _mm_hadd_pi32(a, b);
248 }
249 
test_mm_hadds_pi16(__m64 a,__m64 b)250 __m64 test_mm_hadds_pi16(__m64 a, __m64 b) {
251   // CHECK-LABEL: test_mm_hadds_pi16
252   // CHECK: call x86_mmx @llvm.x86.ssse3.phadd.sw
253   return _mm_hadds_pi16(a, b);
254 }
255 
test_mm_hsub_pi16(__m64 a,__m64 b)256 __m64 test_mm_hsub_pi16(__m64 a, __m64 b) {
257   // CHECK-LABEL: test_mm_hsub_pi16
258   // CHECK: call x86_mmx @llvm.x86.ssse3.phsub.w
259   return _mm_hsub_pi16(a, b);
260 }
261 
test_mm_hsub_pi32(__m64 a,__m64 b)262 __m64 test_mm_hsub_pi32(__m64 a, __m64 b) {
263   // CHECK-LABEL: test_mm_hsub_pi32
264   // CHECK: call x86_mmx @llvm.x86.ssse3.phsub.d
265   return _mm_hsub_pi32(a, b);
266 }
267 
test_mm_hsubs_pi16(__m64 a,__m64 b)268 __m64 test_mm_hsubs_pi16(__m64 a, __m64 b) {
269   // CHECK-LABEL: test_mm_hsubs_pi16
270   // CHECK: call x86_mmx @llvm.x86.ssse3.phsub.sw
271   return _mm_hsubs_pi16(a, b);
272 }
273 
test_mm_insert_pi16(__m64 a,int d)274 __m64 test_mm_insert_pi16(__m64 a, int d) {
275   // CHECK-LABEL: test_mm_insert_pi16
276   // CHECK: call x86_mmx @llvm.x86.mmx.pinsr.w
277   return _mm_insert_pi16(a, d, 2);
278 }
279 
test_mm_madd_pi16(__m64 a,__m64 b)280 __m64 test_mm_madd_pi16(__m64 a, __m64 b) {
281   // CHECK-LABEL: test_mm_madd_pi16
282   // CHECK: call x86_mmx @llvm.x86.mmx.pmadd.wd
283   return _mm_madd_pi16(a, b);
284 }
285 
test_mm_maddubs_pi16(__m64 a,__m64 b)286 __m64 test_mm_maddubs_pi16(__m64 a, __m64 b) {
287   // CHECK-LABEL: test_mm_maddubs_pi16
288   // CHECK: call x86_mmx @llvm.x86.ssse3.pmadd.ub.sw
289   return _mm_maddubs_pi16(a, b);
290 }
291 
test_mm_maskmove_si64(__m64 d,__m64 n,char * p)292 void test_mm_maskmove_si64(__m64 d, __m64 n, char *p) {
293   // CHECK-LABEL: test_mm_maskmove_si64
294   // CHECK: call void @llvm.x86.mmx.maskmovq
295   _mm_maskmove_si64(d, n, p);
296 }
297 
test_mm_max_pi16(__m64 a,__m64 b)298 __m64 test_mm_max_pi16(__m64 a, __m64 b) {
299   // CHECK-LABEL: test_mm_max_pi16
300   // CHECK: call x86_mmx @llvm.x86.mmx.pmaxs.w
301   return _mm_max_pi16(a, b);
302 }
303 
test_mm_max_pu8(__m64 a,__m64 b)304 __m64 test_mm_max_pu8(__m64 a, __m64 b) {
305   // CHECK-LABEL: test_mm_max_pu8
306   // CHECK: call x86_mmx @llvm.x86.mmx.pmaxu.b
307   return _mm_max_pu8(a, b);
308 }
309 
test_mm_min_pi16(__m64 a,__m64 b)310 __m64 test_mm_min_pi16(__m64 a, __m64 b) {
311   // CHECK-LABEL: test_mm_min_pi16
312   // CHECK: call x86_mmx @llvm.x86.mmx.pmins.w
313   return _mm_min_pi16(a, b);
314 }
315 
test_mm_min_pu8(__m64 a,__m64 b)316 __m64 test_mm_min_pu8(__m64 a, __m64 b) {
317   // CHECK-LABEL: test_mm_min_pu8
318   // CHECK: call x86_mmx @llvm.x86.mmx.pminu.b
319   return _mm_min_pu8(a, b);
320 }
321 
test_mm_movemask_pi8(__m64 a)322 int test_mm_movemask_pi8(__m64 a) {
323   // CHECK-LABEL: test_mm_movemask_pi8
324   // CHECK: call i32 @llvm.x86.mmx.pmovmskb
325   return _mm_movemask_pi8(a);
326 }
327 
test_mm_mul_su32(__m64 a,__m64 b)328 __m64 test_mm_mul_su32(__m64 a, __m64 b) {
329   // CHECK-LABEL: test_mm_mul_su32
330   // CHECK: call x86_mmx @llvm.x86.mmx.pmulu.dq(x86_mmx %{{.*}}, x86_mmx %{{.*}})
331   return _mm_mul_su32(a, b);
332 }
333 
test_mm_mulhi_pi16(__m64 a,__m64 b)334 __m64 test_mm_mulhi_pi16(__m64 a, __m64 b) {
335   // CHECK-LABEL: test_mm_mulhi_pi16
336   // CHECK: call x86_mmx @llvm.x86.mmx.pmulh.w
337   return _mm_mulhi_pi16(a, b);
338 }
339 
test_mm_mulhi_pu16(__m64 a,__m64 b)340 __m64 test_mm_mulhi_pu16(__m64 a, __m64 b) {
341   // CHECK-LABEL: test_mm_mulhi_pu16
342   // CHECK: call x86_mmx @llvm.x86.mmx.pmulhu.w
343   return _mm_mulhi_pu16(a, b);
344 }
345 
test_mm_mulhrs_pi16(__m64 a,__m64 b)346 __m64 test_mm_mulhrs_pi16(__m64 a, __m64 b) {
347   // CHECK-LABEL: test_mm_mulhrs_pi16
348   // CHECK: call x86_mmx @llvm.x86.ssse3.pmul.hr.sw
349   return _mm_mulhrs_pi16(a, b);
350 }
351 
test_mm_mullo_pi16(__m64 a,__m64 b)352 __m64 test_mm_mullo_pi16(__m64 a, __m64 b) {
353   // CHECK-LABEL: test_mm_mullo_pi16
354   // CHECK: call x86_mmx @llvm.x86.mmx.pmull.w
355   return _mm_mullo_pi16(a, b);
356 }
357 
test_mm_or_si64(__m64 a,__m64 b)358 __m64 test_mm_or_si64(__m64 a, __m64 b) {
359   // CHECK-LABEL: test_mm_or_si64
360   // CHECK: call x86_mmx @llvm.x86.mmx.por
361   return _mm_or_si64(a, b);
362 }
363 
test_mm_packs_pi16(__m64 a,__m64 b)364 __m64 test_mm_packs_pi16(__m64 a, __m64 b) {
365   // CHECK-LABEL: test_mm_packs_pi16
366   // CHECK: call x86_mmx @llvm.x86.mmx.packsswb
367   return _mm_packs_pi16(a, b);
368 }
369 
test_mm_packs_pi32(__m64 a,__m64 b)370 __m64 test_mm_packs_pi32(__m64 a, __m64 b) {
371   // CHECK-LABEL: test_mm_packs_pi32
372   // CHECK: call x86_mmx @llvm.x86.mmx.packssdw
373   return _mm_packs_pi32(a, b);
374 }
375 
test_mm_packs_pu16(__m64 a,__m64 b)376 __m64 test_mm_packs_pu16(__m64 a, __m64 b) {
377   // CHECK-LABEL: test_mm_packs_pu16
378   // CHECK: call x86_mmx @llvm.x86.mmx.packuswb
379   return _mm_packs_pu16(a, b);
380 }
381 
test_mm_sad_pu8(__m64 a,__m64 b)382 __m64 test_mm_sad_pu8(__m64 a, __m64 b) {
383   // CHECK-LABEL: test_mm_sad_pu8
384   // CHECK: call x86_mmx @llvm.x86.mmx.psad.bw
385   return _mm_sad_pu8(a, b);
386 }
387 
test_mm_shuffle_pi8(__m64 a,__m64 b)388 __m64 test_mm_shuffle_pi8(__m64 a, __m64 b) {
389   // CHECK-LABEL: test_mm_shuffle_pi8
390   // CHECK: call x86_mmx @llvm.x86.ssse3.pshuf.b
391   return _mm_shuffle_pi8(a, b);
392 }
393 
test_mm_shuffle_pi16(__m64 a)394 __m64 test_mm_shuffle_pi16(__m64 a) {
395   // CHECK-LABEL: test_mm_shuffle_pi16
396   // CHECK: call x86_mmx @llvm.x86.sse.pshuf.w
397   return _mm_shuffle_pi16(a, 3);
398 }
399 
test_mm_sign_pi8(__m64 a,__m64 b)400 __m64 test_mm_sign_pi8(__m64 a, __m64 b) {
401   // CHECK-LABEL: test_mm_sign_pi8
402   // CHECK: call x86_mmx @llvm.x86.ssse3.psign.b
403   return _mm_sign_pi8(a, b);
404 }
405 
test_mm_sign_pi16(__m64 a,__m64 b)406 __m64 test_mm_sign_pi16(__m64 a, __m64 b) {
407   // CHECK-LABEL: test_mm_sign_pi16
408   // CHECK: call x86_mmx @llvm.x86.ssse3.psign.w
409   return _mm_sign_pi16(a, b);
410 }
411 
test_mm_sign_pi32(__m64 a,__m64 b)412 __m64 test_mm_sign_pi32(__m64 a, __m64 b) {
413   // CHECK-LABEL: test_mm_sign_pi32
414   // CHECK: call x86_mmx @llvm.x86.ssse3.psign.d
415   return _mm_sign_pi32(a, b);
416 }
417 
test_mm_sll_pi16(__m64 a,__m64 b)418 __m64 test_mm_sll_pi16(__m64 a, __m64 b) {
419   // CHECK-LABEL: test_mm_sll_pi16
420   // CHECK: call x86_mmx @llvm.x86.mmx.psll.w
421   return _mm_sll_pi16(a, b);
422 }
423 
test_mm_sll_pi32(__m64 a,__m64 b)424 __m64 test_mm_sll_pi32(__m64 a, __m64 b) {
425   // CHECK-LABEL: test_mm_sll_pi32
426   // CHECK: call x86_mmx @llvm.x86.mmx.psll.d
427   return _mm_sll_pi32(a, b);
428 }
429 
test_mm_sll_si64(__m64 a,__m64 b)430 __m64 test_mm_sll_si64(__m64 a, __m64 b) {
431   // CHECK-LABEL: test_mm_sll_si64
432   // CHECK: call x86_mmx @llvm.x86.mmx.psll.q
433   return _mm_sll_si64(a, b);
434 }
435 
test_mm_slli_pi16(__m64 a)436 __m64 test_mm_slli_pi16(__m64 a) {
437   // CHECK-LABEL: test_mm_slli_pi16
438   // CHECK: call x86_mmx @llvm.x86.mmx.pslli.w
439   return _mm_slli_pi16(a, 3);
440 }
441 
test_mm_slli_pi32(__m64 a)442 __m64 test_mm_slli_pi32(__m64 a) {
443   // CHECK-LABEL: test_mm_slli_pi32
444   // CHECK: call x86_mmx @llvm.x86.mmx.pslli.d
445   return _mm_slli_pi32(a, 3);
446 }
447 
test_mm_slli_si64(__m64 a)448 __m64 test_mm_slli_si64(__m64 a) {
449   // CHECK-LABEL: test_mm_slli_si64
450   // CHECK: call x86_mmx @llvm.x86.mmx.pslli.q
451   return _mm_slli_si64(a, 3);
452 }
453 
test_mm_sra_pi16(__m64 a,__m64 b)454 __m64 test_mm_sra_pi16(__m64 a, __m64 b) {
455   // CHECK-LABEL: test_mm_sra_pi16
456   // CHECK: call x86_mmx @llvm.x86.mmx.psra.w
457   return _mm_sra_pi16(a, b);
458 }
459 
test_mm_sra_pi32(__m64 a,__m64 b)460 __m64 test_mm_sra_pi32(__m64 a, __m64 b) {
461   // CHECK-LABEL: test_mm_sra_pi32
462   // CHECK: call x86_mmx @llvm.x86.mmx.psra.d
463   return _mm_sra_pi32(a, b);
464 }
465 
test_mm_srai_pi16(__m64 a)466 __m64 test_mm_srai_pi16(__m64 a) {
467   // CHECK-LABEL: test_mm_srai_pi16
468   // CHECK: call x86_mmx @llvm.x86.mmx.psrai.w
469   return _mm_srai_pi16(a, 3);
470 }
471 
test_mm_srai_pi32(__m64 a)472 __m64 test_mm_srai_pi32(__m64 a) {
473   // CHECK-LABEL: test_mm_srai_pi32
474   // CHECK: call x86_mmx @llvm.x86.mmx.psrai.d
475   return _mm_srai_pi32(a, 3);
476 }
477 
test_mm_srl_pi16(__m64 a,__m64 b)478 __m64 test_mm_srl_pi16(__m64 a, __m64 b) {
479   // CHECK-LABEL: test_mm_srl_pi16
480   // CHECK: call x86_mmx @llvm.x86.mmx.psrl.w
481   return _mm_srl_pi16(a, b);
482 }
483 
test_mm_srl_pi32(__m64 a,__m64 b)484 __m64 test_mm_srl_pi32(__m64 a, __m64 b) {
485   // CHECK-LABEL: test_mm_srl_pi32
486   // CHECK: call x86_mmx @llvm.x86.mmx.psrl.d
487   return _mm_srl_pi32(a, b);
488 }
489 
test_mm_srl_si64(__m64 a,__m64 b)490 __m64 test_mm_srl_si64(__m64 a, __m64 b) {
491   // CHECK-LABEL: test_mm_srl_si64
492   // CHECK: call x86_mmx @llvm.x86.mmx.psrl.q
493   return _mm_srl_si64(a, b);
494 }
495 
test_mm_srli_pi16(__m64 a)496 __m64 test_mm_srli_pi16(__m64 a) {
497   // CHECK-LABEL: test_mm_srli_pi16
498   // CHECK: call x86_mmx @llvm.x86.mmx.psrli.w
499   return _mm_srli_pi16(a, 3);
500 }
501 
test_mm_srli_pi32(__m64 a)502 __m64 test_mm_srli_pi32(__m64 a) {
503   // CHECK-LABEL: test_mm_srli_pi32
504   // CHECK: call x86_mmx @llvm.x86.mmx.psrli.d
505   return _mm_srli_pi32(a, 3);
506 }
507 
test_mm_srli_si64(__m64 a)508 __m64 test_mm_srli_si64(__m64 a) {
509   // CHECK-LABEL: test_mm_srli_si64
510   // CHECK: call x86_mmx @llvm.x86.mmx.psrli.q
511   return _mm_srli_si64(a, 3);
512 }
513 
test_mm_stream_pi(__m64 * p,__m64 a)514 void test_mm_stream_pi(__m64 *p, __m64 a) {
515   // CHECK-LABEL: test_mm_stream_pi
516   // CHECK: call void @llvm.x86.mmx.movnt.dq
517   _mm_stream_pi(p, a);
518 }
519 
test_mm_sub_pi8(__m64 a,__m64 b)520 __m64 test_mm_sub_pi8(__m64 a, __m64 b) {
521   // CHECK-LABEL: test_mm_sub_pi8
522   // CHECK: call x86_mmx @llvm.x86.mmx.psub.b
523   return _mm_sub_pi8(a, b);
524 }
525 
test_mm_sub_pi16(__m64 a,__m64 b)526 __m64 test_mm_sub_pi16(__m64 a, __m64 b) {
527   // CHECK-LABEL: test_mm_sub_pi16
528   // CHECK: call x86_mmx @llvm.x86.mmx.psub.w
529   return _mm_sub_pi16(a, b);
530 }
531 
test_mm_sub_pi32(__m64 a,__m64 b)532 __m64 test_mm_sub_pi32(__m64 a, __m64 b) {
533   // CHECK-LABEL: test_mm_sub_pi32
534   // CHECK: call x86_mmx @llvm.x86.mmx.psub.d
535   return _mm_sub_pi32(a, b);
536 }
537 
test_mm_sub_si64(__m64 a,__m64 b)538 __m64 test_mm_sub_si64(__m64 a, __m64 b) {
539   // CHECK-LABEL: test_mm_sub_si64
540   // CHECK: call x86_mmx @llvm.x86.mmx.psub.q(x86_mmx %{{.*}}, x86_mmx %{{.*}})
541   return _mm_sub_si64(a, b);
542 }
543 
test_mm_subs_pi8(__m64 a,__m64 b)544 __m64 test_mm_subs_pi8(__m64 a, __m64 b) {
545   // CHECK-LABEL: test_mm_subs_pi8
546   // CHECK: call x86_mmx @llvm.x86.mmx.psubs.b
547   return _mm_subs_pi8(a, b);
548 }
549 
test_mm_subs_pi16(__m64 a,__m64 b)550 __m64 test_mm_subs_pi16(__m64 a, __m64 b) {
551   // CHECK-LABEL: test_mm_subs_pi16
552   // CHECK: call x86_mmx @llvm.x86.mmx.psubs.w
553   return _mm_subs_pi16(a, b);
554 }
555 
test_mm_subs_pu8(__m64 a,__m64 b)556 __m64 test_mm_subs_pu8(__m64 a, __m64 b) {
557   // CHECK-LABEL: test_mm_subs_pu8
558   // CHECK: call x86_mmx @llvm.x86.mmx.psubus.b
559   return _mm_subs_pu8(a, b);
560 }
561 
test_mm_subs_pu16(__m64 a,__m64 b)562 __m64 test_mm_subs_pu16(__m64 a, __m64 b) {
563   // CHECK-LABEL: test_mm_subs_pu16
564   // CHECK: call x86_mmx @llvm.x86.mmx.psubus.w
565   return _mm_subs_pu16(a, b);
566 }
567 
test_m_to_int(__m64 a)568 int test_m_to_int(__m64 a) {
569   // CHECK-LABEL: test_m_to_int
570   // CHECK: extractelement <2 x i32>
571   return _m_to_int(a);
572 }
573 
test_m_to_int64(__m64 a)574 long long test_m_to_int64(__m64 a) {
575   // CHECK-LABEL: test_m_to_int64
576   // CHECK: bitcast
577   return _m_to_int64(a);
578 }
579 
test_mm_unpackhi_pi8(__m64 a,__m64 b)580 __m64 test_mm_unpackhi_pi8(__m64 a, __m64 b) {
581   // CHECK-LABEL: test_mm_unpackhi_pi8
582   // CHECK: call x86_mmx @llvm.x86.mmx.punpckhbw
583   return _mm_unpackhi_pi8(a, b);
584 }
585 
test_mm_unpackhi_pi16(__m64 a,__m64 b)586 __m64 test_mm_unpackhi_pi16(__m64 a, __m64 b) {
587   // CHECK-LABEL: test_mm_unpackhi_pi16
588   // CHECK: call x86_mmx @llvm.x86.mmx.punpckhwd
589   return _mm_unpackhi_pi16(a, b);
590 }
591 
test_mm_unpackhi_pi32(__m64 a,__m64 b)592 __m64 test_mm_unpackhi_pi32(__m64 a, __m64 b) {
593   // CHECK-LABEL: test_mm_unpackhi_pi32
594   // CHECK: call x86_mmx @llvm.x86.mmx.punpckhdq
595   return _mm_unpackhi_pi32(a, b);
596 }
597 
test_mm_unpacklo_pi8(__m64 a,__m64 b)598 __m64 test_mm_unpacklo_pi8(__m64 a, __m64 b) {
599   // CHECK-LABEL: test_mm_unpacklo_pi8
600   // CHECK: call x86_mmx @llvm.x86.mmx.punpcklbw
601   return _mm_unpacklo_pi8(a, b);
602 }
603 
test_mm_unpacklo_pi16(__m64 a,__m64 b)604 __m64 test_mm_unpacklo_pi16(__m64 a, __m64 b) {
605   // CHECK-LABEL: test_mm_unpacklo_pi16
606   // CHECK: call x86_mmx @llvm.x86.mmx.punpcklwd
607   return _mm_unpacklo_pi16(a, b);
608 }
609 
test_mm_unpacklo_pi32(__m64 a,__m64 b)610 __m64 test_mm_unpacklo_pi32(__m64 a, __m64 b) {
611   // CHECK-LABEL: test_mm_unpacklo_pi32
612   // CHECK: call x86_mmx @llvm.x86.mmx.punpckldq
613   return _mm_unpacklo_pi32(a, b);
614 }
615 
test_mm_xor_si64(__m64 a,__m64 b)616 __m64 test_mm_xor_si64(__m64 a, __m64 b) {
617   // CHECK-LABEL: test_mm_xor_si64
618   // CHECK: call x86_mmx @llvm.x86.mmx.pxor
619   return _mm_xor_si64(a, b);
620 }
621