1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -fast-isel -mtriple=i686-unknown-unknown -mattr=+avx,+fma4,+xop | FileCheck %s
3 ; RUN: llc < %s -fast-isel -mtriple=x86_64-unknown-unknown -mattr=+avx,+fma4,+xop | FileCheck %s
5 ; NOTE: This should use IR equivalent to what is generated by clang/test/CodeGen/xop-builtins.c
7 define <2 x i64> @test_mm_maccs_epi16(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> %a2) nounwind {
8 ; CHECK-LABEL: test_mm_maccs_epi16:
10 ; CHECK-NEXT: vpmacssww %xmm2, %xmm1, %xmm0, %xmm0
11 ; CHECK-NEXT: ret{{[l|q]}}
12 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
13 %arg1 = bitcast <2 x i64> %a1 to <8 x i16>
14 %arg2 = bitcast <2 x i64> %a2 to <8 x i16>
15 %res = call <8 x i16> @llvm.x86.xop.vpmacssww(<8 x i16> %arg0, <8 x i16> %arg1, <8 x i16> %arg2)
16 %bc = bitcast <8 x i16> %res to <2 x i64>
19 declare <8 x i16> @llvm.x86.xop.vpmacssww(<8 x i16>, <8 x i16>, <8 x i16>) nounwind readnone
21 define <2 x i64> @test_mm_macc_epi16(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> %a2) nounwind {
22 ; CHECK-LABEL: test_mm_macc_epi16:
24 ; CHECK-NEXT: vpmacsww %xmm2, %xmm1, %xmm0, %xmm0
25 ; CHECK-NEXT: ret{{[l|q]}}
26 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
27 %arg1 = bitcast <2 x i64> %a1 to <8 x i16>
28 %arg2 = bitcast <2 x i64> %a2 to <8 x i16>
29 %res = call <8 x i16> @llvm.x86.xop.vpmacsww(<8 x i16> %arg0, <8 x i16> %arg1, <8 x i16> %arg2)
30 %bc = bitcast <8 x i16> %res to <2 x i64>
33 declare <8 x i16> @llvm.x86.xop.vpmacsww(<8 x i16>, <8 x i16>, <8 x i16>) nounwind readnone
35 define <2 x i64> @test_mm_maccsd_epi16(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> %a2) nounwind {
36 ; CHECK-LABEL: test_mm_maccsd_epi16:
38 ; CHECK-NEXT: vpmacsswd %xmm2, %xmm1, %xmm0, %xmm0
39 ; CHECK-NEXT: ret{{[l|q]}}
40 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
41 %arg1 = bitcast <2 x i64> %a1 to <8 x i16>
42 %arg2 = bitcast <2 x i64> %a2 to <4 x i32>
43 %res = call <4 x i32> @llvm.x86.xop.vpmacsswd(<8 x i16> %arg0, <8 x i16> %arg1, <4 x i32> %arg2)
44 %bc = bitcast <4 x i32> %res to <2 x i64>
47 declare <4 x i32> @llvm.x86.xop.vpmacsswd(<8 x i16>, <8 x i16>, <4 x i32>) nounwind readnone
49 define <2 x i64> @test_mm_maccd_epi16(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> %a2) nounwind {
50 ; CHECK-LABEL: test_mm_maccd_epi16:
52 ; CHECK-NEXT: vpmacswd %xmm2, %xmm1, %xmm0, %xmm0
53 ; CHECK-NEXT: ret{{[l|q]}}
54 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
55 %arg1 = bitcast <2 x i64> %a1 to <8 x i16>
56 %arg2 = bitcast <2 x i64> %a2 to <4 x i32>
57 %res = call <4 x i32> @llvm.x86.xop.vpmacswd(<8 x i16> %arg0, <8 x i16> %arg1, <4 x i32> %arg2)
58 %bc = bitcast <4 x i32> %res to <2 x i64>
61 declare <4 x i32> @llvm.x86.xop.vpmacswd(<8 x i16>, <8 x i16>, <4 x i32>) nounwind readnone
63 define <2 x i64> @test_mm_maccs_epi32(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> %a2) nounwind {
64 ; CHECK-LABEL: test_mm_maccs_epi32:
66 ; CHECK-NEXT: vpmacssdd %xmm2, %xmm1, %xmm0, %xmm0
67 ; CHECK-NEXT: ret{{[l|q]}}
68 %arg0 = bitcast <2 x i64> %a0 to <4 x i32>
69 %arg1 = bitcast <2 x i64> %a1 to <4 x i32>
70 %arg2 = bitcast <2 x i64> %a2 to <4 x i32>
71 %res = call <4 x i32> @llvm.x86.xop.vpmacssdd(<4 x i32> %arg0, <4 x i32> %arg1, <4 x i32> %arg2)
72 %bc = bitcast <4 x i32> %res to <2 x i64>
75 declare <4 x i32> @llvm.x86.xop.vpmacssdd(<4 x i32>, <4 x i32>, <4 x i32>) nounwind readnone
77 define <2 x i64> @test_mm_macc_epi32(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> %a2) nounwind {
78 ; CHECK-LABEL: test_mm_macc_epi32:
80 ; CHECK-NEXT: vpmacsdd %xmm2, %xmm1, %xmm0, %xmm0
81 ; CHECK-NEXT: ret{{[l|q]}}
82 %arg0 = bitcast <2 x i64> %a0 to <4 x i32>
83 %arg1 = bitcast <2 x i64> %a1 to <4 x i32>
84 %arg2 = bitcast <2 x i64> %a2 to <4 x i32>
85 %res = call <4 x i32> @llvm.x86.xop.vpmacsdd(<4 x i32> %arg0, <4 x i32> %arg1, <4 x i32> %arg2)
86 %bc = bitcast <4 x i32> %res to <2 x i64>
89 declare <4 x i32> @llvm.x86.xop.vpmacsdd(<4 x i32>, <4 x i32>, <4 x i32>) nounwind readnone
91 define <2 x i64> @test_mm_maccslo_epi32(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> %a2) nounwind {
92 ; CHECK-LABEL: test_mm_maccslo_epi32:
94 ; CHECK-NEXT: vpmacssdql %xmm2, %xmm1, %xmm0, %xmm0
95 ; CHECK-NEXT: ret{{[l|q]}}
96 %arg0 = bitcast <2 x i64> %a0 to <4 x i32>
97 %arg1 = bitcast <2 x i64> %a1 to <4 x i32>
98 %res = call <2 x i64> @llvm.x86.xop.vpmacssdql(<4 x i32> %arg0, <4 x i32> %arg1, <2 x i64> %a2)
101 declare <2 x i64> @llvm.x86.xop.vpmacssdql(<4 x i32>, <4 x i32>, <2 x i64>) nounwind readnone
103 define <2 x i64> @test_mm_macclo_epi32(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> %a2) nounwind {
104 ; CHECK-LABEL: test_mm_macclo_epi32:
106 ; CHECK-NEXT: vpmacsdql %xmm2, %xmm1, %xmm0, %xmm0
107 ; CHECK-NEXT: ret{{[l|q]}}
108 %arg0 = bitcast <2 x i64> %a0 to <4 x i32>
109 %arg1 = bitcast <2 x i64> %a1 to <4 x i32>
110 %res = call <2 x i64> @llvm.x86.xop.vpmacsdql(<4 x i32> %arg0, <4 x i32> %arg1, <2 x i64> %a2)
113 declare <2 x i64> @llvm.x86.xop.vpmacsdql(<4 x i32>, <4 x i32>, <2 x i64>) nounwind readnone
115 define <2 x i64> @test_mm_maccshi_epi32(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> %a2) nounwind {
116 ; CHECK-LABEL: test_mm_maccshi_epi32:
118 ; CHECK-NEXT: vpmacssdqh %xmm2, %xmm1, %xmm0, %xmm0
119 ; CHECK-NEXT: ret{{[l|q]}}
120 %arg0 = bitcast <2 x i64> %a0 to <4 x i32>
121 %arg1 = bitcast <2 x i64> %a1 to <4 x i32>
122 %res = call <2 x i64> @llvm.x86.xop.vpmacssdqh(<4 x i32> %arg0, <4 x i32> %arg1, <2 x i64> %a2)
125 declare <2 x i64> @llvm.x86.xop.vpmacssdqh(<4 x i32>, <4 x i32>, <2 x i64>) nounwind readnone
127 define <2 x i64> @test_mm_macchi_epi32(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> %a2) nounwind {
128 ; CHECK-LABEL: test_mm_macchi_epi32:
130 ; CHECK-NEXT: vpmacsdqh %xmm2, %xmm1, %xmm0, %xmm0
131 ; CHECK-NEXT: ret{{[l|q]}}
132 %arg0 = bitcast <2 x i64> %a0 to <4 x i32>
133 %arg1 = bitcast <2 x i64> %a1 to <4 x i32>
134 %res = call <2 x i64> @llvm.x86.xop.vpmacsdqh(<4 x i32> %arg0, <4 x i32> %arg1, <2 x i64> %a2)
137 declare <2 x i64> @llvm.x86.xop.vpmacsdqh(<4 x i32>, <4 x i32>, <2 x i64>) nounwind readnone
139 define <2 x i64> @test_mm_maddsd_epi16(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> %a2) nounwind {
140 ; CHECK-LABEL: test_mm_maddsd_epi16:
142 ; CHECK-NEXT: vpmadcsswd %xmm2, %xmm1, %xmm0, %xmm0
143 ; CHECK-NEXT: ret{{[l|q]}}
144 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
145 %arg1 = bitcast <2 x i64> %a1 to <8 x i16>
146 %arg2 = bitcast <2 x i64> %a2 to <4 x i32>
147 %res = call <4 x i32> @llvm.x86.xop.vpmadcsswd(<8 x i16> %arg0, <8 x i16> %arg1, <4 x i32> %arg2)
148 %bc = bitcast <4 x i32> %res to <2 x i64>
151 declare <4 x i32> @llvm.x86.xop.vpmadcsswd(<8 x i16>, <8 x i16>, <4 x i32>) nounwind readnone
153 define <2 x i64> @test_mm_maddd_epi16(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> %a2) nounwind {
154 ; CHECK-LABEL: test_mm_maddd_epi16:
156 ; CHECK-NEXT: vpmadcswd %xmm2, %xmm1, %xmm0, %xmm0
157 ; CHECK-NEXT: ret{{[l|q]}}
158 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
159 %arg1 = bitcast <2 x i64> %a1 to <8 x i16>
160 %arg2 = bitcast <2 x i64> %a2 to <4 x i32>
161 %res = call <4 x i32> @llvm.x86.xop.vpmadcswd(<8 x i16> %arg0, <8 x i16> %arg1, <4 x i32> %arg2)
162 %bc = bitcast <4 x i32> %res to <2 x i64>
165 declare <4 x i32> @llvm.x86.xop.vpmadcswd(<8 x i16>, <8 x i16>, <4 x i32>) nounwind readnone
167 define <2 x i64> @test_mm_haddw_epi8(<2 x i64> %a0) {
168 ; CHECK-LABEL: test_mm_haddw_epi8:
170 ; CHECK-NEXT: vphaddbw %xmm0, %xmm0
171 ; CHECK-NEXT: ret{{[l|q]}}
172 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
173 %res = call <8 x i16> @llvm.x86.xop.vphaddbw(<16 x i8> %arg0)
174 %bc = bitcast <8 x i16> %res to <2 x i64>
177 declare <8 x i16> @llvm.x86.xop.vphaddbw(<16 x i8>) nounwind readnone
179 define <2 x i64> @test_mm_haddd_epi8(<2 x i64> %a0) {
180 ; CHECK-LABEL: test_mm_haddd_epi8:
182 ; CHECK-NEXT: vphaddbd %xmm0, %xmm0
183 ; CHECK-NEXT: ret{{[l|q]}}
184 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
185 %res = call <4 x i32> @llvm.x86.xop.vphaddbd(<16 x i8> %arg0)
186 %bc = bitcast <4 x i32> %res to <2 x i64>
189 declare <4 x i32> @llvm.x86.xop.vphaddbd(<16 x i8>) nounwind readnone
191 define <2 x i64> @test_mm_haddq_epi8(<2 x i64> %a0) {
192 ; CHECK-LABEL: test_mm_haddq_epi8:
194 ; CHECK-NEXT: vphaddbq %xmm0, %xmm0
195 ; CHECK-NEXT: ret{{[l|q]}}
196 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
197 %res = call <2 x i64> @llvm.x86.xop.vphaddbq(<16 x i8> %arg0)
200 declare <2 x i64> @llvm.x86.xop.vphaddbq(<16 x i8>) nounwind readnone
202 define <2 x i64> @test_mm_haddd_epi16(<2 x i64> %a0) {
203 ; CHECK-LABEL: test_mm_haddd_epi16:
205 ; CHECK-NEXT: vphaddwd %xmm0, %xmm0
206 ; CHECK-NEXT: ret{{[l|q]}}
207 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
208 %res = call <4 x i32> @llvm.x86.xop.vphaddwd(<8 x i16> %arg0)
209 %bc = bitcast <4 x i32> %res to <2 x i64>
212 declare <4 x i32> @llvm.x86.xop.vphaddwd(<8 x i16>) nounwind readnone
214 define <2 x i64> @test_mm_haddq_epi16(<2 x i64> %a0) {
215 ; CHECK-LABEL: test_mm_haddq_epi16:
217 ; CHECK-NEXT: vphaddwq %xmm0, %xmm0
218 ; CHECK-NEXT: ret{{[l|q]}}
219 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
220 %res = call <2 x i64> @llvm.x86.xop.vphaddwq(<8 x i16> %arg0)
223 declare <2 x i64> @llvm.x86.xop.vphaddwq(<8 x i16>) nounwind readnone
225 define <2 x i64> @test_mm_haddq_epi32(<2 x i64> %a0) {
226 ; CHECK-LABEL: test_mm_haddq_epi32:
228 ; CHECK-NEXT: vphadddq %xmm0, %xmm0
229 ; CHECK-NEXT: ret{{[l|q]}}
230 %arg0 = bitcast <2 x i64> %a0 to <4 x i32>
231 %res = call <2 x i64> @llvm.x86.xop.vphadddq(<4 x i32> %arg0)
234 declare <2 x i64> @llvm.x86.xop.vphadddq(<4 x i32>) nounwind readnone
236 define <2 x i64> @test_mm_haddw_epu8(<2 x i64> %a0) {
237 ; CHECK-LABEL: test_mm_haddw_epu8:
239 ; CHECK-NEXT: vphaddubw %xmm0, %xmm0
240 ; CHECK-NEXT: ret{{[l|q]}}
241 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
242 %res = call <8 x i16> @llvm.x86.xop.vphaddubw(<16 x i8> %arg0)
243 %bc = bitcast <8 x i16> %res to <2 x i64>
246 declare <8 x i16> @llvm.x86.xop.vphaddubw(<16 x i8>) nounwind readnone
248 define <2 x i64> @test_mm_haddd_epu8(<2 x i64> %a0) {
249 ; CHECK-LABEL: test_mm_haddd_epu8:
251 ; CHECK-NEXT: vphaddubd %xmm0, %xmm0
252 ; CHECK-NEXT: ret{{[l|q]}}
253 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
254 %res = call <4 x i32> @llvm.x86.xop.vphaddubd(<16 x i8> %arg0)
255 %bc = bitcast <4 x i32> %res to <2 x i64>
258 declare <4 x i32> @llvm.x86.xop.vphaddubd(<16 x i8>) nounwind readnone
260 define <2 x i64> @test_mm_haddq_epu8(<2 x i64> %a0) {
261 ; CHECK-LABEL: test_mm_haddq_epu8:
263 ; CHECK-NEXT: vphaddubq %xmm0, %xmm0
264 ; CHECK-NEXT: ret{{[l|q]}}
265 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
266 %res = call <2 x i64> @llvm.x86.xop.vphaddubq(<16 x i8> %arg0)
269 declare <2 x i64> @llvm.x86.xop.vphaddubq(<16 x i8>) nounwind readnone
271 define <2 x i64> @test_mm_haddd_epu16(<2 x i64> %a0) {
272 ; CHECK-LABEL: test_mm_haddd_epu16:
274 ; CHECK-NEXT: vphadduwd %xmm0, %xmm0
275 ; CHECK-NEXT: ret{{[l|q]}}
276 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
277 %res = call <4 x i32> @llvm.x86.xop.vphadduwd(<8 x i16> %arg0)
278 %bc = bitcast <4 x i32> %res to <2 x i64>
281 declare <4 x i32> @llvm.x86.xop.vphadduwd(<8 x i16>) nounwind readnone
284 define <2 x i64> @test_mm_haddq_epu16(<2 x i64> %a0) {
285 ; CHECK-LABEL: test_mm_haddq_epu16:
287 ; CHECK-NEXT: vphadduwq %xmm0, %xmm0
288 ; CHECK-NEXT: ret{{[l|q]}}
289 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
290 %res = call <2 x i64> @llvm.x86.xop.vphadduwq(<8 x i16> %arg0)
293 declare <2 x i64> @llvm.x86.xop.vphadduwq(<8 x i16>) nounwind readnone
295 define <2 x i64> @test_mm_haddq_epu32(<2 x i64> %a0) {
296 ; CHECK-LABEL: test_mm_haddq_epu32:
298 ; CHECK-NEXT: vphaddudq %xmm0, %xmm0
299 ; CHECK-NEXT: ret{{[l|q]}}
300 %arg0 = bitcast <2 x i64> %a0 to <4 x i32>
301 %res = call <2 x i64> @llvm.x86.xop.vphaddudq(<4 x i32> %arg0)
304 declare <2 x i64> @llvm.x86.xop.vphaddudq(<4 x i32>) nounwind readnone
306 define <2 x i64> @test_mm_hsubw_epi8(<2 x i64> %a0) {
307 ; CHECK-LABEL: test_mm_hsubw_epi8:
309 ; CHECK-NEXT: vphsubbw %xmm0, %xmm0
310 ; CHECK-NEXT: ret{{[l|q]}}
311 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
312 %res = call <8 x i16> @llvm.x86.xop.vphsubbw(<16 x i8> %arg0)
313 %bc = bitcast <8 x i16> %res to <2 x i64>
316 declare <8 x i16> @llvm.x86.xop.vphsubbw(<16 x i8>) nounwind readnone
318 define <2 x i64> @test_mm_hsubd_epi16(<2 x i64> %a0) {
319 ; CHECK-LABEL: test_mm_hsubd_epi16:
321 ; CHECK-NEXT: vphsubwd %xmm0, %xmm0
322 ; CHECK-NEXT: ret{{[l|q]}}
323 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
324 %res = call <4 x i32> @llvm.x86.xop.vphsubwd(<8 x i16> %arg0)
325 %bc = bitcast <4 x i32> %res to <2 x i64>
328 declare <4 x i32> @llvm.x86.xop.vphsubwd(<8 x i16>) nounwind readnone
330 define <2 x i64> @test_mm_hsubq_epi32(<2 x i64> %a0) {
331 ; CHECK-LABEL: test_mm_hsubq_epi32:
333 ; CHECK-NEXT: vphsubdq %xmm0, %xmm0
334 ; CHECK-NEXT: ret{{[l|q]}}
335 %arg0 = bitcast <2 x i64> %a0 to <4 x i32>
336 %res = call <2 x i64> @llvm.x86.xop.vphsubdq(<4 x i32> %arg0)
339 declare <2 x i64> @llvm.x86.xop.vphsubdq(<4 x i32>) nounwind readnone
341 define <2 x i64> @test_mm_cmov_si128(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> %a2) {
342 ; CHECK-LABEL: test_mm_cmov_si128:
344 ; CHECK-NEXT: vpcmpeqd %xmm3, %xmm3, %xmm3
345 ; CHECK-NEXT: vpxor %xmm3, %xmm2, %xmm3
346 ; CHECK-NEXT: vpand %xmm2, %xmm0, %xmm0
347 ; CHECK-NEXT: vpand %xmm3, %xmm1, %xmm1
348 ; CHECK-NEXT: vpor %xmm1, %xmm0, %xmm0
349 ; CHECK-NEXT: ret{{[l|q]}}
350 %res = call <2 x i64> @llvm.x86.xop.vpcmov(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> %a2)
353 declare <2 x i64> @llvm.x86.xop.vpcmov(<2 x i64>, <2 x i64>, <2 x i64>) nounwind readnone
355 define <4 x i64> @test_mm256_cmov_si256(<4 x i64> %a0, <4 x i64> %a1, <4 x i64> %a2) {
356 ; CHECK-LABEL: test_mm256_cmov_si256:
358 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
359 ; CHECK-NEXT: vcmptrueps %ymm3, %ymm3, %ymm3
360 ; CHECK-NEXT: vxorps %ymm3, %ymm2, %ymm3
361 ; CHECK-NEXT: vandps %ymm2, %ymm0, %ymm0
362 ; CHECK-NEXT: vandps %ymm3, %ymm1, %ymm1
363 ; CHECK-NEXT: vorps %ymm1, %ymm0, %ymm0
364 ; CHECK-NEXT: ret{{[l|q]}}
365 %res = call <4 x i64> @llvm.x86.xop.vpcmov.256(<4 x i64> %a0, <4 x i64> %a1, <4 x i64> %a2)
368 declare <4 x i64> @llvm.x86.xop.vpcmov.256(<4 x i64>, <4 x i64>, <4 x i64>) nounwind readnone
370 define <2 x i64> @test_mm_perm_epi8(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> %a2) {
371 ; CHECK-LABEL: test_mm_perm_epi8:
373 ; CHECK-NEXT: vpperm %xmm2, %xmm1, %xmm0, %xmm0
374 ; CHECK-NEXT: ret{{[l|q]}}
375 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
376 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
377 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
378 %res = call <16 x i8> @llvm.x86.xop.vpperm(<16 x i8> %arg0, <16 x i8> %arg1, <16 x i8> %arg2)
379 %bc = bitcast <16 x i8> %res to <2 x i64>
382 declare <16 x i8> @llvm.x86.xop.vpperm(<16 x i8>, <16 x i8>, <16 x i8>) nounwind readnone
384 define <2 x i64> @test_mm_rot_epi8(<2 x i64> %a0, <2 x i64> %a1) {
385 ; CHECK-LABEL: test_mm_rot_epi8:
387 ; CHECK-NEXT: vprotb %xmm1, %xmm0, %xmm0
388 ; CHECK-NEXT: ret{{[l|q]}}
389 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
390 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
391 %res = call <16 x i8> @llvm.fshl.v16i8(<16 x i8> %arg0, <16 x i8> %arg0, <16 x i8> %arg1)
392 %bc = bitcast <16 x i8> %res to <2 x i64>
395 declare <16 x i8> @llvm.fshl.v16i8(<16 x i8>, <16 x i8>, <16 x i8>) nounwind readnone
397 define <2 x i64> @test_mm_rot_epi16(<2 x i64> %a0, <2 x i64> %a1) {
398 ; CHECK-LABEL: test_mm_rot_epi16:
400 ; CHECK-NEXT: vprotw %xmm1, %xmm0, %xmm0
401 ; CHECK-NEXT: ret{{[l|q]}}
402 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
403 %arg1 = bitcast <2 x i64> %a1 to <8 x i16>
404 %res = call <8 x i16> @llvm.fshl.v8i16(<8 x i16> %arg0, <8 x i16> %arg0, <8 x i16> %arg1)
405 %bc = bitcast <8 x i16> %res to <2 x i64>
408 declare <8 x i16> @llvm.fshl.v8i16(<8 x i16>, <8 x i16>, <8 x i16>) nounwind readnone
410 define <2 x i64> @test_mm_rot_epi32(<2 x i64> %a0, <2 x i64> %a1) {
411 ; CHECK-LABEL: test_mm_rot_epi32:
413 ; CHECK-NEXT: vprotd %xmm1, %xmm0, %xmm0
414 ; CHECK-NEXT: ret{{[l|q]}}
415 %arg0 = bitcast <2 x i64> %a0 to <4 x i32>
416 %arg1 = bitcast <2 x i64> %a1 to <4 x i32>
417 %res = call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %arg0, <4 x i32> %arg0, <4 x i32> %arg1)
418 %bc = bitcast <4 x i32> %res to <2 x i64>
421 declare <4 x i32> @llvm.fshl.v4i32(<4 x i32>, <4 x i32>, <4 x i32>) nounwind readnone
423 define <2 x i64> @test_mm_rot_epi64(<2 x i64> %a0, <2 x i64> %a1) {
424 ; CHECK-LABEL: test_mm_rot_epi64:
426 ; CHECK-NEXT: vprotq %xmm1, %xmm0, %xmm0
427 ; CHECK-NEXT: ret{{[l|q]}}
428 %res = call <2 x i64> @llvm.fshl.v2i64(<2 x i64> %a0, <2 x i64> %a0, <2 x i64> %a1)
431 declare <2 x i64> @llvm.fshl.v2i64(<2 x i64>, <2 x i64>, <2 x i64>) nounwind readnone
433 define <2 x i64> @test_mm_roti_epi8(<2 x i64> %a0) {
434 ; CHECK-LABEL: test_mm_roti_epi8:
436 ; CHECK-NEXT: vprotb $1, %xmm0, %xmm0
437 ; CHECK-NEXT: ret{{[l|q]}}
438 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
439 %res = call <16 x i8> @llvm.fshl.v16i8(<16 x i8> %arg0, <16 x i8> %arg0, <16 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>)
440 %bc = bitcast <16 x i8> %res to <2 x i64>
444 define <2 x i64> @test_mm_roti_epi16(<2 x i64> %a0) {
445 ; CHECK-LABEL: test_mm_roti_epi16:
447 ; CHECK-NEXT: vprotw $2, %xmm0, %xmm0
448 ; CHECK-NEXT: ret{{[l|q]}}
449 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
450 %res = call <8 x i16> @llvm.fshl.v8i16(<8 x i16> %arg0, <8 x i16> %arg0, <8 x i16> <i16 50, i16 50, i16 50, i16 50, i16 50, i16 50, i16 50, i16 50>)
451 %bc = bitcast <8 x i16> %res to <2 x i64>
455 define <2 x i64> @test_mm_roti_epi32(<2 x i64> %a0) {
456 ; CHECK-LABEL: test_mm_roti_epi32:
458 ; CHECK-NEXT: vprotd $2, %xmm0, %xmm0
459 ; CHECK-NEXT: ret{{[l|q]}}
460 %arg0 = bitcast <2 x i64> %a0 to <4 x i32>
461 %res = call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %arg0, <4 x i32> %arg0, <4 x i32> <i32 -30, i32 -30, i32 -30, i32 -30>)
462 %bc = bitcast <4 x i32> %res to <2 x i64>
466 define <2 x i64> @test_mm_roti_epi64(<2 x i64> %a0) {
467 ; CHECK-LABEL: test_mm_roti_epi64:
469 ; CHECK-NEXT: vprotq $36, %xmm0, %xmm0
470 ; CHECK-NEXT: ret{{[l|q]}}
471 %res = call <2 x i64> @llvm.fshl.v2i64(<2 x i64> %a0, <2 x i64> %a0, <2 x i64> <i64 100, i64 100>)
475 define <2 x i64> @test_mm_shl_epi8(<2 x i64> %a0, <2 x i64> %a1) {
476 ; CHECK-LABEL: test_mm_shl_epi8:
478 ; CHECK-NEXT: vpshlb %xmm1, %xmm0, %xmm0
479 ; CHECK-NEXT: ret{{[l|q]}}
480 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
481 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
482 %res = call <16 x i8> @llvm.x86.xop.vpshlb(<16 x i8> %arg0, <16 x i8> %arg1)
483 %bc = bitcast <16 x i8> %res to <2 x i64>
486 declare <16 x i8> @llvm.x86.xop.vpshlb(<16 x i8>, <16 x i8>) nounwind readnone
488 define <2 x i64> @test_mm_shl_epi16(<2 x i64> %a0, <2 x i64> %a1) {
489 ; CHECK-LABEL: test_mm_shl_epi16:
491 ; CHECK-NEXT: vpshlw %xmm1, %xmm0, %xmm0
492 ; CHECK-NEXT: ret{{[l|q]}}
493 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
494 %arg1 = bitcast <2 x i64> %a1 to <8 x i16>
495 %res = call <8 x i16> @llvm.x86.xop.vpshlw(<8 x i16> %arg0, <8 x i16> %arg1)
496 %bc = bitcast <8 x i16> %res to <2 x i64>
499 declare <8 x i16> @llvm.x86.xop.vpshlw(<8 x i16>, <8 x i16>) nounwind readnone
501 define <2 x i64> @test_mm_shl_epi32(<2 x i64> %a0, <2 x i64> %a1) {
502 ; CHECK-LABEL: test_mm_shl_epi32:
504 ; CHECK-NEXT: vpshld %xmm1, %xmm0, %xmm0
505 ; CHECK-NEXT: ret{{[l|q]}}
506 %arg0 = bitcast <2 x i64> %a0 to <4 x i32>
507 %arg1 = bitcast <2 x i64> %a1 to <4 x i32>
508 %res = call <4 x i32> @llvm.x86.xop.vpshld(<4 x i32> %arg0, <4 x i32> %arg1)
509 %bc = bitcast <4 x i32> %res to <2 x i64>
512 declare <4 x i32> @llvm.x86.xop.vpshld(<4 x i32>, <4 x i32>) nounwind readnone
514 define <2 x i64> @test_mm_shl_epi64(<2 x i64> %a0, <2 x i64> %a1) {
515 ; CHECK-LABEL: test_mm_shl_epi64:
517 ; CHECK-NEXT: vpshlq %xmm1, %xmm0, %xmm0
518 ; CHECK-NEXT: ret{{[l|q]}}
519 %res = call <2 x i64> @llvm.x86.xop.vpshlq(<2 x i64> %a0, <2 x i64> %a1)
522 declare <2 x i64> @llvm.x86.xop.vpshlq(<2 x i64>, <2 x i64>) nounwind readnone
524 define <2 x i64> @test_mm_sha_epi8(<2 x i64> %a0, <2 x i64> %a1) {
525 ; CHECK-LABEL: test_mm_sha_epi8:
527 ; CHECK-NEXT: vpshab %xmm1, %xmm0, %xmm0
528 ; CHECK-NEXT: ret{{[l|q]}}
529 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
530 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
531 %res = call <16 x i8> @llvm.x86.xop.vpshab(<16 x i8> %arg0, <16 x i8> %arg1)
532 %bc = bitcast <16 x i8> %res to <2 x i64>
535 declare <16 x i8> @llvm.x86.xop.vpshab(<16 x i8>, <16 x i8>) nounwind readnone
537 define <2 x i64> @test_mm_sha_epi16(<2 x i64> %a0, <2 x i64> %a1) {
538 ; CHECK-LABEL: test_mm_sha_epi16:
540 ; CHECK-NEXT: vpshaw %xmm1, %xmm0, %xmm0
541 ; CHECK-NEXT: ret{{[l|q]}}
542 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
543 %arg1 = bitcast <2 x i64> %a1 to <8 x i16>
544 %res = call <8 x i16> @llvm.x86.xop.vpshaw(<8 x i16> %arg0, <8 x i16> %arg1)
545 %bc = bitcast <8 x i16> %res to <2 x i64>
548 declare <8 x i16> @llvm.x86.xop.vpshaw(<8 x i16>, <8 x i16>) nounwind readnone
550 define <2 x i64> @test_mm_sha_epi32(<2 x i64> %a0, <2 x i64> %a1) {
551 ; CHECK-LABEL: test_mm_sha_epi32:
553 ; CHECK-NEXT: vpshad %xmm1, %xmm0, %xmm0
554 ; CHECK-NEXT: ret{{[l|q]}}
555 %arg0 = bitcast <2 x i64> %a0 to <4 x i32>
556 %arg1 = bitcast <2 x i64> %a1 to <4 x i32>
557 %res = call <4 x i32> @llvm.x86.xop.vpshad(<4 x i32> %arg0, <4 x i32> %arg1)
558 %bc = bitcast <4 x i32> %res to <2 x i64>
561 declare <4 x i32> @llvm.x86.xop.vpshad(<4 x i32>, <4 x i32>) nounwind readnone
563 define <2 x i64> @test_mm_sha_epi64(<2 x i64> %a0, <2 x i64> %a1) {
564 ; CHECK-LABEL: test_mm_sha_epi64:
566 ; CHECK-NEXT: vpshaq %xmm1, %xmm0, %xmm0
567 ; CHECK-NEXT: ret{{[l|q]}}
568 %res = call <2 x i64> @llvm.x86.xop.vpshaq(<2 x i64> %a0, <2 x i64> %a1)
571 declare <2 x i64> @llvm.x86.xop.vpshaq(<2 x i64>, <2 x i64>) nounwind readnone
573 define <2 x i64> @test_mm_com_epu8(<2 x i64> %a0, <2 x i64> %a1) {
574 ; CHECK-LABEL: test_mm_com_epu8:
576 ; CHECK-NEXT: vpcomltub %xmm1, %xmm0, %xmm0
577 ; CHECK-NEXT: ret{{[l|q]}}
578 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
579 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
580 %cmp = icmp ult <16 x i8> %arg0, %arg1
581 %res = sext <16 x i1> %cmp to <16 x i8>
582 %bc = bitcast <16 x i8> %res to <2 x i64>
586 define <2 x i64> @test_mm_com_epu16(<2 x i64> %a0, <2 x i64> %a1) {
587 ; CHECK-LABEL: test_mm_com_epu16:
589 ; CHECK-NEXT: vpcomltuw %xmm1, %xmm0, %xmm0
590 ; CHECK-NEXT: ret{{[l|q]}}
591 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
592 %arg1 = bitcast <2 x i64> %a1 to <8 x i16>
593 %cmp = icmp ult <8 x i16> %arg0, %arg1
594 %res = sext <8 x i1> %cmp to <8 x i16>
595 %bc = bitcast <8 x i16> %res to <2 x i64>
599 define <2 x i64> @test_mm_com_epu32(<2 x i64> %a0, <2 x i64> %a1) {
600 ; CHECK-LABEL: test_mm_com_epu32:
602 ; CHECK-NEXT: vpcomltud %xmm1, %xmm0, %xmm0
603 ; CHECK-NEXT: ret{{[l|q]}}
604 %arg0 = bitcast <2 x i64> %a0 to <4 x i32>
605 %arg1 = bitcast <2 x i64> %a1 to <4 x i32>
606 %cmp = icmp ult <4 x i32> %arg0, %arg1
607 %res = sext <4 x i1> %cmp to <4 x i32>
608 %bc = bitcast <4 x i32> %res to <2 x i64>
612 define <2 x i64> @test_mm_com_epu64(<2 x i64> %a0, <2 x i64> %a1) {
613 ; CHECK-LABEL: test_mm_com_epu64:
615 ; CHECK-NEXT: vpcomltuq %xmm1, %xmm0, %xmm0
616 ; CHECK-NEXT: ret{{[l|q]}}
617 %cmp = icmp ult <2 x i64> %a0, %a1
618 %res = sext <2 x i1> %cmp to <2 x i64>
622 define <2 x i64> @test_mm_com_epi8(<2 x i64> %a0, <2 x i64> %a1) {
623 ; CHECK-LABEL: test_mm_com_epi8:
625 ; CHECK-NEXT: vpcomltb %xmm1, %xmm0, %xmm0
626 ; CHECK-NEXT: ret{{[l|q]}}
627 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
628 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
629 %cmp = icmp slt <16 x i8> %arg0, %arg1
630 %res = sext <16 x i1> %cmp to <16 x i8>
631 %bc = bitcast <16 x i8> %res to <2 x i64>
635 define <2 x i64> @test_mm_com_epi16(<2 x i64> %a0, <2 x i64> %a1) {
636 ; CHECK-LABEL: test_mm_com_epi16:
638 ; CHECK-NEXT: vpcomltw %xmm1, %xmm0, %xmm0
639 ; CHECK-NEXT: ret{{[l|q]}}
640 %arg0 = bitcast <2 x i64> %a0 to <8 x i16>
641 %arg1 = bitcast <2 x i64> %a1 to <8 x i16>
642 %cmp = icmp slt <8 x i16> %arg0, %arg1
643 %res = sext <8 x i1> %cmp to <8 x i16>
644 %bc = bitcast <8 x i16> %res to <2 x i64>
648 define <2 x i64> @test_mm_com_epi32(<2 x i64> %a0, <2 x i64> %a1) {
649 ; CHECK-LABEL: test_mm_com_epi32:
651 ; CHECK-NEXT: vpcomltd %xmm1, %xmm0, %xmm0
652 ; CHECK-NEXT: ret{{[l|q]}}
653 %arg0 = bitcast <2 x i64> %a0 to <4 x i32>
654 %arg1 = bitcast <2 x i64> %a1 to <4 x i32>
655 %cmp = icmp slt <4 x i32> %arg0, %arg1
656 %res = sext <4 x i1> %cmp to <4 x i32>
657 %bc = bitcast <4 x i32> %res to <2 x i64>
661 define <2 x i64> @test_mm_com_epi64(<2 x i64> %a0, <2 x i64> %a1) {
662 ; CHECK-LABEL: test_mm_com_epi64:
664 ; CHECK-NEXT: vpcomltq %xmm1, %xmm0, %xmm0
665 ; CHECK-NEXT: ret{{[l|q]}}
666 %cmp = icmp slt <2 x i64> %a0, %a1
667 %res = sext <2 x i1> %cmp to <2 x i64>
671 define <2 x double> @test_mm_permute2_pd(<2 x double> %a0, <2 x double> %a1, <2 x i64> %a2) {
672 ; CHECK-LABEL: test_mm_permute2_pd:
674 ; CHECK-NEXT: vpermil2pd $0, %xmm2, %xmm1, %xmm0, %xmm0
675 ; CHECK-NEXT: ret{{[l|q]}}
676 %res = call <2 x double> @llvm.x86.xop.vpermil2pd(<2 x double> %a0, <2 x double> %a1, <2 x i64> %a2, i8 0)
677 ret <2 x double> %res
679 declare <2 x double> @llvm.x86.xop.vpermil2pd(<2 x double>, <2 x double>, <2 x i64>, i8) nounwind readnone
681 define <4 x double> @test_mm256_permute2_pd(<4 x double> %a0, <4 x double> %a1, <4 x i64> %a2) {
682 ; CHECK-LABEL: test_mm256_permute2_pd:
684 ; CHECK-NEXT: vpermil2pd $0, %ymm2, %ymm1, %ymm0, %ymm0
685 ; CHECK-NEXT: ret{{[l|q]}}
686 %res = call <4 x double> @llvm.x86.xop.vpermil2pd.256(<4 x double> %a0, <4 x double> %a1, <4 x i64> %a2, i8 0)
687 ret <4 x double> %res
689 declare <4 x double> @llvm.x86.xop.vpermil2pd.256(<4 x double>, <4 x double>, <4 x i64>, i8) nounwind readnone
691 define <4 x float> @test_mm_permute2_ps(<4 x float> %a0, <4 x float> %a1, <2 x i64> %a2) {
692 ; CHECK-LABEL: test_mm_permute2_ps:
694 ; CHECK-NEXT: vpermil2ps $0, %xmm2, %xmm1, %xmm0, %xmm0
695 ; CHECK-NEXT: ret{{[l|q]}}
696 %arg2 = bitcast <2 x i64> %a2 to <4 x i32>
697 %res = call <4 x float> @llvm.x86.xop.vpermil2ps(<4 x float> %a0, <4 x float> %a1, <4 x i32> %arg2, i8 0)
700 declare <4 x float> @llvm.x86.xop.vpermil2ps(<4 x float>, <4 x float>, <4 x i32>, i8) nounwind readnone
702 define <8 x float> @test_mm256_permute2_ps(<8 x float> %a0, <8 x float> %a1, <4 x i64> %a2) {
703 ; CHECK-LABEL: test_mm256_permute2_ps:
705 ; CHECK-NEXT: vpermil2ps $0, %ymm2, %ymm1, %ymm0, %ymm0
706 ; CHECK-NEXT: ret{{[l|q]}}
707 %arg2 = bitcast <4 x i64> %a2 to <8 x i32>
708 %res = call <8 x float> @llvm.x86.xop.vpermil2ps.256(<8 x float> %a0, <8 x float> %a1, <8 x i32> %arg2, i8 0)
711 declare <8 x float> @llvm.x86.xop.vpermil2ps.256(<8 x float>, <8 x float>, <8 x i32>, i8) nounwind readnone
713 define <4 x float> @test_mm_frcz_ss(<4 x float> %a0) {
714 ; CHECK-LABEL: test_mm_frcz_ss:
716 ; CHECK-NEXT: vfrczss %xmm0, %xmm0
717 ; CHECK-NEXT: ret{{[l|q]}}
718 %res = call <4 x float> @llvm.x86.xop.vfrcz.ss(<4 x float> %a0)
721 declare <4 x float> @llvm.x86.xop.vfrcz.ss(<4 x float>) nounwind readnone
723 define <2 x double> @test_mm_frcz_sd(<2 x double> %a0) {
724 ; CHECK-LABEL: test_mm_frcz_sd:
726 ; CHECK-NEXT: vfrczsd %xmm0, %xmm0
727 ; CHECK-NEXT: ret{{[l|q]}}
728 %res = call <2 x double> @llvm.x86.xop.vfrcz.sd(<2 x double> %a0)
729 ret <2 x double> %res
731 declare <2 x double> @llvm.x86.xop.vfrcz.sd(<2 x double>) nounwind readnone
733 define <4 x float> @test_mm_frcz_ps(<4 x float> %a0) {
734 ; CHECK-LABEL: test_mm_frcz_ps:
736 ; CHECK-NEXT: vfrczps %xmm0, %xmm0
737 ; CHECK-NEXT: ret{{[l|q]}}
738 %res = call <4 x float> @llvm.x86.xop.vfrcz.ps(<4 x float> %a0)
741 declare <4 x float> @llvm.x86.xop.vfrcz.ps(<4 x float>) nounwind readnone
743 define <2 x double> @test_mm_frcz_pd(<2 x double> %a0) {
744 ; CHECK-LABEL: test_mm_frcz_pd:
746 ; CHECK-NEXT: vfrczpd %xmm0, %xmm0
747 ; CHECK-NEXT: ret{{[l|q]}}
748 %res = call <2 x double> @llvm.x86.xop.vfrcz.pd(<2 x double> %a0)
749 ret <2 x double> %res
751 declare <2 x double> @llvm.x86.xop.vfrcz.pd(<2 x double>) nounwind readnone
753 define <8 x float> @test_mm256_frcz_ps(<8 x float> %a0) {
754 ; CHECK-LABEL: test_mm256_frcz_ps:
756 ; CHECK-NEXT: vfrczps %ymm0, %ymm0
757 ; CHECK-NEXT: ret{{[l|q]}}
758 %res = call <8 x float> @llvm.x86.xop.vfrcz.ps.256(<8 x float> %a0)
761 declare <8 x float> @llvm.x86.xop.vfrcz.ps.256(<8 x float>) nounwind readnone
763 define <4 x double> @test_mm256_frcz_pd(<4 x double> %a0) {
764 ; CHECK-LABEL: test_mm256_frcz_pd:
766 ; CHECK-NEXT: vfrczpd %ymm0, %ymm0
767 ; CHECK-NEXT: ret{{[l|q]}}
768 %res = call <4 x double> @llvm.x86.xop.vfrcz.pd.256(<4 x double> %a0)
769 ret <4 x double> %res
771 declare <4 x double> @llvm.x86.xop.vfrcz.pd.256(<4 x double>) nounwind readnone