xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/mmx-builtins.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // REQUIRES: x86-registered-target
2f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -O3 -triple=x86_64-apple-darwin -target-feature +ssse3 -S -o - | FileCheck %s
3f4a2713aSLionel Sambuc 
4f4a2713aSLionel Sambuc // FIXME: Disable inclusion of mm_malloc.h, our current implementation is broken
5f4a2713aSLionel Sambuc // on win32 since we don't generally know how to find errno.h.
6f4a2713aSLionel Sambuc #define __MM_MALLOC_H
7f4a2713aSLionel Sambuc 
8f4a2713aSLionel Sambuc #include <tmmintrin.h>
9f4a2713aSLionel Sambuc 
test1(__m64 a,__m64 b)10f4a2713aSLionel Sambuc __m64 test1(__m64 a, __m64 b) {
11f4a2713aSLionel Sambuc   // CHECK: phaddw
12f4a2713aSLionel Sambuc   return _mm_hadd_pi16(a, b);
13f4a2713aSLionel Sambuc }
14f4a2713aSLionel Sambuc 
test2(__m64 a,__m64 b)15f4a2713aSLionel Sambuc __m64 test2(__m64 a, __m64 b) {
16f4a2713aSLionel Sambuc   // CHECK: phaddd
17f4a2713aSLionel Sambuc   return _mm_hadd_pi32(a, b);
18f4a2713aSLionel Sambuc }
19f4a2713aSLionel Sambuc 
test3(__m64 a,__m64 b)20f4a2713aSLionel Sambuc __m64 test3(__m64 a, __m64 b) {
21f4a2713aSLionel Sambuc   // CHECK: phaddsw
22f4a2713aSLionel Sambuc   return _mm_hadds_pi16(a, b);
23f4a2713aSLionel Sambuc }
24f4a2713aSLionel Sambuc 
test4(__m64 a,__m64 b)25f4a2713aSLionel Sambuc __m64 test4(__m64 a, __m64 b) {
26f4a2713aSLionel Sambuc   // CHECK: phsubw
27f4a2713aSLionel Sambuc   return _mm_hsub_pi16(a, b);
28f4a2713aSLionel Sambuc }
29f4a2713aSLionel Sambuc 
test5(__m64 a,__m64 b)30f4a2713aSLionel Sambuc __m64 test5(__m64 a, __m64 b) {
31f4a2713aSLionel Sambuc   // CHECK: phsubd
32f4a2713aSLionel Sambuc   return _mm_hsub_pi32(a, b);
33f4a2713aSLionel Sambuc }
34f4a2713aSLionel Sambuc 
test6(__m64 a,__m64 b)35f4a2713aSLionel Sambuc __m64 test6(__m64 a, __m64 b) {
36f4a2713aSLionel Sambuc   // CHECK: phsubsw
37f4a2713aSLionel Sambuc   return _mm_hsubs_pi16(a, b);
38f4a2713aSLionel Sambuc }
39f4a2713aSLionel Sambuc 
test7(__m64 a,__m64 b)40f4a2713aSLionel Sambuc __m64 test7(__m64 a, __m64 b) {
41f4a2713aSLionel Sambuc   // CHECK: pmaddubsw
42f4a2713aSLionel Sambuc   return _mm_maddubs_pi16(a, b);
43f4a2713aSLionel Sambuc }
44f4a2713aSLionel Sambuc 
test8(__m64 a,__m64 b)45f4a2713aSLionel Sambuc __m64 test8(__m64 a, __m64 b) {
46f4a2713aSLionel Sambuc   // CHECK: pmulhrsw
47f4a2713aSLionel Sambuc   return _mm_mulhrs_pi16(a, b);
48f4a2713aSLionel Sambuc }
49f4a2713aSLionel Sambuc 
test9(__m64 a,__m64 b)50f4a2713aSLionel Sambuc __m64 test9(__m64 a, __m64 b) {
51f4a2713aSLionel Sambuc   // CHECK: pshufb
52f4a2713aSLionel Sambuc   return _mm_shuffle_pi8(a, b);
53f4a2713aSLionel Sambuc }
54f4a2713aSLionel Sambuc 
test10(__m64 a,__m64 b)55f4a2713aSLionel Sambuc __m64 test10(__m64 a, __m64 b) {
56f4a2713aSLionel Sambuc   // CHECK: psignb
57f4a2713aSLionel Sambuc   return _mm_sign_pi8(a, b);
58f4a2713aSLionel Sambuc }
59f4a2713aSLionel Sambuc 
test11(__m64 a,__m64 b)60f4a2713aSLionel Sambuc __m64 test11(__m64 a, __m64 b) {
61f4a2713aSLionel Sambuc   // CHECK: psignw
62f4a2713aSLionel Sambuc   return _mm_sign_pi16(a, b);
63f4a2713aSLionel Sambuc }
64f4a2713aSLionel Sambuc 
test12(__m64 a,__m64 b)65f4a2713aSLionel Sambuc __m64 test12(__m64 a, __m64 b) {
66f4a2713aSLionel Sambuc   // CHECK: psignd
67f4a2713aSLionel Sambuc   return _mm_sign_pi32(a, b);
68f4a2713aSLionel Sambuc }
69f4a2713aSLionel Sambuc 
test13(__m64 a)70f4a2713aSLionel Sambuc __m64 test13(__m64 a) {
71f4a2713aSLionel Sambuc   // CHECK: pabsb
72f4a2713aSLionel Sambuc   return _mm_abs_pi8(a);
73f4a2713aSLionel Sambuc }
74f4a2713aSLionel Sambuc 
test14(__m64 a)75f4a2713aSLionel Sambuc __m64 test14(__m64 a) {
76f4a2713aSLionel Sambuc   // CHECK: pabsw
77f4a2713aSLionel Sambuc   return _mm_abs_pi16(a);
78f4a2713aSLionel Sambuc }
79f4a2713aSLionel Sambuc 
test15(__m64 a)80f4a2713aSLionel Sambuc __m64 test15(__m64 a) {
81f4a2713aSLionel Sambuc   // CHECK: pabsd
82f4a2713aSLionel Sambuc   return _mm_abs_pi32(a);
83f4a2713aSLionel Sambuc }
84f4a2713aSLionel Sambuc 
test16(__m64 a,__m64 b)85f4a2713aSLionel Sambuc __m64 test16(__m64 a, __m64 b) {
86f4a2713aSLionel Sambuc   // CHECK: palignr
87f4a2713aSLionel Sambuc   return _mm_alignr_pi8(a, b, 2);
88f4a2713aSLionel Sambuc }
89f4a2713aSLionel Sambuc 
test17(__m128d a)90f4a2713aSLionel Sambuc __m64 test17(__m128d a) {
91f4a2713aSLionel Sambuc   // CHECK: cvtpd2pi
92f4a2713aSLionel Sambuc   return _mm_cvtpd_pi32(a);
93f4a2713aSLionel Sambuc }
94f4a2713aSLionel Sambuc 
test18(__m128d a)95f4a2713aSLionel Sambuc __m64 test18(__m128d a) {
96f4a2713aSLionel Sambuc   // CHECK: cvttpd2pi
97f4a2713aSLionel Sambuc   return _mm_cvttpd_pi32(a);
98f4a2713aSLionel Sambuc }
99f4a2713aSLionel Sambuc 
test19(__m64 a)100f4a2713aSLionel Sambuc __m128d test19(__m64 a) {
101f4a2713aSLionel Sambuc   // CHECK: cvtpi2pd
102f4a2713aSLionel Sambuc   return _mm_cvtpi32_pd(a);
103f4a2713aSLionel Sambuc }
104f4a2713aSLionel Sambuc 
test20(__m64 a,__m64 b)105f4a2713aSLionel Sambuc __m64 test20(__m64 a, __m64 b) {
106f4a2713aSLionel Sambuc   // CHECK: pmuludq
107f4a2713aSLionel Sambuc   return _mm_mul_su32(a, b);
108f4a2713aSLionel Sambuc }
109f4a2713aSLionel Sambuc 
test21(__m64 a)110f4a2713aSLionel Sambuc __m64 test21(__m64 a) {
111f4a2713aSLionel Sambuc   // CHECK: pshufw
112f4a2713aSLionel Sambuc   return _mm_shuffle_pi16(a, 3);
113f4a2713aSLionel Sambuc }
114f4a2713aSLionel Sambuc 
test22(__m64 a,__m64 b)115f4a2713aSLionel Sambuc __m64 test22(__m64 a, __m64 b) {
116f4a2713aSLionel Sambuc   // CHECK: pmulhuw
117f4a2713aSLionel Sambuc   return _mm_mulhi_pu16(a, b);
118f4a2713aSLionel Sambuc }
119f4a2713aSLionel Sambuc 
test23(__m64 d,__m64 n,char * p)120f4a2713aSLionel Sambuc void test23(__m64 d, __m64 n, char *p) {
121f4a2713aSLionel Sambuc   // CHECK: maskmovq
122f4a2713aSLionel Sambuc   _mm_maskmove_si64(d, n, p);
123f4a2713aSLionel Sambuc }
124f4a2713aSLionel Sambuc 
test24(__m64 a)125f4a2713aSLionel Sambuc int test24(__m64 a) {
126f4a2713aSLionel Sambuc   // CHECK: pmovmskb
127f4a2713aSLionel Sambuc   return _mm_movemask_pi8(a);
128f4a2713aSLionel Sambuc }
129f4a2713aSLionel Sambuc 
test25(__m64 * p,__m64 a)130f4a2713aSLionel Sambuc void test25(__m64 *p, __m64 a) {
131f4a2713aSLionel Sambuc   // CHECK: movntq
132f4a2713aSLionel Sambuc   _mm_stream_pi(p, a);
133f4a2713aSLionel Sambuc }
134f4a2713aSLionel Sambuc 
test26(__m64 a,__m64 b)135f4a2713aSLionel Sambuc __m64 test26(__m64 a, __m64 b) {
136f4a2713aSLionel Sambuc   // CHECK: pavgb
137f4a2713aSLionel Sambuc   return _mm_avg_pu8(a, b);
138f4a2713aSLionel Sambuc }
139f4a2713aSLionel Sambuc 
test27(__m64 a,__m64 b)140f4a2713aSLionel Sambuc __m64 test27(__m64 a, __m64 b) {
141f4a2713aSLionel Sambuc   // CHECK: pavgw
142f4a2713aSLionel Sambuc   return _mm_avg_pu16(a, b);
143f4a2713aSLionel Sambuc }
144f4a2713aSLionel Sambuc 
test28(__m64 a,__m64 b)145f4a2713aSLionel Sambuc __m64 test28(__m64 a, __m64 b) {
146f4a2713aSLionel Sambuc   // CHECK: pmaxub
147f4a2713aSLionel Sambuc   return _mm_max_pu8(a, b);
148f4a2713aSLionel Sambuc }
149f4a2713aSLionel Sambuc 
test29(__m64 a,__m64 b)150f4a2713aSLionel Sambuc __m64 test29(__m64 a, __m64 b) {
151f4a2713aSLionel Sambuc   // CHECK: pmaxsw
152f4a2713aSLionel Sambuc   return _mm_max_pi16(a, b);
153f4a2713aSLionel Sambuc }
154f4a2713aSLionel Sambuc 
test30(__m64 a,__m64 b)155f4a2713aSLionel Sambuc __m64 test30(__m64 a, __m64 b) {
156f4a2713aSLionel Sambuc   // CHECK: pminub
157f4a2713aSLionel Sambuc   return _mm_min_pu8(a, b);
158f4a2713aSLionel Sambuc }
159f4a2713aSLionel Sambuc 
test31(__m64 a,__m64 b)160f4a2713aSLionel Sambuc __m64 test31(__m64 a, __m64 b) {
161f4a2713aSLionel Sambuc   // CHECK: pminsw
162f4a2713aSLionel Sambuc   return _mm_min_pi16(a, b);
163f4a2713aSLionel Sambuc }
164f4a2713aSLionel Sambuc 
test32(__m64 a,__m64 b)165f4a2713aSLionel Sambuc __m64 test32(__m64 a, __m64 b) {
166f4a2713aSLionel Sambuc   // CHECK: psadbw
167f4a2713aSLionel Sambuc   return _mm_sad_pu8(a, b);
168f4a2713aSLionel Sambuc }
169f4a2713aSLionel Sambuc 
test33(__m64 a,__m64 b)170f4a2713aSLionel Sambuc __m64 test33(__m64 a, __m64 b) {
171f4a2713aSLionel Sambuc   // CHECK: paddb
172f4a2713aSLionel Sambuc   return _mm_add_pi8(a, b);
173f4a2713aSLionel Sambuc }
174f4a2713aSLionel Sambuc 
test34(__m64 a,__m64 b)175f4a2713aSLionel Sambuc __m64 test34(__m64 a, __m64 b) {
176f4a2713aSLionel Sambuc   // CHECK: paddw
177f4a2713aSLionel Sambuc   return _mm_add_pi16(a, b);
178f4a2713aSLionel Sambuc }
179f4a2713aSLionel Sambuc 
test35(__m64 a,__m64 b)180f4a2713aSLionel Sambuc __m64 test35(__m64 a, __m64 b) {
181f4a2713aSLionel Sambuc   // CHECK: paddd
182f4a2713aSLionel Sambuc   return _mm_add_pi32(a, b);
183f4a2713aSLionel Sambuc }
184f4a2713aSLionel Sambuc 
test36(__m64 a,__m64 b)185f4a2713aSLionel Sambuc __m64 test36(__m64 a, __m64 b) {
186f4a2713aSLionel Sambuc   // CHECK: paddq
187f4a2713aSLionel Sambuc   return __builtin_ia32_paddq(a, b);
188f4a2713aSLionel Sambuc }
189f4a2713aSLionel Sambuc 
test37(__m64 a,__m64 b)190f4a2713aSLionel Sambuc __m64 test37(__m64 a, __m64 b) {
191f4a2713aSLionel Sambuc   // CHECK: paddsb
192f4a2713aSLionel Sambuc   return _mm_adds_pi8(a, b);
193f4a2713aSLionel Sambuc }
194f4a2713aSLionel Sambuc 
test38(__m64 a,__m64 b)195f4a2713aSLionel Sambuc __m64 test38(__m64 a, __m64 b) {
196f4a2713aSLionel Sambuc   // CHECK: paddsw
197f4a2713aSLionel Sambuc   return _mm_adds_pi16(a, b);
198f4a2713aSLionel Sambuc }
199f4a2713aSLionel Sambuc 
test39(__m64 a,__m64 b)200f4a2713aSLionel Sambuc __m64 test39(__m64 a, __m64 b) {
201f4a2713aSLionel Sambuc   // CHECK: paddusb
202f4a2713aSLionel Sambuc   return _mm_adds_pu8(a, b);
203f4a2713aSLionel Sambuc }
204f4a2713aSLionel Sambuc 
test40(__m64 a,__m64 b)205f4a2713aSLionel Sambuc __m64 test40(__m64 a, __m64 b) {
206f4a2713aSLionel Sambuc   // CHECK: paddusw
207f4a2713aSLionel Sambuc   return _mm_adds_pu16(a, b);
208f4a2713aSLionel Sambuc }
209f4a2713aSLionel Sambuc 
test41(__m64 a,__m64 b)210f4a2713aSLionel Sambuc __m64 test41(__m64 a, __m64 b) {
211f4a2713aSLionel Sambuc   // CHECK: psubb
212f4a2713aSLionel Sambuc   return _mm_sub_pi8(a, b);
213f4a2713aSLionel Sambuc }
214f4a2713aSLionel Sambuc 
test42(__m64 a,__m64 b)215f4a2713aSLionel Sambuc __m64 test42(__m64 a, __m64 b) {
216f4a2713aSLionel Sambuc   // CHECK: psubw
217f4a2713aSLionel Sambuc   return _mm_sub_pi16(a, b);
218f4a2713aSLionel Sambuc }
219f4a2713aSLionel Sambuc 
test43(__m64 a,__m64 b)220f4a2713aSLionel Sambuc __m64 test43(__m64 a, __m64 b) {
221f4a2713aSLionel Sambuc   // CHECK: psubd
222f4a2713aSLionel Sambuc   return _mm_sub_pi32(a, b);
223f4a2713aSLionel Sambuc }
224f4a2713aSLionel Sambuc 
test44(__m64 a,__m64 b)225f4a2713aSLionel Sambuc __m64 test44(__m64 a, __m64 b) {
226f4a2713aSLionel Sambuc   // CHECK: psubq
227f4a2713aSLionel Sambuc   return __builtin_ia32_psubq(a, b);
228f4a2713aSLionel Sambuc }
229f4a2713aSLionel Sambuc 
test45(__m64 a,__m64 b)230f4a2713aSLionel Sambuc __m64 test45(__m64 a, __m64 b) {
231f4a2713aSLionel Sambuc   // CHECK: psubsb
232f4a2713aSLionel Sambuc   return _mm_subs_pi8(a, b);
233f4a2713aSLionel Sambuc }
234f4a2713aSLionel Sambuc 
test46(__m64 a,__m64 b)235f4a2713aSLionel Sambuc __m64 test46(__m64 a, __m64 b) {
236f4a2713aSLionel Sambuc   // CHECK: psubsw
237f4a2713aSLionel Sambuc   return _mm_subs_pi16(a, b);
238f4a2713aSLionel Sambuc }
239f4a2713aSLionel Sambuc 
test47(__m64 a,__m64 b)240f4a2713aSLionel Sambuc __m64 test47(__m64 a, __m64 b) {
241f4a2713aSLionel Sambuc   // CHECK: psubusb
242f4a2713aSLionel Sambuc   return _mm_subs_pu8(a, b);
243f4a2713aSLionel Sambuc }
244f4a2713aSLionel Sambuc 
test48(__m64 a,__m64 b)245f4a2713aSLionel Sambuc __m64 test48(__m64 a, __m64 b) {
246f4a2713aSLionel Sambuc   // CHECK: psubusw
247f4a2713aSLionel Sambuc   return _mm_subs_pu16(a, b);
248f4a2713aSLionel Sambuc }
249f4a2713aSLionel Sambuc 
test49(__m64 a,__m64 b)250f4a2713aSLionel Sambuc __m64 test49(__m64 a, __m64 b) {
251f4a2713aSLionel Sambuc   // CHECK: pmaddwd
252f4a2713aSLionel Sambuc   return _mm_madd_pi16(a, b);
253f4a2713aSLionel Sambuc }
254f4a2713aSLionel Sambuc 
test50(__m64 a,__m64 b)255f4a2713aSLionel Sambuc __m64 test50(__m64 a, __m64 b) {
256f4a2713aSLionel Sambuc   // CHECK: pmulhw
257f4a2713aSLionel Sambuc   return _mm_mulhi_pi16(a, b);
258f4a2713aSLionel Sambuc }
259f4a2713aSLionel Sambuc 
test51(__m64 a,__m64 b)260f4a2713aSLionel Sambuc __m64 test51(__m64 a, __m64 b) {
261f4a2713aSLionel Sambuc   // CHECK: pmullw
262f4a2713aSLionel Sambuc   return _mm_mullo_pi16(a, b);
263f4a2713aSLionel Sambuc }
264f4a2713aSLionel Sambuc 
test52(__m64 a,__m64 b)265f4a2713aSLionel Sambuc __m64 test52(__m64 a, __m64 b) {
266f4a2713aSLionel Sambuc   // CHECK: pmullw
267f4a2713aSLionel Sambuc   return _mm_mullo_pi16(a, b);
268f4a2713aSLionel Sambuc }
269f4a2713aSLionel Sambuc 
test53(__m64 a,__m64 b)270f4a2713aSLionel Sambuc __m64 test53(__m64 a, __m64 b) {
271f4a2713aSLionel Sambuc   // CHECK: pand
272f4a2713aSLionel Sambuc   return _mm_and_si64(a, b);
273f4a2713aSLionel Sambuc }
274f4a2713aSLionel Sambuc 
test54(__m64 a,__m64 b)275f4a2713aSLionel Sambuc __m64 test54(__m64 a, __m64 b) {
276f4a2713aSLionel Sambuc   // CHECK: pandn
277f4a2713aSLionel Sambuc   return _mm_andnot_si64(a, b);
278f4a2713aSLionel Sambuc }
279f4a2713aSLionel Sambuc 
test55(__m64 a,__m64 b)280f4a2713aSLionel Sambuc __m64 test55(__m64 a, __m64 b) {
281f4a2713aSLionel Sambuc   // CHECK: por
282f4a2713aSLionel Sambuc   return _mm_or_si64(a, b);
283f4a2713aSLionel Sambuc }
284f4a2713aSLionel Sambuc 
test56(__m64 a,__m64 b)285f4a2713aSLionel Sambuc __m64 test56(__m64 a, __m64 b) {
286f4a2713aSLionel Sambuc   // CHECK: pxor
287f4a2713aSLionel Sambuc   return _mm_xor_si64(a, b);
288f4a2713aSLionel Sambuc }
289f4a2713aSLionel Sambuc 
test57(__m64 a,__m64 b)290f4a2713aSLionel Sambuc __m64 test57(__m64 a, __m64 b) {
291f4a2713aSLionel Sambuc   // CHECK: pavgb
292f4a2713aSLionel Sambuc   return _mm_avg_pu8(a, b);
293f4a2713aSLionel Sambuc }
294f4a2713aSLionel Sambuc 
test58(__m64 a,__m64 b)295f4a2713aSLionel Sambuc __m64 test58(__m64 a, __m64 b) {
296f4a2713aSLionel Sambuc   // CHECK: pavgw
297f4a2713aSLionel Sambuc   return _mm_avg_pu16(a, b);
298f4a2713aSLionel Sambuc }
299f4a2713aSLionel Sambuc 
test59(__m64 a,__m64 b)300f4a2713aSLionel Sambuc __m64 test59(__m64 a, __m64 b) {
301f4a2713aSLionel Sambuc   // CHECK: psllw
302f4a2713aSLionel Sambuc   return _mm_sll_pi16(a, b);
303f4a2713aSLionel Sambuc }
304f4a2713aSLionel Sambuc 
test60(__m64 a,__m64 b)305f4a2713aSLionel Sambuc __m64 test60(__m64 a, __m64 b) {
306f4a2713aSLionel Sambuc   // CHECK: pslld
307f4a2713aSLionel Sambuc   return _mm_sll_pi32(a, b);
308f4a2713aSLionel Sambuc }
309f4a2713aSLionel Sambuc 
test61(__m64 a,__m64 b)310f4a2713aSLionel Sambuc __m64 test61(__m64 a, __m64 b) {
311f4a2713aSLionel Sambuc   // CHECK: psllq
312f4a2713aSLionel Sambuc   return _mm_sll_si64(a, b);
313f4a2713aSLionel Sambuc }
314f4a2713aSLionel Sambuc 
test62(__m64 a,__m64 b)315f4a2713aSLionel Sambuc __m64 test62(__m64 a, __m64 b) {
316f4a2713aSLionel Sambuc   // CHECK: psrlw
317f4a2713aSLionel Sambuc   return _mm_srl_pi16(a, b);
318f4a2713aSLionel Sambuc }
319f4a2713aSLionel Sambuc 
test63(__m64 a,__m64 b)320f4a2713aSLionel Sambuc __m64 test63(__m64 a, __m64 b) {
321f4a2713aSLionel Sambuc   // CHECK: psrld
322f4a2713aSLionel Sambuc   return _mm_srl_pi32(a, b);
323f4a2713aSLionel Sambuc }
324f4a2713aSLionel Sambuc 
test64(__m64 a,__m64 b)325f4a2713aSLionel Sambuc __m64 test64(__m64 a, __m64 b) {
326f4a2713aSLionel Sambuc   // CHECK: psrlq
327f4a2713aSLionel Sambuc   return _mm_srl_si64(a, b);
328f4a2713aSLionel Sambuc }
329f4a2713aSLionel Sambuc 
test65(__m64 a,__m64 b)330f4a2713aSLionel Sambuc __m64 test65(__m64 a, __m64 b) {
331f4a2713aSLionel Sambuc   // CHECK: psraw
332f4a2713aSLionel Sambuc   return _mm_sra_pi16(a, b);
333f4a2713aSLionel Sambuc }
334f4a2713aSLionel Sambuc 
test66(__m64 a,__m64 b)335f4a2713aSLionel Sambuc __m64 test66(__m64 a, __m64 b) {
336f4a2713aSLionel Sambuc   // CHECK: psrad
337f4a2713aSLionel Sambuc   return _mm_sra_pi32(a, b);
338f4a2713aSLionel Sambuc }
339f4a2713aSLionel Sambuc 
test67(__m64 a)340f4a2713aSLionel Sambuc __m64 test67(__m64 a) {
341f4a2713aSLionel Sambuc   // CHECK: psllw
342f4a2713aSLionel Sambuc   return _mm_slli_pi16(a, 3);
343f4a2713aSLionel Sambuc }
344f4a2713aSLionel Sambuc 
test68(__m64 a)345f4a2713aSLionel Sambuc __m64 test68(__m64 a) {
346f4a2713aSLionel Sambuc   // CHECK: pslld
347f4a2713aSLionel Sambuc   return _mm_slli_pi32(a, 3);
348f4a2713aSLionel Sambuc }
349f4a2713aSLionel Sambuc 
test69(__m64 a)350f4a2713aSLionel Sambuc __m64 test69(__m64 a) {
351f4a2713aSLionel Sambuc   // CHECK: psllq
352f4a2713aSLionel Sambuc   return _mm_slli_si64(a, 3);
353f4a2713aSLionel Sambuc }
354f4a2713aSLionel Sambuc 
test70(__m64 a)355f4a2713aSLionel Sambuc __m64 test70(__m64 a) {
356f4a2713aSLionel Sambuc   // CHECK: psrlw
357f4a2713aSLionel Sambuc   return _mm_srli_pi16(a, 3);
358f4a2713aSLionel Sambuc }
359f4a2713aSLionel Sambuc 
test71(__m64 a)360f4a2713aSLionel Sambuc __m64 test71(__m64 a) {
361f4a2713aSLionel Sambuc   // CHECK: psrld
362f4a2713aSLionel Sambuc   return _mm_srli_pi32(a, 3);
363f4a2713aSLionel Sambuc }
364f4a2713aSLionel Sambuc 
test72(__m64 a)365f4a2713aSLionel Sambuc __m64 test72(__m64 a) {
366f4a2713aSLionel Sambuc   // CHECK: psrlq
367f4a2713aSLionel Sambuc   return _mm_srli_si64(a, 3);
368f4a2713aSLionel Sambuc }
369f4a2713aSLionel Sambuc 
test73(__m64 a)370f4a2713aSLionel Sambuc __m64 test73(__m64 a) {
371f4a2713aSLionel Sambuc   // CHECK: psraw
372f4a2713aSLionel Sambuc   return _mm_srai_pi16(a, 3);
373f4a2713aSLionel Sambuc }
374f4a2713aSLionel Sambuc 
test74(__m64 a)375f4a2713aSLionel Sambuc __m64 test74(__m64 a) {
376f4a2713aSLionel Sambuc   // CHECK: psrad
377f4a2713aSLionel Sambuc   return _mm_srai_pi32(a, 3);
378f4a2713aSLionel Sambuc }
379f4a2713aSLionel Sambuc 
test75(__m64 a,__m64 b)380f4a2713aSLionel Sambuc __m64 test75(__m64 a, __m64 b) {
381f4a2713aSLionel Sambuc   // CHECK: packsswb
382f4a2713aSLionel Sambuc   return _mm_packs_pi16(a, b);
383f4a2713aSLionel Sambuc }
384f4a2713aSLionel Sambuc 
test76(__m64 a,__m64 b)385f4a2713aSLionel Sambuc __m64 test76(__m64 a, __m64 b) {
386f4a2713aSLionel Sambuc   // CHECK: packssdw
387f4a2713aSLionel Sambuc   return _mm_packs_pi32(a, b);
388f4a2713aSLionel Sambuc }
389f4a2713aSLionel Sambuc 
test77(__m64 a,__m64 b)390f4a2713aSLionel Sambuc __m64 test77(__m64 a, __m64 b) {
391f4a2713aSLionel Sambuc   // CHECK: packuswb
392f4a2713aSLionel Sambuc   return _mm_packs_pu16(a, b);
393f4a2713aSLionel Sambuc }
394f4a2713aSLionel Sambuc 
test78(__m64 a,__m64 b)395f4a2713aSLionel Sambuc __m64 test78(__m64 a, __m64 b) {
396f4a2713aSLionel Sambuc   // CHECK: punpckhbw
397f4a2713aSLionel Sambuc   return _mm_unpackhi_pi8(a, b);
398f4a2713aSLionel Sambuc }
399f4a2713aSLionel Sambuc 
test79(__m64 a,__m64 b)400f4a2713aSLionel Sambuc __m64 test79(__m64 a, __m64 b) {
401f4a2713aSLionel Sambuc   // CHECK: punpckhwd
402f4a2713aSLionel Sambuc   return _mm_unpackhi_pi16(a, b);
403f4a2713aSLionel Sambuc }
404f4a2713aSLionel Sambuc 
test80(__m64 a,__m64 b)405f4a2713aSLionel Sambuc __m64 test80(__m64 a, __m64 b) {
406f4a2713aSLionel Sambuc   // CHECK: punpckhdq
407f4a2713aSLionel Sambuc   return _mm_unpackhi_pi32(a, b);
408f4a2713aSLionel Sambuc }
409f4a2713aSLionel Sambuc 
test81(__m64 a,__m64 b)410f4a2713aSLionel Sambuc __m64 test81(__m64 a, __m64 b) {
411f4a2713aSLionel Sambuc   // CHECK: punpcklbw
412f4a2713aSLionel Sambuc   return _mm_unpacklo_pi8(a, b);
413f4a2713aSLionel Sambuc }
414f4a2713aSLionel Sambuc 
test82(__m64 a,__m64 b)415f4a2713aSLionel Sambuc __m64 test82(__m64 a, __m64 b) {
416f4a2713aSLionel Sambuc   // CHECK: punpcklwd
417f4a2713aSLionel Sambuc   return _mm_unpacklo_pi16(a, b);
418f4a2713aSLionel Sambuc }
419f4a2713aSLionel Sambuc 
test83(__m64 a,__m64 b)420f4a2713aSLionel Sambuc __m64 test83(__m64 a, __m64 b) {
421f4a2713aSLionel Sambuc   // CHECK: punpckldq
422f4a2713aSLionel Sambuc   return _mm_unpacklo_pi32(a, b);
423f4a2713aSLionel Sambuc }
424f4a2713aSLionel Sambuc 
test84(__m64 a,__m64 b)425f4a2713aSLionel Sambuc __m64 test84(__m64 a, __m64 b) {
426f4a2713aSLionel Sambuc   // CHECK: pcmpeqb
427f4a2713aSLionel Sambuc   return _mm_cmpeq_pi8(a, b);
428f4a2713aSLionel Sambuc }
429f4a2713aSLionel Sambuc 
test85(__m64 a,__m64 b)430f4a2713aSLionel Sambuc __m64 test85(__m64 a, __m64 b) {
431f4a2713aSLionel Sambuc   // CHECK: pcmpeqw
432f4a2713aSLionel Sambuc   return _mm_cmpeq_pi16(a, b);
433f4a2713aSLionel Sambuc }
434f4a2713aSLionel Sambuc 
test86(__m64 a,__m64 b)435f4a2713aSLionel Sambuc __m64 test86(__m64 a, __m64 b) {
436f4a2713aSLionel Sambuc   // CHECK: pcmpeqd
437f4a2713aSLionel Sambuc   return _mm_cmpeq_pi32(a, b);
438f4a2713aSLionel Sambuc }
439f4a2713aSLionel Sambuc 
test87(__m64 a,__m64 b)440f4a2713aSLionel Sambuc __m64 test87(__m64 a, __m64 b) {
441f4a2713aSLionel Sambuc   // CHECK: pcmpgtb
442f4a2713aSLionel Sambuc   return _mm_cmpgt_pi8(a, b);
443f4a2713aSLionel Sambuc }
444f4a2713aSLionel Sambuc 
test88(__m64 a,__m64 b)445f4a2713aSLionel Sambuc __m64 test88(__m64 a, __m64 b) {
446f4a2713aSLionel Sambuc   // CHECK: pcmpgtw
447f4a2713aSLionel Sambuc   return _mm_cmpgt_pi16(a, b);
448f4a2713aSLionel Sambuc }
449f4a2713aSLionel Sambuc 
test89(__m64 a,__m64 b)450f4a2713aSLionel Sambuc __m64 test89(__m64 a, __m64 b) {
451f4a2713aSLionel Sambuc   // CHECK: pcmpgtd
452f4a2713aSLionel Sambuc   return _mm_cmpgt_pi32(a, b);
453f4a2713aSLionel Sambuc }
454