1 // RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.1 -emit-llvm -o - -Wall -Werror | FileCheck %s
2 // RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.1 -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s
3 
4 
5 #include <immintrin.h>
6 
7 // NOTE: This should match the tests in llvm/test/CodeGen/X86/sse41-intrinsics-fast-isel.ll
8 
test_mm_blend_epi16(__m128i V1,__m128i V2)9 __m128i test_mm_blend_epi16(__m128i V1, __m128i V2) {
10   // CHECK-LABEL: test_mm_blend_epi16
11   // CHECK: shufflevector <8 x i16> %{{.*}}, <8 x i16> %{{.*}}, <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 7>
12   return _mm_blend_epi16(V1, V2, 42);
13 }
14 
test_mm_blend_pd(__m128d V1,__m128d V2)15 __m128d test_mm_blend_pd(__m128d V1, __m128d V2) {
16   // CHECK-LABEL: test_mm_blend_pd
17   // CHECK: shufflevector <2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x i32> <i32 0, i32 3>
18   return _mm_blend_pd(V1, V2, 2);
19 }
20 
test_mm_blend_ps(__m128 V1,__m128 V2)21 __m128 test_mm_blend_ps(__m128 V1, __m128 V2) {
22   // CHECK-LABEL: test_mm_blend_ps
23   // CHECK: shufflevector <4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x i32> <i32 0, i32 5, i32 6, i32 3>
24   return _mm_blend_ps(V1, V2, 6);
25 }
26 
test_mm_blendv_epi8(__m128i V1,__m128i V2,__m128i V3)27 __m128i test_mm_blendv_epi8(__m128i V1, __m128i V2, __m128i V3) {
28   // CHECK-LABEL: test_mm_blendv_epi8
29   // CHECK: call <16 x i8> @llvm.x86.sse41.pblendvb(<16 x i8> %{{.*}}, <16 x i8> %{{.*}}, <16 x i8> %{{.*}})
30   return _mm_blendv_epi8(V1, V2, V3);
31 }
32 
test_mm_blendv_pd(__m128d V1,__m128d V2,__m128d V3)33 __m128d test_mm_blendv_pd(__m128d V1, __m128d V2, __m128d V3) {
34   // CHECK-LABEL: test_mm_blendv_pd
35   // CHECK: call <2 x double> @llvm.x86.sse41.blendvpd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
36   return _mm_blendv_pd(V1, V2, V3);
37 }
38 
test_mm_blendv_ps(__m128 V1,__m128 V2,__m128 V3)39 __m128 test_mm_blendv_ps(__m128 V1, __m128 V2, __m128 V3) {
40   // CHECK-LABEL: test_mm_blendv_ps
41   // CHECK: call <4 x float> @llvm.x86.sse41.blendvps(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
42   return _mm_blendv_ps(V1, V2, V3);
43 }
44 
test_mm_ceil_pd(__m128d x)45 __m128d test_mm_ceil_pd(__m128d x) {
46   // CHECK-LABEL: test_mm_ceil_pd
47   // CHECK: call <2 x double> @llvm.x86.sse41.round.pd(<2 x double> %{{.*}}, i32 2)
48   return _mm_ceil_pd(x);
49 }
50 
test_mm_ceil_ps(__m128 x)51 __m128 test_mm_ceil_ps(__m128 x) {
52   // CHECK-LABEL: test_mm_ceil_ps
53   // CHECK: call <4 x float> @llvm.x86.sse41.round.ps(<4 x float> %{{.*}}, i32 2)
54   return _mm_ceil_ps(x);
55 }
56 
test_mm_ceil_sd(__m128d x,__m128d y)57 __m128d test_mm_ceil_sd(__m128d x, __m128d y) {
58   // CHECK-LABEL: test_mm_ceil_sd
59   // CHECK: call <2 x double> @llvm.x86.sse41.round.sd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i32 2)
60   return _mm_ceil_sd(x, y);
61 }
62 
test_mm_ceil_ss(__m128 x,__m128 y)63 __m128 test_mm_ceil_ss(__m128 x, __m128 y) {
64   // CHECK-LABEL: test_mm_ceil_ss
65   // CHECK: call <4 x float> @llvm.x86.sse41.round.ss(<4 x float> %{{.*}}, <4 x float> %{{.*}}, i32 2)
66   return _mm_ceil_ss(x, y);
67 }
68 
test_mm_cmpeq_epi64(__m128i A,__m128i B)69 __m128i test_mm_cmpeq_epi64(__m128i A, __m128i B) {
70   // CHECK-LABEL: test_mm_cmpeq_epi64
71   // CHECK: icmp eq <2 x i64>
72   // CHECK: sext <2 x i1> %{{.*}} to <2 x i64>
73   return _mm_cmpeq_epi64(A, B);
74 }
75 
test_mm_cvtepi8_epi16(__m128i a)76 __m128i test_mm_cvtepi8_epi16(__m128i a) {
77   // CHECK-LABEL: test_mm_cvtepi8_epi16
78   // CHECK: shufflevector <16 x i8> {{.*}}, <16 x i8> {{.*}}, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
79   // CHECK: sext <8 x i8> {{.*}} to <8 x i16>
80   return _mm_cvtepi8_epi16(a);
81 }
82 
test_mm_cvtepi8_epi32(__m128i a)83 __m128i test_mm_cvtepi8_epi32(__m128i a) {
84   // CHECK-LABEL: test_mm_cvtepi8_epi32
85   // CHECK: shufflevector <16 x i8> {{.*}}, <16 x i8> {{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
86   // CHECK: sext <4 x i8> {{.*}} to <4 x i32>
87   return _mm_cvtepi8_epi32(a);
88 }
89 
test_mm_cvtepi8_epi64(__m128i a)90 __m128i test_mm_cvtepi8_epi64(__m128i a) {
91   // CHECK-LABEL: test_mm_cvtepi8_epi64
92   // CHECK: shufflevector <16 x i8> {{.*}}, <16 x i8> {{.*}}, <2 x i32> <i32 0, i32 1>
93   // CHECK: sext <2 x i8> {{.*}} to <2 x i64>
94   return _mm_cvtepi8_epi64(a);
95 }
96 
test_mm_cvtepi16_epi32(__m128i a)97 __m128i test_mm_cvtepi16_epi32(__m128i a) {
98   // CHECK-LABEL: test_mm_cvtepi16_epi32
99   // CHECK: shufflevector <8 x i16> {{.*}}, <8 x i16> {{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
100   // CHECK: sext <4 x i16> {{.*}} to <4 x i32>
101   return _mm_cvtepi16_epi32(a);
102 }
103 
test_mm_cvtepi16_epi64(__m128i a)104 __m128i test_mm_cvtepi16_epi64(__m128i a) {
105   // CHECK-LABEL: test_mm_cvtepi16_epi64
106   // CHECK: shufflevector <8 x i16> {{.*}}, <8 x i16> {{.*}}, <2 x i32> <i32 0, i32 1>
107   // CHECK: sext <2 x i16> {{.*}} to <2 x i64>
108   return _mm_cvtepi16_epi64(a);
109 }
110 
test_mm_cvtepi32_epi64(__m128i a)111 __m128i test_mm_cvtepi32_epi64(__m128i a) {
112   // CHECK-LABEL: test_mm_cvtepi32_epi64
113   // CHECK: shufflevector <4 x i32> {{.*}}, <4 x i32> {{.*}}, <2 x i32> <i32 0, i32 1>
114   // CHECK: sext <2 x i32> {{.*}} to <2 x i64>
115   return _mm_cvtepi32_epi64(a);
116 }
117 
test_mm_cvtepu8_epi16(__m128i a)118 __m128i test_mm_cvtepu8_epi16(__m128i a) {
119   // CHECK-LABEL: test_mm_cvtepu8_epi16
120   // CHECK: shufflevector <16 x i8> {{.*}}, <16 x i8> {{.*}}, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
121   // CHECK: zext <8 x i8> {{.*}} to <8 x i16>
122   return _mm_cvtepu8_epi16(a);
123 }
124 
test_mm_cvtepu8_epi32(__m128i a)125 __m128i test_mm_cvtepu8_epi32(__m128i a) {
126   // CHECK-LABEL: test_mm_cvtepu8_epi32
127   // CHECK: shufflevector <16 x i8> {{.*}}, <16 x i8> {{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
128   // CHECK: zext <4 x i8> {{.*}} to <4 x i32>
129   return _mm_cvtepu8_epi32(a);
130 }
131 
test_mm_cvtepu8_epi64(__m128i a)132 __m128i test_mm_cvtepu8_epi64(__m128i a) {
133   // CHECK-LABEL: test_mm_cvtepu8_epi64
134   // CHECK: shufflevector <16 x i8> {{.*}}, <16 x i8> {{.*}}, <2 x i32> <i32 0, i32 1>
135   // CHECK: zext <2 x i8> {{.*}} to <2 x i64>
136   return _mm_cvtepu8_epi64(a);
137 }
138 
test_mm_cvtepu16_epi32(__m128i a)139 __m128i test_mm_cvtepu16_epi32(__m128i a) {
140   // CHECK-LABEL: test_mm_cvtepu16_epi32
141   // CHECK: shufflevector <8 x i16> {{.*}}, <8 x i16> {{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
142   // CHECK: zext <4 x i16> {{.*}} to <4 x i32>
143   return _mm_cvtepu16_epi32(a);
144 }
145 
test_mm_cvtepu16_epi64(__m128i a)146 __m128i test_mm_cvtepu16_epi64(__m128i a) {
147   // CHECK-LABEL: test_mm_cvtepu16_epi64
148   // CHECK: shufflevector <8 x i16> {{.*}}, <8 x i16> {{.*}}, <2 x i32> <i32 0, i32 1>
149   // CHECK: zext <2 x i16> {{.*}} to <2 x i64>
150   return _mm_cvtepu16_epi64(a);
151 }
152 
test_mm_cvtepu32_epi64(__m128i a)153 __m128i test_mm_cvtepu32_epi64(__m128i a) {
154   // CHECK-LABEL: test_mm_cvtepu32_epi64
155   // CHECK: shufflevector <4 x i32> {{.*}}, <4 x i32> {{.*}}, <2 x i32> <i32 0, i32 1>
156   // CHECK: zext <2 x i32> {{.*}} to <2 x i64>
157   return _mm_cvtepu32_epi64(a);
158 }
159 
test_mm_dp_pd(__m128d x,__m128d y)160 __m128d test_mm_dp_pd(__m128d x, __m128d y) {
161   // CHECK-LABEL: test_mm_dp_pd
162   // CHECK: call <2 x double> @llvm.x86.sse41.dppd(<2 x double> {{.*}}, <2 x double> {{.*}}, i8 7)
163   return _mm_dp_pd(x, y, 7);
164 }
165 
test_mm_dp_ps(__m128 x,__m128 y)166 __m128 test_mm_dp_ps(__m128 x, __m128 y) {
167   // CHECK-LABEL: test_mm_dp_ps
168   // CHECK: call <4 x float> @llvm.x86.sse41.dpps(<4 x float> {{.*}}, <4 x float> {{.*}}, i8 7)
169   return _mm_dp_ps(x, y, 7);
170 }
171 
test_mm_extract_epi8(__m128i x)172 int test_mm_extract_epi8(__m128i x) {
173   // CHECK-LABEL: test_mm_extract_epi8
174   // CHECK: extractelement <16 x i8> %{{.*}}, {{i32|i64}} 1
175   // CHECK: zext i8 %{{.*}} to i32
176   return _mm_extract_epi8(x, 1);
177 }
178 
test_mm_extract_epi32(__m128i x)179 int test_mm_extract_epi32(__m128i x) {
180   // CHECK-LABEL: test_mm_extract_epi32
181   // CHECK: extractelement <4 x i32> %{{.*}}, {{i32|i64}} 1
182   return _mm_extract_epi32(x, 1);
183 }
184 
185 #ifdef __x86_64__
test_mm_extract_epi64(__m128i x)186 long long test_mm_extract_epi64(__m128i x) {
187   // CHECK-LABEL: test_mm_extract_epi64
188   // CHECK: extractelement <2 x i64> %{{.*}}, {{i32|i64}} 1
189   return _mm_extract_epi64(x, 1);
190 }
191 #endif
192 
test_mm_extract_ps(__m128 x)193 int test_mm_extract_ps(__m128 x) {
194   // CHECK-LABEL: test_mm_extract_ps
195   // CHECK: extractelement <4 x float> %{{.*}}, {{i32|i64}} 1
196   return _mm_extract_ps(x, 1);
197 }
198 
test_mm_floor_pd(__m128d x)199 __m128d test_mm_floor_pd(__m128d x) {
200   // CHECK-LABEL: test_mm_floor_pd
201   // CHECK: call <2 x double> @llvm.x86.sse41.round.pd(<2 x double> %{{.*}}, i32 1)
202   return _mm_floor_pd(x);
203 }
204 
test_mm_floor_ps(__m128 x)205 __m128 test_mm_floor_ps(__m128 x) {
206   // CHECK-LABEL: test_mm_floor_ps
207   // CHECK: call <4 x float> @llvm.x86.sse41.round.ps(<4 x float> %{{.*}}, i32 1)
208   return _mm_floor_ps(x);
209 }
210 
test_mm_floor_sd(__m128d x,__m128d y)211 __m128d test_mm_floor_sd(__m128d x, __m128d y) {
212   // CHECK-LABEL: test_mm_floor_sd
213   // CHECK: call <2 x double> @llvm.x86.sse41.round.sd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i32 1)
214   return _mm_floor_sd(x, y);
215 }
216 
test_mm_floor_ss(__m128 x,__m128 y)217 __m128 test_mm_floor_ss(__m128 x, __m128 y) {
218   // CHECK-LABEL: test_mm_floor_ss
219   // CHECK: call <4 x float> @llvm.x86.sse41.round.ss(<4 x float> %{{.*}}, <4 x float> %{{.*}}, i32 1)
220   return _mm_floor_ss(x, y);
221 }
222 
test_mm_insert_epi8(__m128i x,char b)223 __m128i test_mm_insert_epi8(__m128i x, char b) {
224   // CHECK-LABEL: test_mm_insert_epi8
225   // CHECK: insertelement <16 x i8> %{{.*}}, i8 %{{.*}}, {{i32|i64}} 1
226   return _mm_insert_epi8(x, b, 1);
227 }
228 
test_mm_insert_epi32(__m128i x,int b)229 __m128i test_mm_insert_epi32(__m128i x, int b) {
230   // CHECK-LABEL: test_mm_insert_epi32
231   // CHECK: insertelement <4 x i32> %{{.*}}, i32 %{{.*}}, {{i32|i64}} 1
232   return _mm_insert_epi32(x, b, 1);
233 }
234 
235 #ifdef __x86_64__
test_mm_insert_epi64(__m128i x,long long b)236 __m128i test_mm_insert_epi64(__m128i x, long long b) {
237   // CHECK-LABEL: test_mm_insert_epi64
238   // CHECK: insertelement <2 x i64> %{{.*}}, i64 %{{.*}}, {{i32|i64}} 1
239   return _mm_insert_epi64(x, b, 1);
240 }
241 #endif
242 
test_mm_insert_ps(__m128 x,__m128 y)243 __m128 test_mm_insert_ps(__m128 x, __m128 y) {
244   // CHECK-LABEL: test_mm_insert_ps
245   // CHECK: call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %{{.*}}, <4 x float> %{{.*}}, i8 4)
246   return _mm_insert_ps(x, y, 4);
247 }
248 
test_mm_max_epi8(__m128i x,__m128i y)249 __m128i test_mm_max_epi8(__m128i x, __m128i y) {
250   // CHECK-LABEL: test_mm_max_epi8
251   // CHECK: call <16 x i8> @llvm.smax.v16i8(<16 x i8> %{{.*}}, <16 x i8> %{{.*}})
252   return _mm_max_epi8(x, y);
253 }
254 
test_mm_max_epi32(__m128i x,__m128i y)255 __m128i test_mm_max_epi32(__m128i x, __m128i y) {
256   // CHECK-LABEL: test_mm_max_epi32
257   // CHECK: call <4 x i32> @llvm.smax.v4i32(<4 x i32> %{{.*}}, <4 x i32> %{{.*}})
258   return _mm_max_epi32(x, y);
259 }
260 
test_mm_max_epu16(__m128i x,__m128i y)261 __m128i test_mm_max_epu16(__m128i x, __m128i y) {
262   // CHECK-LABEL: test_mm_max_epu16
263   // CHECK: call <8 x i16> @llvm.umax.v8i16(<8 x i16> %{{.*}}, <8 x i16> %{{.*}})
264   return _mm_max_epu16(x, y);
265 }
266 
test_mm_max_epu32(__m128i x,__m128i y)267 __m128i test_mm_max_epu32(__m128i x, __m128i y) {
268   // CHECK-LABEL: test_mm_max_epu32
269   // CHECK: call <4 x i32> @llvm.umax.v4i32(<4 x i32> %{{.*}}, <4 x i32> %{{.*}})
270   return _mm_max_epu32(x, y);
271 }
272 
test_mm_min_epi8(__m128i x,__m128i y)273 __m128i test_mm_min_epi8(__m128i x, __m128i y) {
274   // CHECK-LABEL: test_mm_min_epi8
275   // CHECK: call <16 x i8> @llvm.smin.v16i8(<16 x i8> %{{.*}}, <16 x i8> %{{.*}})
276   return _mm_min_epi8(x, y);
277 }
278 
test_mm_min_epi32(__m128i x,__m128i y)279 __m128i test_mm_min_epi32(__m128i x, __m128i y) {
280   // CHECK-LABEL: test_mm_min_epi32
281   // CHECK: call <4 x i32> @llvm.smin.v4i32(<4 x i32> %{{.*}}, <4 x i32> %{{.*}})
282   return _mm_min_epi32(x, y);
283 }
284 
test_mm_min_epu16(__m128i x,__m128i y)285 __m128i test_mm_min_epu16(__m128i x, __m128i y) {
286   // CHECK-LABEL: test_mm_min_epu16
287   // CHECK: call <8 x i16> @llvm.umin.v8i16(<8 x i16> %{{.*}}, <8 x i16> %{{.*}})
288   return _mm_min_epu16(x, y);
289 }
290 
test_mm_min_epu32(__m128i x,__m128i y)291 __m128i test_mm_min_epu32(__m128i x, __m128i y) {
292   // CHECK-LABEL: test_mm_min_epu32
293   // CHECK: call <4 x i32> @llvm.umin.v4i32(<4 x i32> %{{.*}}, <4 x i32> %{{.*}})
294   return _mm_min_epu32(x, y);
295 }
296 
test_mm_minpos_epu16(__m128i x)297 __m128i test_mm_minpos_epu16(__m128i x) {
298   // CHECK-LABEL: test_mm_minpos_epu16
299   // CHECK: call <8 x i16> @llvm.x86.sse41.phminposuw(<8 x i16> %{{.*}})
300   return _mm_minpos_epu16(x);
301 }
302 
test_mm_mpsadbw_epu8(__m128i x,__m128i y)303 __m128i test_mm_mpsadbw_epu8(__m128i x, __m128i y) {
304   // CHECK-LABEL: test_mm_mpsadbw_epu8
305   // CHECK: call <8 x i16> @llvm.x86.sse41.mpsadbw(<16 x i8> %{{.*}}, <16 x i8> %{{.*}}, i8 1)
306   return _mm_mpsadbw_epu8(x, y, 1);
307 }
308 
test_mm_mul_epi32(__m128i x,__m128i y)309 __m128i test_mm_mul_epi32(__m128i x, __m128i y) {
310   // CHECK-LABEL: test_mm_mul_epi32
311   // CHECK: shl <2 x i64> %{{.*}}, <i64 32, i64 32>
312   // CHECK: ashr <2 x i64> %{{.*}}, <i64 32, i64 32>
313   // CHECK: shl <2 x i64> %{{.*}}, <i64 32, i64 32>
314   // CHECK: ashr <2 x i64> %{{.*}}, <i64 32, i64 32>
315   // CHECK: mul <2 x i64> %{{.*}}, %{{.*}}
316   return _mm_mul_epi32(x, y);
317 }
318 
test_mm_mullo_epi32(__m128i x,__m128i y)319 __m128i test_mm_mullo_epi32(__m128i x, __m128i y) {
320   // CHECK-LABEL: test_mm_mullo_epi32
321   // CHECK: mul <4 x i32>
322   return _mm_mullo_epi32(x, y);
323 }
324 
test_mm_packus_epi32(__m128i x,__m128i y)325 __m128i test_mm_packus_epi32(__m128i x, __m128i y) {
326   // CHECK-LABEL: test_mm_packus_epi32
327   // CHECK: call <8 x i16> @llvm.x86.sse41.packusdw(<4 x i32> %{{.*}}, <4 x i32> %{{.*}})
328   return _mm_packus_epi32(x, y);
329 }
330 
test_mm_round_pd(__m128d x)331 __m128d test_mm_round_pd(__m128d x) {
332   // CHECK-LABEL: test_mm_round_pd
333   // CHECK: call <2 x double> @llvm.x86.sse41.round.pd(<2 x double> %{{.*}}, i32 4)
334   return _mm_round_pd(x, 4);
335 }
336 
test_mm_round_ps(__m128 x)337 __m128 test_mm_round_ps(__m128 x) {
338   // CHECK-LABEL: test_mm_round_ps
339   // CHECK: call <4 x float> @llvm.x86.sse41.round.ps(<4 x float> %{{.*}}, i32 4)
340   return _mm_round_ps(x, 4);
341 }
342 
test_mm_round_sd(__m128d x,__m128d y)343 __m128d test_mm_round_sd(__m128d x, __m128d y) {
344   // CHECK-LABEL: test_mm_round_sd
345   // CHECK: call <2 x double> @llvm.x86.sse41.round.sd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i32 4)
346   return _mm_round_sd(x, y, 4);
347 }
348 
test_mm_round_ss(__m128 x,__m128 y)349 __m128 test_mm_round_ss(__m128 x, __m128 y) {
350   // CHECK-LABEL: test_mm_round_ss
351   // CHECK: call <4 x float> @llvm.x86.sse41.round.ss(<4 x float> %{{.*}}, <4 x float> %{{.*}}, i32 4)
352   return _mm_round_ss(x, y, 4);
353 }
354 
test_mm_stream_load_si128(__m128i const * a)355 __m128i test_mm_stream_load_si128(__m128i const *a) {
356   // CHECK-LABEL: test_mm_stream_load_si128
357   // CHECK: load <2 x i64>, <2 x i64>* %{{.*}}, align 16, !nontemporal
358   return _mm_stream_load_si128(a);
359 }
360 
test_mm_test_all_ones(__m128i x)361 int test_mm_test_all_ones(__m128i x) {
362   // CHECK-LABEL: test_mm_test_all_ones
363   // CHECK: call i32 @llvm.x86.sse41.ptestc(<2 x i64> %{{.*}}, <2 x i64> %{{.*}})
364   return _mm_test_all_ones(x);
365 }
366 
test_mm_test_all_zeros(__m128i x,__m128i y)367 int test_mm_test_all_zeros(__m128i x, __m128i y) {
368   // CHECK-LABEL: test_mm_test_all_zeros
369   // CHECK: call i32 @llvm.x86.sse41.ptestz(<2 x i64> %{{.*}}, <2 x i64> %{{.*}})
370   return _mm_test_all_zeros(x, y);
371 }
372 
test_mm_test_mix_ones_zeros(__m128i x,__m128i y)373 int test_mm_test_mix_ones_zeros(__m128i x, __m128i y) {
374   // CHECK-LABEL: test_mm_test_mix_ones_zeros
375   // CHECK: call i32 @llvm.x86.sse41.ptestnzc(<2 x i64> %{{.*}}, <2 x i64> %{{.*}})
376   return _mm_test_mix_ones_zeros(x, y);
377 }
378 
test_mm_testc_si128(__m128i x,__m128i y)379 int test_mm_testc_si128(__m128i x, __m128i y) {
380   // CHECK-LABEL: test_mm_testc_si128
381   // CHECK: call i32 @llvm.x86.sse41.ptestc(<2 x i64> %{{.*}}, <2 x i64> %{{.*}})
382   return _mm_testc_si128(x, y);
383 }
384 
test_mm_testnzc_si128(__m128i x,__m128i y)385 int test_mm_testnzc_si128(__m128i x, __m128i y) {
386   // CHECK-LABEL: test_mm_testnzc_si128
387   // CHECK: call i32 @llvm.x86.sse41.ptestnzc(<2 x i64> %{{.*}}, <2 x i64> %{{.*}})
388   return _mm_testnzc_si128(x, y);
389 }
390 
test_mm_testz_si128(__m128i x,__m128i y)391 int test_mm_testz_si128(__m128i x, __m128i y) {
392   // CHECK-LABEL: test_mm_testz_si128
393   // CHECK: call i32 @llvm.x86.sse41.ptestz(<2 x i64> %{{.*}}, <2 x i64> %{{.*}})
394   return _mm_testz_si128(x, y);
395 }
396