1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -disable-peephole -mtriple=i686-unknown-unknown -mattr=avx2 -show-mc-encoding | FileCheck %s --check-prefix=CHECK --check-prefix=AVX2 --check-prefix=X86 --check-prefix=X86-AVX
3 ; RUN: llc < %s -disable-peephole -mtriple=i686-unknown-unknown -mattr=+avx512f,+avx512bw,+avx512vl,+avx512dq -show-mc-encoding | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512VL --check-prefix=X86 --check-prefix=X86-AVX512VL
4 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=avx2 -show-mc-encoding | FileCheck %s --check-prefix=CHECK --check-prefix=AVX2 --check-prefix=X64 --check-prefix=X64-AVX
5 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw,+avx512vl,+avx512dq -show-mc-encoding | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512VL --check-prefix=X64 --check-prefix=X64-AVX512VL
7 define <16 x i16> @test_x86_avx2_packssdw(<8 x i32> %a0, <8 x i32> %a1) {
8 ; AVX2-LABEL: test_x86_avx2_packssdw:
10 ; AVX2-NEXT: vpackssdw %ymm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0x6b,0xc1]
11 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
13 ; AVX512VL-LABEL: test_x86_avx2_packssdw:
15 ; AVX512VL-NEXT: vpackssdw %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0x6b,0xc1]
16 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
17 %res = call <16 x i16> @llvm.x86.avx2.packssdw(<8 x i32> %a0, <8 x i32> %a1) ; <<16 x i16>> [#uses=1]
20 declare <16 x i16> @llvm.x86.avx2.packssdw(<8 x i32>, <8 x i32>) nounwind readnone
23 define <16 x i16> @test_x86_avx2_packssdw_fold() {
24 ; X86-AVX-LABEL: test_x86_avx2_packssdw_fold:
26 ; X86-AVX-NEXT: vmovaps {{.*#+}} ymm0 = [0,0,0,0,255,32767,32767,65535,0,0,0,0,32769,32768,0,65280]
27 ; X86-AVX-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
28 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
29 ; X86-AVX-NEXT: retl # encoding: [0xc3]
31 ; X86-AVX512VL-LABEL: test_x86_avx2_packssdw_fold:
32 ; X86-AVX512VL: # %bb.0:
33 ; X86-AVX512VL-NEXT: vmovaps {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0 # EVEX TO VEX Compression ymm0 = [0,0,0,0,255,32767,32767,65535,0,0,0,0,32769,32768,0,65280]
34 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
35 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
36 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
38 ; X64-AVX-LABEL: test_x86_avx2_packssdw_fold:
40 ; X64-AVX-NEXT: vmovaps {{.*#+}} ymm0 = [0,0,0,0,255,32767,32767,65535,0,0,0,0,32769,32768,0,65280]
41 ; X64-AVX-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
42 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
43 ; X64-AVX-NEXT: retq # encoding: [0xc3]
45 ; X64-AVX512VL-LABEL: test_x86_avx2_packssdw_fold:
46 ; X64-AVX512VL: # %bb.0:
47 ; X64-AVX512VL-NEXT: vmovaps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0 # EVEX TO VEX Compression ymm0 = [0,0,0,0,255,32767,32767,65535,0,0,0,0,32769,32768,0,65280]
48 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
49 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
50 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
51 %res = call <16 x i16> @llvm.x86.avx2.packssdw(<8 x i32> zeroinitializer, <8 x i32> <i32 255, i32 32767, i32 65535, i32 -1, i32 -32767, i32 -65535, i32 0, i32 -256>)
56 define <32 x i8> @test_x86_avx2_packsswb(<16 x i16> %a0, <16 x i16> %a1) {
57 ; AVX2-LABEL: test_x86_avx2_packsswb:
59 ; AVX2-NEXT: vpacksswb %ymm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0x63,0xc1]
60 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
62 ; AVX512VL-LABEL: test_x86_avx2_packsswb:
64 ; AVX512VL-NEXT: vpacksswb %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0x63,0xc1]
65 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
66 %res = call <32 x i8> @llvm.x86.avx2.packsswb(<16 x i16> %a0, <16 x i16> %a1) ; <<32 x i8>> [#uses=1]
69 declare <32 x i8> @llvm.x86.avx2.packsswb(<16 x i16>, <16 x i16>) nounwind readnone
72 define <32 x i8> @test_x86_avx2_packsswb_fold() {
73 ; X86-AVX-LABEL: test_x86_avx2_packsswb_fold:
75 ; X86-AVX-NEXT: vmovaps {{.*#+}} ymm0 = [0,127,127,255,255,128,128,128,0,0,0,0,0,0,0,0,0,127,127,255,255,128,128,128,0,0,0,0,0,0,0,0]
76 ; X86-AVX-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
77 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
78 ; X86-AVX-NEXT: retl # encoding: [0xc3]
80 ; X86-AVX512VL-LABEL: test_x86_avx2_packsswb_fold:
81 ; X86-AVX512VL: # %bb.0:
82 ; X86-AVX512VL-NEXT: vmovaps {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0 # EVEX TO VEX Compression ymm0 = [0,127,127,255,255,128,128,128,0,0,0,0,0,0,0,0,0,127,127,255,255,128,128,128,0,0,0,0,0,0,0,0]
83 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
84 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
85 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
87 ; X64-AVX-LABEL: test_x86_avx2_packsswb_fold:
89 ; X64-AVX-NEXT: vmovaps {{.*#+}} ymm0 = [0,127,127,255,255,128,128,128,0,0,0,0,0,0,0,0,0,127,127,255,255,128,128,128,0,0,0,0,0,0,0,0]
90 ; X64-AVX-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
91 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
92 ; X64-AVX-NEXT: retq # encoding: [0xc3]
94 ; X64-AVX512VL-LABEL: test_x86_avx2_packsswb_fold:
95 ; X64-AVX512VL: # %bb.0:
96 ; X64-AVX512VL-NEXT: vmovaps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0 # EVEX TO VEX Compression ymm0 = [0,127,127,255,255,128,128,128,0,0,0,0,0,0,0,0,0,127,127,255,255,128,128,128,0,0,0,0,0,0,0,0]
97 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
98 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
99 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
100 %res = call <32 x i8> @llvm.x86.avx2.packsswb(<16 x i16> <i16 0, i16 255, i16 256, i16 65535, i16 -1, i16 -255, i16 -256, i16 -32678, i16 0, i16 255, i16 256, i16 65535, i16 -1, i16 -255, i16 -256, i16 -32678>, <16 x i16> zeroinitializer)
105 define <32 x i8> @test_x86_avx2_packuswb(<16 x i16> %a0, <16 x i16> %a1) {
106 ; AVX2-LABEL: test_x86_avx2_packuswb:
108 ; AVX2-NEXT: vpackuswb %ymm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0x67,0xc1]
109 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
111 ; AVX512VL-LABEL: test_x86_avx2_packuswb:
113 ; AVX512VL-NEXT: vpackuswb %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0x67,0xc1]
114 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
115 %res = call <32 x i8> @llvm.x86.avx2.packuswb(<16 x i16> %a0, <16 x i16> %a1) ; <<32 x i8>> [#uses=1]
118 declare <32 x i8> @llvm.x86.avx2.packuswb(<16 x i16>, <16 x i16>) nounwind readnone
121 define <32 x i8> @test_x86_avx2_packuswb_fold() {
122 ; X86-AVX-LABEL: test_x86_avx2_packuswb_fold:
124 ; X86-AVX-NEXT: vmovaps {{.*#+}} ymm0 = [0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0]
125 ; X86-AVX-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
126 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
127 ; X86-AVX-NEXT: retl # encoding: [0xc3]
129 ; X86-AVX512VL-LABEL: test_x86_avx2_packuswb_fold:
130 ; X86-AVX512VL: # %bb.0:
131 ; X86-AVX512VL-NEXT: vmovaps {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0 # EVEX TO VEX Compression ymm0 = [0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0]
132 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
133 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
134 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
136 ; X64-AVX-LABEL: test_x86_avx2_packuswb_fold:
138 ; X64-AVX-NEXT: vmovaps {{.*#+}} ymm0 = [0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0]
139 ; X64-AVX-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
140 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
141 ; X64-AVX-NEXT: retq # encoding: [0xc3]
143 ; X64-AVX512VL-LABEL: test_x86_avx2_packuswb_fold:
144 ; X64-AVX512VL: # %bb.0:
145 ; X64-AVX512VL-NEXT: vmovaps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0 # EVEX TO VEX Compression ymm0 = [0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0]
146 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
147 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
148 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
149 %res = call <32 x i8> @llvm.x86.avx2.packuswb(<16 x i16> <i16 0, i16 255, i16 256, i16 65535, i16 -1, i16 -255, i16 -256, i16 -32678, i16 0, i16 255, i16 256, i16 65535, i16 -1, i16 -255, i16 -256, i16 -32678>, <16 x i16> zeroinitializer)
154 define <32 x i8> @test_x86_avx2_pavg_b(<32 x i8> %a0, <32 x i8> %a1) {
155 ; AVX2-LABEL: test_x86_avx2_pavg_b:
157 ; AVX2-NEXT: vpavgb %ymm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xe0,0xc1]
158 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
160 ; AVX512VL-LABEL: test_x86_avx2_pavg_b:
162 ; AVX512VL-NEXT: vpavgb %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xe0,0xc1]
163 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
164 %res = call <32 x i8> @llvm.x86.avx2.pavg.b(<32 x i8> %a0, <32 x i8> %a1) ; <<32 x i8>> [#uses=1]
167 declare <32 x i8> @llvm.x86.avx2.pavg.b(<32 x i8>, <32 x i8>) nounwind readnone
170 define <16 x i16> @test_x86_avx2_pavg_w(<16 x i16> %a0, <16 x i16> %a1) {
171 ; AVX2-LABEL: test_x86_avx2_pavg_w:
173 ; AVX2-NEXT: vpavgw %ymm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xe3,0xc1]
174 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
176 ; AVX512VL-LABEL: test_x86_avx2_pavg_w:
178 ; AVX512VL-NEXT: vpavgw %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xe3,0xc1]
179 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
180 %res = call <16 x i16> @llvm.x86.avx2.pavg.w(<16 x i16> %a0, <16 x i16> %a1) ; <<16 x i16>> [#uses=1]
183 declare <16 x i16> @llvm.x86.avx2.pavg.w(<16 x i16>, <16 x i16>) nounwind readnone
186 define <8 x i32> @test_x86_avx2_pmadd_wd(<16 x i16> %a0, <16 x i16> %a1) {
187 ; AVX2-LABEL: test_x86_avx2_pmadd_wd:
189 ; AVX2-NEXT: vpmaddwd %ymm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xf5,0xc1]
190 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
192 ; AVX512VL-LABEL: test_x86_avx2_pmadd_wd:
194 ; AVX512VL-NEXT: vpmaddwd %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xf5,0xc1]
195 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
196 %res = call <8 x i32> @llvm.x86.avx2.pmadd.wd(<16 x i16> %a0, <16 x i16> %a1) ; <<8 x i32>> [#uses=1]
199 declare <8 x i32> @llvm.x86.avx2.pmadd.wd(<16 x i16>, <16 x i16>) nounwind readnone
202 define i32 @test_x86_avx2_pmovmskb(<32 x i8> %a0) {
203 ; CHECK-LABEL: test_x86_avx2_pmovmskb:
205 ; CHECK-NEXT: vpmovmskb %ymm0, %eax # encoding: [0xc5,0xfd,0xd7,0xc0]
206 ; CHECK-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
207 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
208 %res = call i32 @llvm.x86.avx2.pmovmskb(<32 x i8> %a0) ; <i32> [#uses=1]
211 declare i32 @llvm.x86.avx2.pmovmskb(<32 x i8>) nounwind readnone
214 define <16 x i16> @test_x86_avx2_pmulh_w(<16 x i16> %a0, <16 x i16> %a1) {
215 ; AVX2-LABEL: test_x86_avx2_pmulh_w:
217 ; AVX2-NEXT: vpmulhw %ymm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xe5,0xc1]
218 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
220 ; AVX512VL-LABEL: test_x86_avx2_pmulh_w:
222 ; AVX512VL-NEXT: vpmulhw %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xe5,0xc1]
223 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
224 %res = call <16 x i16> @llvm.x86.avx2.pmulh.w(<16 x i16> %a0, <16 x i16> %a1) ; <<16 x i16>> [#uses=1]
227 declare <16 x i16> @llvm.x86.avx2.pmulh.w(<16 x i16>, <16 x i16>) nounwind readnone
230 define <16 x i16> @test_x86_avx2_pmulhu_w(<16 x i16> %a0, <16 x i16> %a1) {
231 ; AVX2-LABEL: test_x86_avx2_pmulhu_w:
233 ; AVX2-NEXT: vpmulhuw %ymm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xe4,0xc1]
234 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
236 ; AVX512VL-LABEL: test_x86_avx2_pmulhu_w:
238 ; AVX512VL-NEXT: vpmulhuw %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xe4,0xc1]
239 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
240 %res = call <16 x i16> @llvm.x86.avx2.pmulhu.w(<16 x i16> %a0, <16 x i16> %a1) ; <<16 x i16>> [#uses=1]
243 declare <16 x i16> @llvm.x86.avx2.pmulhu.w(<16 x i16>, <16 x i16>) nounwind readnone
246 define <4 x i64> @test_x86_avx2_psad_bw(<32 x i8> %a0, <32 x i8> %a1) {
247 ; AVX2-LABEL: test_x86_avx2_psad_bw:
249 ; AVX2-NEXT: vpsadbw %ymm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xf6,0xc1]
250 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
252 ; AVX512VL-LABEL: test_x86_avx2_psad_bw:
254 ; AVX512VL-NEXT: vpsadbw %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xf6,0xc1]
255 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
256 %res = call <4 x i64> @llvm.x86.avx2.psad.bw(<32 x i8> %a0, <32 x i8> %a1) ; <<4 x i64>> [#uses=1]
259 declare <4 x i64> @llvm.x86.avx2.psad.bw(<32 x i8>, <32 x i8>) nounwind readnone
262 define <8 x i32> @test_x86_avx2_psll_d(<8 x i32> %a0, <4 x i32> %a1) {
263 ; AVX2-LABEL: test_x86_avx2_psll_d:
265 ; AVX2-NEXT: vpslld %xmm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xf2,0xc1]
266 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
268 ; AVX512VL-LABEL: test_x86_avx2_psll_d:
270 ; AVX512VL-NEXT: vpslld %xmm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xf2,0xc1]
271 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
272 %res = call <8 x i32> @llvm.x86.avx2.psll.d(<8 x i32> %a0, <4 x i32> %a1) ; <<8 x i32>> [#uses=1]
275 declare <8 x i32> @llvm.x86.avx2.psll.d(<8 x i32>, <4 x i32>) nounwind readnone
278 define <4 x i64> @test_x86_avx2_psll_q(<4 x i64> %a0, <2 x i64> %a1) {
279 ; AVX2-LABEL: test_x86_avx2_psll_q:
281 ; AVX2-NEXT: vpsllq %xmm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xf3,0xc1]
282 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
284 ; AVX512VL-LABEL: test_x86_avx2_psll_q:
286 ; AVX512VL-NEXT: vpsllq %xmm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xf3,0xc1]
287 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
288 %res = call <4 x i64> @llvm.x86.avx2.psll.q(<4 x i64> %a0, <2 x i64> %a1) ; <<4 x i64>> [#uses=1]
291 declare <4 x i64> @llvm.x86.avx2.psll.q(<4 x i64>, <2 x i64>) nounwind readnone
294 define <16 x i16> @test_x86_avx2_psll_w(<16 x i16> %a0, <8 x i16> %a1) {
295 ; AVX2-LABEL: test_x86_avx2_psll_w:
297 ; AVX2-NEXT: vpsllw %xmm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xf1,0xc1]
298 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
300 ; AVX512VL-LABEL: test_x86_avx2_psll_w:
302 ; AVX512VL-NEXT: vpsllw %xmm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xf1,0xc1]
303 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
304 %res = call <16 x i16> @llvm.x86.avx2.psll.w(<16 x i16> %a0, <8 x i16> %a1) ; <<16 x i16>> [#uses=1]
307 declare <16 x i16> @llvm.x86.avx2.psll.w(<16 x i16>, <8 x i16>) nounwind readnone
310 define <8 x i32> @test_x86_avx2_pslli_d(<8 x i32> %a0) {
311 ; AVX2-LABEL: test_x86_avx2_pslli_d:
313 ; AVX2-NEXT: vpslld $7, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0x72,0xf0,0x07]
314 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
316 ; AVX512VL-LABEL: test_x86_avx2_pslli_d:
318 ; AVX512VL-NEXT: vpslld $7, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0x72,0xf0,0x07]
319 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
320 %res = call <8 x i32> @llvm.x86.avx2.pslli.d(<8 x i32> %a0, i32 7) ; <<8 x i32>> [#uses=1]
323 declare <8 x i32> @llvm.x86.avx2.pslli.d(<8 x i32>, i32) nounwind readnone
326 define <4 x i64> @test_x86_avx2_pslli_q(<4 x i64> %a0) {
327 ; AVX2-LABEL: test_x86_avx2_pslli_q:
329 ; AVX2-NEXT: vpsllq $7, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0x73,0xf0,0x07]
330 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
332 ; AVX512VL-LABEL: test_x86_avx2_pslli_q:
334 ; AVX512VL-NEXT: vpsllq $7, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0x73,0xf0,0x07]
335 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
336 %res = call <4 x i64> @llvm.x86.avx2.pslli.q(<4 x i64> %a0, i32 7) ; <<4 x i64>> [#uses=1]
339 declare <4 x i64> @llvm.x86.avx2.pslli.q(<4 x i64>, i32) nounwind readnone
342 define <16 x i16> @test_x86_avx2_pslli_w(<16 x i16> %a0) {
343 ; AVX2-LABEL: test_x86_avx2_pslli_w:
345 ; AVX2-NEXT: vpsllw $7, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0x71,0xf0,0x07]
346 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
348 ; AVX512VL-LABEL: test_x86_avx2_pslli_w:
350 ; AVX512VL-NEXT: vpsllw $7, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0x71,0xf0,0x07]
351 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
352 %res = call <16 x i16> @llvm.x86.avx2.pslli.w(<16 x i16> %a0, i32 7) ; <<16 x i16>> [#uses=1]
355 declare <16 x i16> @llvm.x86.avx2.pslli.w(<16 x i16>, i32) nounwind readnone
358 define <8 x i32> @test_x86_avx2_psra_d(<8 x i32> %a0, <4 x i32> %a1) {
359 ; AVX2-LABEL: test_x86_avx2_psra_d:
361 ; AVX2-NEXT: vpsrad %xmm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xe2,0xc1]
362 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
364 ; AVX512VL-LABEL: test_x86_avx2_psra_d:
366 ; AVX512VL-NEXT: vpsrad %xmm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xe2,0xc1]
367 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
368 %res = call <8 x i32> @llvm.x86.avx2.psra.d(<8 x i32> %a0, <4 x i32> %a1) ; <<8 x i32>> [#uses=1]
371 declare <8 x i32> @llvm.x86.avx2.psra.d(<8 x i32>, <4 x i32>) nounwind readnone
374 define <16 x i16> @test_x86_avx2_psra_w(<16 x i16> %a0, <8 x i16> %a1) {
375 ; AVX2-LABEL: test_x86_avx2_psra_w:
377 ; AVX2-NEXT: vpsraw %xmm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xe1,0xc1]
378 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
380 ; AVX512VL-LABEL: test_x86_avx2_psra_w:
382 ; AVX512VL-NEXT: vpsraw %xmm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xe1,0xc1]
383 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
384 %res = call <16 x i16> @llvm.x86.avx2.psra.w(<16 x i16> %a0, <8 x i16> %a1) ; <<16 x i16>> [#uses=1]
387 declare <16 x i16> @llvm.x86.avx2.psra.w(<16 x i16>, <8 x i16>) nounwind readnone
390 define <8 x i32> @test_x86_avx2_psrai_d(<8 x i32> %a0) {
391 ; AVX2-LABEL: test_x86_avx2_psrai_d:
393 ; AVX2-NEXT: vpsrad $7, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0x72,0xe0,0x07]
394 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
396 ; AVX512VL-LABEL: test_x86_avx2_psrai_d:
398 ; AVX512VL-NEXT: vpsrad $7, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0x72,0xe0,0x07]
399 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
400 %res = call <8 x i32> @llvm.x86.avx2.psrai.d(<8 x i32> %a0, i32 7) ; <<8 x i32>> [#uses=1]
403 declare <8 x i32> @llvm.x86.avx2.psrai.d(<8 x i32>, i32) nounwind readnone
406 define <16 x i16> @test_x86_avx2_psrai_w(<16 x i16> %a0) {
407 ; AVX2-LABEL: test_x86_avx2_psrai_w:
409 ; AVX2-NEXT: vpsraw $7, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0x71,0xe0,0x07]
410 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
412 ; AVX512VL-LABEL: test_x86_avx2_psrai_w:
414 ; AVX512VL-NEXT: vpsraw $7, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0x71,0xe0,0x07]
415 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
416 %res = call <16 x i16> @llvm.x86.avx2.psrai.w(<16 x i16> %a0, i32 7) ; <<16 x i16>> [#uses=1]
419 declare <16 x i16> @llvm.x86.avx2.psrai.w(<16 x i16>, i32) nounwind readnone
422 define <8 x i32> @test_x86_avx2_psrl_d(<8 x i32> %a0, <4 x i32> %a1) {
423 ; AVX2-LABEL: test_x86_avx2_psrl_d:
425 ; AVX2-NEXT: vpsrld %xmm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xd2,0xc1]
426 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
428 ; AVX512VL-LABEL: test_x86_avx2_psrl_d:
430 ; AVX512VL-NEXT: vpsrld %xmm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xd2,0xc1]
431 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
432 %res = call <8 x i32> @llvm.x86.avx2.psrl.d(<8 x i32> %a0, <4 x i32> %a1) ; <<8 x i32>> [#uses=1]
435 declare <8 x i32> @llvm.x86.avx2.psrl.d(<8 x i32>, <4 x i32>) nounwind readnone
438 define <4 x i64> @test_x86_avx2_psrl_q(<4 x i64> %a0, <2 x i64> %a1) {
439 ; AVX2-LABEL: test_x86_avx2_psrl_q:
441 ; AVX2-NEXT: vpsrlq %xmm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xd3,0xc1]
442 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
444 ; AVX512VL-LABEL: test_x86_avx2_psrl_q:
446 ; AVX512VL-NEXT: vpsrlq %xmm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xd3,0xc1]
447 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
448 %res = call <4 x i64> @llvm.x86.avx2.psrl.q(<4 x i64> %a0, <2 x i64> %a1) ; <<4 x i64>> [#uses=1]
451 declare <4 x i64> @llvm.x86.avx2.psrl.q(<4 x i64>, <2 x i64>) nounwind readnone
454 define <16 x i16> @test_x86_avx2_psrl_w(<16 x i16> %a0, <8 x i16> %a1) {
455 ; AVX2-LABEL: test_x86_avx2_psrl_w:
457 ; AVX2-NEXT: vpsrlw %xmm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xd1,0xc1]
458 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
460 ; AVX512VL-LABEL: test_x86_avx2_psrl_w:
462 ; AVX512VL-NEXT: vpsrlw %xmm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xd1,0xc1]
463 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
464 %res = call <16 x i16> @llvm.x86.avx2.psrl.w(<16 x i16> %a0, <8 x i16> %a1) ; <<16 x i16>> [#uses=1]
467 declare <16 x i16> @llvm.x86.avx2.psrl.w(<16 x i16>, <8 x i16>) nounwind readnone
470 define <16 x i16> @test_x86_avx2_psrl_w_load(<16 x i16> %a0, <8 x i16>* %p) {
471 ; X86-AVX-LABEL: test_x86_avx2_psrl_w_load:
473 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
474 ; X86-AVX-NEXT: vpsrlw (%eax), %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xd1,0x00]
475 ; X86-AVX-NEXT: retl # encoding: [0xc3]
477 ; X86-AVX512VL-LABEL: test_x86_avx2_psrl_w_load:
478 ; X86-AVX512VL: # %bb.0:
479 ; X86-AVX512VL-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
480 ; X86-AVX512VL-NEXT: vpsrlw (%eax), %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xd1,0x00]
481 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
483 ; X64-AVX-LABEL: test_x86_avx2_psrl_w_load:
485 ; X64-AVX-NEXT: vpsrlw (%rdi), %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xd1,0x07]
486 ; X64-AVX-NEXT: retq # encoding: [0xc3]
488 ; X64-AVX512VL-LABEL: test_x86_avx2_psrl_w_load:
489 ; X64-AVX512VL: # %bb.0:
490 ; X64-AVX512VL-NEXT: vpsrlw (%rdi), %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xd1,0x07]
491 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
492 %a1 = load <8 x i16>, <8 x i16>* %p
493 %res = call <16 x i16> @llvm.x86.avx2.psrl.w(<16 x i16> %a0, <8 x i16> %a1) ; <<16 x i16>> [#uses=1]
498 define <8 x i32> @test_x86_avx2_psrli_d(<8 x i32> %a0) {
499 ; AVX2-LABEL: test_x86_avx2_psrli_d:
501 ; AVX2-NEXT: vpsrld $7, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0x72,0xd0,0x07]
502 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
504 ; AVX512VL-LABEL: test_x86_avx2_psrli_d:
506 ; AVX512VL-NEXT: vpsrld $7, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0x72,0xd0,0x07]
507 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
508 %res = call <8 x i32> @llvm.x86.avx2.psrli.d(<8 x i32> %a0, i32 7) ; <<8 x i32>> [#uses=1]
511 declare <8 x i32> @llvm.x86.avx2.psrli.d(<8 x i32>, i32) nounwind readnone
514 define <4 x i64> @test_x86_avx2_psrli_q(<4 x i64> %a0) {
515 ; AVX2-LABEL: test_x86_avx2_psrli_q:
517 ; AVX2-NEXT: vpsrlq $7, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0x73,0xd0,0x07]
518 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
520 ; AVX512VL-LABEL: test_x86_avx2_psrli_q:
522 ; AVX512VL-NEXT: vpsrlq $7, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0x73,0xd0,0x07]
523 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
524 %res = call <4 x i64> @llvm.x86.avx2.psrli.q(<4 x i64> %a0, i32 7) ; <<4 x i64>> [#uses=1]
527 declare <4 x i64> @llvm.x86.avx2.psrli.q(<4 x i64>, i32) nounwind readnone
530 define <16 x i16> @test_x86_avx2_psrli_w(<16 x i16> %a0) {
531 ; AVX2-LABEL: test_x86_avx2_psrli_w:
533 ; AVX2-NEXT: vpsrlw $7, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0x71,0xd0,0x07]
534 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
536 ; AVX512VL-LABEL: test_x86_avx2_psrli_w:
538 ; AVX512VL-NEXT: vpsrlw $7, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0x71,0xd0,0x07]
539 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
540 %res = call <16 x i16> @llvm.x86.avx2.psrli.w(<16 x i16> %a0, i32 7) ; <<16 x i16>> [#uses=1]
543 declare <16 x i16> @llvm.x86.avx2.psrli.w(<16 x i16>, i32) nounwind readnone
546 define <8 x i32> @test_x86_avx2_phadd_d(<8 x i32> %a0, <8 x i32> %a1) {
547 ; CHECK-LABEL: test_x86_avx2_phadd_d:
549 ; CHECK-NEXT: vphaddd %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x02,0xc1]
550 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
551 %res = call <8 x i32> @llvm.x86.avx2.phadd.d(<8 x i32> %a0, <8 x i32> %a1) ; <<8 x i32>> [#uses=1]
554 declare <8 x i32> @llvm.x86.avx2.phadd.d(<8 x i32>, <8 x i32>) nounwind readnone
557 define <16 x i16> @test_x86_avx2_phadd_sw(<16 x i16> %a0, <16 x i16> %a1) {
558 ; CHECK-LABEL: test_x86_avx2_phadd_sw:
560 ; CHECK-NEXT: vphaddsw %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x03,0xc1]
561 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
562 %res = call <16 x i16> @llvm.x86.avx2.phadd.sw(<16 x i16> %a0, <16 x i16> %a1) ; <<16 x i16>> [#uses=1]
565 declare <16 x i16> @llvm.x86.avx2.phadd.sw(<16 x i16>, <16 x i16>) nounwind readnone
568 define <16 x i16> @test_x86_avx2_phadd_w(<16 x i16> %a0, <16 x i16> %a1) {
569 ; CHECK-LABEL: test_x86_avx2_phadd_w:
571 ; CHECK-NEXT: vphaddw %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x01,0xc1]
572 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
573 %res = call <16 x i16> @llvm.x86.avx2.phadd.w(<16 x i16> %a0, <16 x i16> %a1) ; <<16 x i16>> [#uses=1]
576 declare <16 x i16> @llvm.x86.avx2.phadd.w(<16 x i16>, <16 x i16>) nounwind readnone
579 define <8 x i32> @test_x86_avx2_phsub_d(<8 x i32> %a0, <8 x i32> %a1) {
580 ; CHECK-LABEL: test_x86_avx2_phsub_d:
582 ; CHECK-NEXT: vphsubd %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x06,0xc1]
583 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
584 %res = call <8 x i32> @llvm.x86.avx2.phsub.d(<8 x i32> %a0, <8 x i32> %a1) ; <<8 x i32>> [#uses=1]
587 declare <8 x i32> @llvm.x86.avx2.phsub.d(<8 x i32>, <8 x i32>) nounwind readnone
590 define <16 x i16> @test_x86_avx2_phsub_sw(<16 x i16> %a0, <16 x i16> %a1) {
591 ; CHECK-LABEL: test_x86_avx2_phsub_sw:
593 ; CHECK-NEXT: vphsubsw %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x07,0xc1]
594 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
595 %res = call <16 x i16> @llvm.x86.avx2.phsub.sw(<16 x i16> %a0, <16 x i16> %a1) ; <<16 x i16>> [#uses=1]
598 declare <16 x i16> @llvm.x86.avx2.phsub.sw(<16 x i16>, <16 x i16>) nounwind readnone
601 define <16 x i16> @test_x86_avx2_phsub_w(<16 x i16> %a0, <16 x i16> %a1) {
602 ; CHECK-LABEL: test_x86_avx2_phsub_w:
604 ; CHECK-NEXT: vphsubw %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x05,0xc1]
605 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
606 %res = call <16 x i16> @llvm.x86.avx2.phsub.w(<16 x i16> %a0, <16 x i16> %a1) ; <<16 x i16>> [#uses=1]
609 declare <16 x i16> @llvm.x86.avx2.phsub.w(<16 x i16>, <16 x i16>) nounwind readnone
612 define <16 x i16> @test_x86_avx2_pmadd_ub_sw(<32 x i8> %a0, <32 x i8> %a1) {
613 ; AVX2-LABEL: test_x86_avx2_pmadd_ub_sw:
615 ; AVX2-NEXT: vpmaddubsw %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x04,0xc1]
616 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
618 ; AVX512VL-LABEL: test_x86_avx2_pmadd_ub_sw:
620 ; AVX512VL-NEXT: vpmaddubsw %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x04,0xc1]
621 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
622 %res = call <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8> %a0, <32 x i8> %a1) ; <<16 x i16>> [#uses=1]
625 declare <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8>, <32 x i8>) nounwind readnone
627 ; Make sure we don't commute this operation.
628 define <16 x i16> @test_x86_avx2_pmadd_ub_sw_load_op0(<32 x i8>* %ptr, <32 x i8> %a1) {
629 ; X86-AVX-LABEL: test_x86_avx2_pmadd_ub_sw_load_op0:
631 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
632 ; X86-AVX-NEXT: vmovdqa (%eax), %ymm1 # encoding: [0xc5,0xfd,0x6f,0x08]
633 ; X86-AVX-NEXT: vpmaddubsw %ymm0, %ymm1, %ymm0 # encoding: [0xc4,0xe2,0x75,0x04,0xc0]
634 ; X86-AVX-NEXT: retl # encoding: [0xc3]
636 ; X86-AVX512VL-LABEL: test_x86_avx2_pmadd_ub_sw_load_op0:
637 ; X86-AVX512VL: # %bb.0:
638 ; X86-AVX512VL-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
639 ; X86-AVX512VL-NEXT: vmovdqa (%eax), %ymm1 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0x6f,0x08]
640 ; X86-AVX512VL-NEXT: vpmaddubsw %ymm0, %ymm1, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x75,0x04,0xc0]
641 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
643 ; X64-AVX-LABEL: test_x86_avx2_pmadd_ub_sw_load_op0:
645 ; X64-AVX-NEXT: vmovdqa (%rdi), %ymm1 # encoding: [0xc5,0xfd,0x6f,0x0f]
646 ; X64-AVX-NEXT: vpmaddubsw %ymm0, %ymm1, %ymm0 # encoding: [0xc4,0xe2,0x75,0x04,0xc0]
647 ; X64-AVX-NEXT: retq # encoding: [0xc3]
649 ; X64-AVX512VL-LABEL: test_x86_avx2_pmadd_ub_sw_load_op0:
650 ; X64-AVX512VL: # %bb.0:
651 ; X64-AVX512VL-NEXT: vmovdqa (%rdi), %ymm1 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0x6f,0x0f]
652 ; X64-AVX512VL-NEXT: vpmaddubsw %ymm0, %ymm1, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x75,0x04,0xc0]
653 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
654 %a0 = load <32 x i8>, <32 x i8>* %ptr
655 %res = call <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8> %a0, <32 x i8> %a1) ; <<16 x i16>> [#uses=1]
659 define <16 x i16> @test_x86_avx2_pmul_hr_sw(<16 x i16> %a0, <16 x i16> %a1) {
660 ; AVX2-LABEL: test_x86_avx2_pmul_hr_sw:
662 ; AVX2-NEXT: vpmulhrsw %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x0b,0xc1]
663 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
665 ; AVX512VL-LABEL: test_x86_avx2_pmul_hr_sw:
667 ; AVX512VL-NEXT: vpmulhrsw %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x0b,0xc1]
668 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
669 %res = call <16 x i16> @llvm.x86.avx2.pmul.hr.sw(<16 x i16> %a0, <16 x i16> %a1) ; <<16 x i16>> [#uses=1]
672 declare <16 x i16> @llvm.x86.avx2.pmul.hr.sw(<16 x i16>, <16 x i16>) nounwind readnone
675 define <32 x i8> @test_x86_avx2_pshuf_b(<32 x i8> %a0, <32 x i8> %a1) {
676 ; AVX2-LABEL: test_x86_avx2_pshuf_b:
678 ; AVX2-NEXT: vpshufb %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x00,0xc1]
679 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
681 ; AVX512VL-LABEL: test_x86_avx2_pshuf_b:
683 ; AVX512VL-NEXT: vpshufb %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x00,0xc1]
684 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
685 %res = call <32 x i8> @llvm.x86.avx2.pshuf.b(<32 x i8> %a0, <32 x i8> %a1) ; <<16 x i8>> [#uses=1]
688 declare <32 x i8> @llvm.x86.avx2.pshuf.b(<32 x i8>, <32 x i8>) nounwind readnone
691 define <32 x i8> @test_x86_avx2_psign_b(<32 x i8> %a0, <32 x i8> %a1) {
692 ; CHECK-LABEL: test_x86_avx2_psign_b:
694 ; CHECK-NEXT: vpsignb %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x08,0xc1]
695 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
696 %res = call <32 x i8> @llvm.x86.avx2.psign.b(<32 x i8> %a0, <32 x i8> %a1) ; <<32 x i8>> [#uses=1]
699 declare <32 x i8> @llvm.x86.avx2.psign.b(<32 x i8>, <32 x i8>) nounwind readnone
702 define <8 x i32> @test_x86_avx2_psign_d(<8 x i32> %a0, <8 x i32> %a1) {
703 ; CHECK-LABEL: test_x86_avx2_psign_d:
705 ; CHECK-NEXT: vpsignd %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x0a,0xc1]
706 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
707 %res = call <8 x i32> @llvm.x86.avx2.psign.d(<8 x i32> %a0, <8 x i32> %a1) ; <<4 x i32>> [#uses=1]
710 declare <8 x i32> @llvm.x86.avx2.psign.d(<8 x i32>, <8 x i32>) nounwind readnone
713 define <16 x i16> @test_x86_avx2_psign_w(<16 x i16> %a0, <16 x i16> %a1) {
714 ; CHECK-LABEL: test_x86_avx2_psign_w:
716 ; CHECK-NEXT: vpsignw %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x09,0xc1]
717 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
718 %res = call <16 x i16> @llvm.x86.avx2.psign.w(<16 x i16> %a0, <16 x i16> %a1) ; <<16 x i16>> [#uses=1]
721 declare <16 x i16> @llvm.x86.avx2.psign.w(<16 x i16>, <16 x i16>) nounwind readnone
724 define <16 x i16> @test_x86_avx2_mpsadbw(<32 x i8> %a0, <32 x i8> %a1) {
725 ; CHECK-LABEL: test_x86_avx2_mpsadbw:
727 ; CHECK-NEXT: vmpsadbw $7, %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe3,0x7d,0x42,0xc1,0x07]
728 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
729 %res = call <16 x i16> @llvm.x86.avx2.mpsadbw(<32 x i8> %a0, <32 x i8> %a1, i8 7) ; <<16 x i16>> [#uses=1]
732 declare <16 x i16> @llvm.x86.avx2.mpsadbw(<32 x i8>, <32 x i8>, i8) nounwind readnone
735 define <16 x i16> @test_x86_avx2_packusdw(<8 x i32> %a0, <8 x i32> %a1) {
736 ; AVX2-LABEL: test_x86_avx2_packusdw:
738 ; AVX2-NEXT: vpackusdw %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x2b,0xc1]
739 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
741 ; AVX512VL-LABEL: test_x86_avx2_packusdw:
743 ; AVX512VL-NEXT: vpackusdw %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x2b,0xc1]
744 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
745 %res = call <16 x i16> @llvm.x86.avx2.packusdw(<8 x i32> %a0, <8 x i32> %a1) ; <<16 x i16>> [#uses=1]
748 declare <16 x i16> @llvm.x86.avx2.packusdw(<8 x i32>, <8 x i32>) nounwind readnone
751 define <16 x i16> @test_x86_avx2_packusdw_fold() {
752 ; X86-AVX-LABEL: test_x86_avx2_packusdw_fold:
754 ; X86-AVX-NEXT: vmovaps {{.*#+}} ymm0 = [0,0,0,0,255,32767,65535,0,0,0,0,0,0,0,0,0]
755 ; X86-AVX-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
756 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
757 ; X86-AVX-NEXT: retl # encoding: [0xc3]
759 ; X86-AVX512VL-LABEL: test_x86_avx2_packusdw_fold:
760 ; X86-AVX512VL: # %bb.0:
761 ; X86-AVX512VL-NEXT: vmovaps {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0 # EVEX TO VEX Compression ymm0 = [0,0,0,0,255,32767,65535,0,0,0,0,0,0,0,0,0]
762 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
763 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
764 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
766 ; X64-AVX-LABEL: test_x86_avx2_packusdw_fold:
768 ; X64-AVX-NEXT: vmovaps {{.*#+}} ymm0 = [0,0,0,0,255,32767,65535,0,0,0,0,0,0,0,0,0]
769 ; X64-AVX-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
770 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
771 ; X64-AVX-NEXT: retq # encoding: [0xc3]
773 ; X64-AVX512VL-LABEL: test_x86_avx2_packusdw_fold:
774 ; X64-AVX512VL: # %bb.0:
775 ; X64-AVX512VL-NEXT: vmovaps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0 # EVEX TO VEX Compression ymm0 = [0,0,0,0,255,32767,65535,0,0,0,0,0,0,0,0,0]
776 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xfc,0x28,0x05,A,A,A,A]
777 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
778 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
779 %res = call <16 x i16> @llvm.x86.avx2.packusdw(<8 x i32> zeroinitializer, <8 x i32> <i32 255, i32 32767, i32 65535, i32 -1, i32 -32767, i32 -65535, i32 0, i32 -256>)
784 define <32 x i8> @test_x86_avx2_pblendvb(<32 x i8> %a0, <32 x i8> %a1, <32 x i8> %a2) {
785 ; CHECK-LABEL: test_x86_avx2_pblendvb:
787 ; CHECK-NEXT: vpblendvb %ymm2, %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe3,0x7d,0x4c,0xc1,0x20]
788 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
789 %res = call <32 x i8> @llvm.x86.avx2.pblendvb(<32 x i8> %a0, <32 x i8> %a1, <32 x i8> %a2) ; <<32 x i8>> [#uses=1]
792 declare <32 x i8> @llvm.x86.avx2.pblendvb(<32 x i8>, <32 x i8>, <32 x i8>) nounwind readnone
795 define <16 x i16> @test_x86_avx2_pblendw(<16 x i16> %a0, <16 x i16> %a1) {
796 ; CHECK-LABEL: test_x86_avx2_pblendw:
798 ; CHECK-NEXT: vpblendw $7, %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe3,0x7d,0x0e,0xc1,0x07]
799 ; CHECK-NEXT: # ymm0 = ymm1[0,1,2],ymm0[3,4,5,6,7],ymm1[8,9,10],ymm0[11,12,13,14,15]
800 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
801 %res = call <16 x i16> @llvm.x86.avx2.pblendw(<16 x i16> %a0, <16 x i16> %a1, i8 7) ; <<16 x i16>> [#uses=1]
804 declare <16 x i16> @llvm.x86.avx2.pblendw(<16 x i16>, <16 x i16>, i8) nounwind readnone
807 define <4 x i32> @test_x86_avx2_pblendd_128(<4 x i32> %a0, <4 x i32> %a1) {
808 ; CHECK-LABEL: test_x86_avx2_pblendd_128:
810 ; CHECK-NEXT: vblendps $8, %xmm0, %xmm1, %xmm0 # encoding: [0xc4,0xe3,0x71,0x0c,0xc0,0x08]
811 ; CHECK-NEXT: # xmm0 = xmm1[0,1,2],xmm0[3]
812 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
813 %res = call <4 x i32> @llvm.x86.avx2.pblendd.128(<4 x i32> %a0, <4 x i32> %a1, i8 7) ; <<4 x i32>> [#uses=1]
816 declare <4 x i32> @llvm.x86.avx2.pblendd.128(<4 x i32>, <4 x i32>, i8) nounwind readnone
819 define <8 x i32> @test_x86_avx2_pblendd_256(<8 x i32> %a0, <8 x i32> %a1) {
820 ; CHECK-LABEL: test_x86_avx2_pblendd_256:
822 ; CHECK-NEXT: vblendps $7, %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe3,0x7d,0x0c,0xc1,0x07]
823 ; CHECK-NEXT: # ymm0 = ymm1[0,1,2],ymm0[3,4,5,6,7]
824 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
825 %res = call <8 x i32> @llvm.x86.avx2.pblendd.256(<8 x i32> %a0, <8 x i32> %a1, i8 7) ; <<8 x i32>> [#uses=1]
828 declare <8 x i32> @llvm.x86.avx2.pblendd.256(<8 x i32>, <8 x i32>, i8) nounwind readnone
831 ; Check that the arguments are swapped between the intrinsic definition
832 ; and its lowering. Indeed, the offsets are the first source in
834 define <8 x i32> @test_x86_avx2_permd(<8 x i32> %a0, <8 x i32> %a1) {
835 ; AVX2-LABEL: test_x86_avx2_permd:
837 ; AVX2-NEXT: vpermps %ymm0, %ymm1, %ymm0 # encoding: [0xc4,0xe2,0x75,0x16,0xc0]
838 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
840 ; AVX512VL-LABEL: test_x86_avx2_permd:
842 ; AVX512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x75,0x16,0xc0]
843 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
844 %res = call <8 x i32> @llvm.x86.avx2.permd(<8 x i32> %a0, <8 x i32> %a1) ; <<8 x i32>> [#uses=1]
847 declare <8 x i32> @llvm.x86.avx2.permd(<8 x i32>, <8 x i32>) nounwind readonly
850 ; Check that the arguments are swapped between the intrinsic definition
851 ; and its lowering. Indeed, the offsets are the first source in
853 define <8 x float> @test_x86_avx2_permps(<8 x float> %a0, <8 x i32> %a1) {
854 ; AVX2-LABEL: test_x86_avx2_permps:
856 ; AVX2-NEXT: vpermps %ymm0, %ymm1, %ymm0 # encoding: [0xc4,0xe2,0x75,0x16,0xc0]
857 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
859 ; AVX512VL-LABEL: test_x86_avx2_permps:
861 ; AVX512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x75,0x16,0xc0]
862 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
863 %res = call <8 x float> @llvm.x86.avx2.permps(<8 x float> %a0, <8 x i32> %a1) ; <<8 x float>> [#uses=1]
866 declare <8 x float> @llvm.x86.avx2.permps(<8 x float>, <8 x i32>) nounwind readonly
869 define <2 x i64> @test_x86_avx2_maskload_q(i8* %a0, <2 x i64> %a1) {
870 ; X86-LABEL: test_x86_avx2_maskload_q:
872 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
873 ; X86-NEXT: vpmaskmovq (%eax), %xmm0, %xmm0 # encoding: [0xc4,0xe2,0xf9,0x8c,0x00]
874 ; X86-NEXT: retl # encoding: [0xc3]
876 ; X64-LABEL: test_x86_avx2_maskload_q:
878 ; X64-NEXT: vpmaskmovq (%rdi), %xmm0, %xmm0 # encoding: [0xc4,0xe2,0xf9,0x8c,0x07]
879 ; X64-NEXT: retq # encoding: [0xc3]
880 %res = call <2 x i64> @llvm.x86.avx2.maskload.q(i8* %a0, <2 x i64> %a1) ; <<2 x i64>> [#uses=1]
883 declare <2 x i64> @llvm.x86.avx2.maskload.q(i8*, <2 x i64>) nounwind readonly
886 define <4 x i64> @test_x86_avx2_maskload_q_256(i8* %a0, <4 x i64> %a1) {
887 ; X86-LABEL: test_x86_avx2_maskload_q_256:
889 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
890 ; X86-NEXT: vpmaskmovq (%eax), %ymm0, %ymm0 # encoding: [0xc4,0xe2,0xfd,0x8c,0x00]
891 ; X86-NEXT: retl # encoding: [0xc3]
893 ; X64-LABEL: test_x86_avx2_maskload_q_256:
895 ; X64-NEXT: vpmaskmovq (%rdi), %ymm0, %ymm0 # encoding: [0xc4,0xe2,0xfd,0x8c,0x07]
896 ; X64-NEXT: retq # encoding: [0xc3]
897 %res = call <4 x i64> @llvm.x86.avx2.maskload.q.256(i8* %a0, <4 x i64> %a1) ; <<4 x i64>> [#uses=1]
900 declare <4 x i64> @llvm.x86.avx2.maskload.q.256(i8*, <4 x i64>) nounwind readonly
903 define <4 x i32> @test_x86_avx2_maskload_d(i8* %a0, <4 x i32> %a1) {
904 ; X86-LABEL: test_x86_avx2_maskload_d:
906 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
907 ; X86-NEXT: vpmaskmovd (%eax), %xmm0, %xmm0 # encoding: [0xc4,0xe2,0x79,0x8c,0x00]
908 ; X86-NEXT: retl # encoding: [0xc3]
910 ; X64-LABEL: test_x86_avx2_maskload_d:
912 ; X64-NEXT: vpmaskmovd (%rdi), %xmm0, %xmm0 # encoding: [0xc4,0xe2,0x79,0x8c,0x07]
913 ; X64-NEXT: retq # encoding: [0xc3]
914 %res = call <4 x i32> @llvm.x86.avx2.maskload.d(i8* %a0, <4 x i32> %a1) ; <<4 x i32>> [#uses=1]
917 declare <4 x i32> @llvm.x86.avx2.maskload.d(i8*, <4 x i32>) nounwind readonly
920 define <8 x i32> @test_x86_avx2_maskload_d_256(i8* %a0, <8 x i32> %a1) {
921 ; X86-LABEL: test_x86_avx2_maskload_d_256:
923 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
924 ; X86-NEXT: vpmaskmovd (%eax), %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x8c,0x00]
925 ; X86-NEXT: retl # encoding: [0xc3]
927 ; X64-LABEL: test_x86_avx2_maskload_d_256:
929 ; X64-NEXT: vpmaskmovd (%rdi), %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x8c,0x07]
930 ; X64-NEXT: retq # encoding: [0xc3]
931 %res = call <8 x i32> @llvm.x86.avx2.maskload.d.256(i8* %a0, <8 x i32> %a1) ; <<8 x i32>> [#uses=1]
934 declare <8 x i32> @llvm.x86.avx2.maskload.d.256(i8*, <8 x i32>) nounwind readonly
937 define void @test_x86_avx2_maskstore_q(i8* %a0, <2 x i64> %a1, <2 x i64> %a2) {
938 ; X86-LABEL: test_x86_avx2_maskstore_q:
940 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
941 ; X86-NEXT: vpmaskmovq %xmm1, %xmm0, (%eax) # encoding: [0xc4,0xe2,0xf9,0x8e,0x08]
942 ; X86-NEXT: retl # encoding: [0xc3]
944 ; X64-LABEL: test_x86_avx2_maskstore_q:
946 ; X64-NEXT: vpmaskmovq %xmm1, %xmm0, (%rdi) # encoding: [0xc4,0xe2,0xf9,0x8e,0x0f]
947 ; X64-NEXT: retq # encoding: [0xc3]
948 call void @llvm.x86.avx2.maskstore.q(i8* %a0, <2 x i64> %a1, <2 x i64> %a2)
951 declare void @llvm.x86.avx2.maskstore.q(i8*, <2 x i64>, <2 x i64>) nounwind
954 define void @test_x86_avx2_maskstore_q_256(i8* %a0, <4 x i64> %a1, <4 x i64> %a2) {
955 ; X86-LABEL: test_x86_avx2_maskstore_q_256:
957 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
958 ; X86-NEXT: vpmaskmovq %ymm1, %ymm0, (%eax) # encoding: [0xc4,0xe2,0xfd,0x8e,0x08]
959 ; X86-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
960 ; X86-NEXT: retl # encoding: [0xc3]
962 ; X64-LABEL: test_x86_avx2_maskstore_q_256:
964 ; X64-NEXT: vpmaskmovq %ymm1, %ymm0, (%rdi) # encoding: [0xc4,0xe2,0xfd,0x8e,0x0f]
965 ; X64-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
966 ; X64-NEXT: retq # encoding: [0xc3]
967 call void @llvm.x86.avx2.maskstore.q.256(i8* %a0, <4 x i64> %a1, <4 x i64> %a2)
970 declare void @llvm.x86.avx2.maskstore.q.256(i8*, <4 x i64>, <4 x i64>) nounwind
973 define void @test_x86_avx2_maskstore_d(i8* %a0, <4 x i32> %a1, <4 x i32> %a2) {
974 ; X86-LABEL: test_x86_avx2_maskstore_d:
976 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
977 ; X86-NEXT: vpmaskmovd %xmm1, %xmm0, (%eax) # encoding: [0xc4,0xe2,0x79,0x8e,0x08]
978 ; X86-NEXT: retl # encoding: [0xc3]
980 ; X64-LABEL: test_x86_avx2_maskstore_d:
982 ; X64-NEXT: vpmaskmovd %xmm1, %xmm0, (%rdi) # encoding: [0xc4,0xe2,0x79,0x8e,0x0f]
983 ; X64-NEXT: retq # encoding: [0xc3]
984 call void @llvm.x86.avx2.maskstore.d(i8* %a0, <4 x i32> %a1, <4 x i32> %a2)
987 declare void @llvm.x86.avx2.maskstore.d(i8*, <4 x i32>, <4 x i32>) nounwind
990 define void @test_x86_avx2_maskstore_d_256(i8* %a0, <8 x i32> %a1, <8 x i32> %a2) {
991 ; X86-LABEL: test_x86_avx2_maskstore_d_256:
993 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
994 ; X86-NEXT: vpmaskmovd %ymm1, %ymm0, (%eax) # encoding: [0xc4,0xe2,0x7d,0x8e,0x08]
995 ; X86-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
996 ; X86-NEXT: retl # encoding: [0xc3]
998 ; X64-LABEL: test_x86_avx2_maskstore_d_256:
1000 ; X64-NEXT: vpmaskmovd %ymm1, %ymm0, (%rdi) # encoding: [0xc4,0xe2,0x7d,0x8e,0x0f]
1001 ; X64-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
1002 ; X64-NEXT: retq # encoding: [0xc3]
1003 call void @llvm.x86.avx2.maskstore.d.256(i8* %a0, <8 x i32> %a1, <8 x i32> %a2)
1006 declare void @llvm.x86.avx2.maskstore.d.256(i8*, <8 x i32>, <8 x i32>) nounwind
1009 define <4 x i32> @test_x86_avx2_psllv_d(<4 x i32> %a0, <4 x i32> %a1) {
1010 ; AVX2-LABEL: test_x86_avx2_psllv_d:
1012 ; AVX2-NEXT: vpsllvd %xmm1, %xmm0, %xmm0 # encoding: [0xc4,0xe2,0x79,0x47,0xc1]
1013 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1015 ; AVX512VL-LABEL: test_x86_avx2_psllv_d:
1016 ; AVX512VL: # %bb.0:
1017 ; AVX512VL-NEXT: vpsllvd %xmm1, %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x47,0xc1]
1018 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1019 %res = call <4 x i32> @llvm.x86.avx2.psllv.d(<4 x i32> %a0, <4 x i32> %a1) ; <<4 x i32>> [#uses=1]
1023 define <4 x i32> @test_x86_avx2_psllv_d_const() {
1024 ; X86-AVX-LABEL: test_x86_avx2_psllv_d_const:
1026 ; X86-AVX-NEXT: vmovdqa {{.*#+}} xmm0 = [2,9,0,4294967295]
1027 ; X86-AVX-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1028 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1029 ; X86-AVX-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0 # encoding: [0xc4,0xe2,0x79,0x47,0x05,A,A,A,A]
1030 ; X86-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1031 ; X86-AVX-NEXT: vmovdqa {{.*#+}} xmm1 = [1,1,1,4294967295]
1032 ; X86-AVX-NEXT: # encoding: [0xc5,0xf9,0x6f,0x0d,A,A,A,A]
1033 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1034 ; X86-AVX-NEXT: vpsllvd %xmm1, %xmm1, %xmm1 # encoding: [0xc4,0xe2,0x71,0x47,0xc9]
1035 ; X86-AVX-NEXT: vpaddd %xmm1, %xmm0, %xmm0 # encoding: [0xc5,0xf9,0xfe,0xc1]
1036 ; X86-AVX-NEXT: retl # encoding: [0xc3]
1038 ; X86-AVX512VL-LABEL: test_x86_avx2_psllv_d_const:
1039 ; X86-AVX512VL: # %bb.0:
1040 ; X86-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0 # EVEX TO VEX Compression xmm0 = [2,9,0,4294967295]
1041 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1042 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1043 ; X86-AVX512VL-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x47,0x05,A,A,A,A]
1044 ; X86-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1045 ; X86-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1 # EVEX TO VEX Compression xmm1 = [1,1,1,4294967295]
1046 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xf9,0x6f,0x0d,A,A,A,A]
1047 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1048 ; X86-AVX512VL-NEXT: vpsllvd %xmm1, %xmm1, %xmm1 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x71,0x47,0xc9]
1049 ; X86-AVX512VL-NEXT: vpaddd %xmm1, %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc5,0xf9,0xfe,0xc1]
1050 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
1052 ; X64-AVX-LABEL: test_x86_avx2_psllv_d_const:
1054 ; X64-AVX-NEXT: vmovdqa {{.*#+}} xmm0 = [2,9,0,4294967295]
1055 ; X64-AVX-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1056 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1057 ; X64-AVX-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0 # encoding: [0xc4,0xe2,0x79,0x47,0x05,A,A,A,A]
1058 ; X64-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1059 ; X64-AVX-NEXT: vmovdqa {{.*#+}} xmm1 = [1,1,1,4294967295]
1060 ; X64-AVX-NEXT: # encoding: [0xc5,0xf9,0x6f,0x0d,A,A,A,A]
1061 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1062 ; X64-AVX-NEXT: vpsllvd %xmm1, %xmm1, %xmm1 # encoding: [0xc4,0xe2,0x71,0x47,0xc9]
1063 ; X64-AVX-NEXT: vpaddd %xmm1, %xmm0, %xmm0 # encoding: [0xc5,0xf9,0xfe,0xc1]
1064 ; X64-AVX-NEXT: retq # encoding: [0xc3]
1066 ; X64-AVX512VL-LABEL: test_x86_avx2_psllv_d_const:
1067 ; X64-AVX512VL: # %bb.0:
1068 ; X64-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0 # EVEX TO VEX Compression xmm0 = [2,9,0,4294967295]
1069 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1070 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1071 ; X64-AVX512VL-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x47,0x05,A,A,A,A]
1072 ; X64-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1073 ; X64-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1 # EVEX TO VEX Compression xmm1 = [1,1,1,4294967295]
1074 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xf9,0x6f,0x0d,A,A,A,A]
1075 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1076 ; X64-AVX512VL-NEXT: vpsllvd %xmm1, %xmm1, %xmm1 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x71,0x47,0xc9]
1077 ; X64-AVX512VL-NEXT: vpaddd %xmm1, %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc5,0xf9,0xfe,0xc1]
1078 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
1079 %res0 = call <4 x i32> @llvm.x86.avx2.psllv.d(<4 x i32> <i32 2, i32 9, i32 0, i32 -1>, <4 x i32> <i32 1, i32 0, i32 33, i32 -1>)
1080 %res1 = call <4 x i32> @llvm.x86.avx2.psllv.d(<4 x i32> <i32 1, i32 1, i32 1, i32 -1>, <4 x i32> <i32 1, i32 1, i32 1, i32 -1>)
1081 %res2 = add <4 x i32> %res0, %res1
1084 declare <4 x i32> @llvm.x86.avx2.psllv.d(<4 x i32>, <4 x i32>) nounwind readnone
1087 define <8 x i32> @test_x86_avx2_psllv_d_256(<8 x i32> %a0, <8 x i32> %a1) {
1088 ; AVX2-LABEL: test_x86_avx2_psllv_d_256:
1090 ; AVX2-NEXT: vpsllvd %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x47,0xc1]
1091 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1093 ; AVX512VL-LABEL: test_x86_avx2_psllv_d_256:
1094 ; AVX512VL: # %bb.0:
1095 ; AVX512VL-NEXT: vpsllvd %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x47,0xc1]
1096 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1097 %res = call <8 x i32> @llvm.x86.avx2.psllv.d.256(<8 x i32> %a0, <8 x i32> %a1) ; <<8 x i32>> [#uses=1]
1101 define <8 x i32> @test_x86_avx2_psllv_d_256_const() {
1102 ; X86-AVX-LABEL: test_x86_avx2_psllv_d_256_const:
1104 ; X86-AVX-NEXT: vmovdqa {{.*#+}} ymm0 = [2,9,0,4294967295,3,7,4294967295,0]
1105 ; X86-AVX-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1106 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1107 ; X86-AVX-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x47,0x05,A,A,A,A]
1108 ; X86-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1109 ; X86-AVX-NEXT: vmovdqa {{.*#+}} ymm1 = [4,4,4,4,4,4,4,4294967295]
1110 ; X86-AVX-NEXT: # encoding: [0xc5,0xfd,0x6f,0x0d,A,A,A,A]
1111 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1112 ; X86-AVX-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}, %ymm1, %ymm1 # encoding: [0xc4,0xe2,0x75,0x47,0x0d,A,A,A,A]
1113 ; X86-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1114 ; X86-AVX-NEXT: vpaddd %ymm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xfe,0xc1]
1115 ; X86-AVX-NEXT: retl # encoding: [0xc3]
1117 ; X86-AVX512VL-LABEL: test_x86_avx2_psllv_d_256_const:
1118 ; X86-AVX512VL: # %bb.0:
1119 ; X86-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0 # EVEX TO VEX Compression ymm0 = [2,9,0,4294967295,3,7,4294967295,0]
1120 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1121 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1122 ; X86-AVX512VL-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x47,0x05,A,A,A,A]
1123 ; X86-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1124 ; X86-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}, %ymm1 # EVEX TO VEX Compression ymm1 = [4,4,4,4,4,4,4,4294967295]
1125 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xfd,0x6f,0x0d,A,A,A,A]
1126 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1127 ; X86-AVX512VL-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}, %ymm1, %ymm1 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x75,0x47,0x0d,A,A,A,A]
1128 ; X86-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1129 ; X86-AVX512VL-NEXT: vpaddd %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xfe,0xc1]
1130 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
1132 ; X64-AVX-LABEL: test_x86_avx2_psllv_d_256_const:
1134 ; X64-AVX-NEXT: vmovdqa {{.*#+}} ymm0 = [2,9,0,4294967295,3,7,4294967295,0]
1135 ; X64-AVX-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1136 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1137 ; X64-AVX-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x47,0x05,A,A,A,A]
1138 ; X64-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1139 ; X64-AVX-NEXT: vmovdqa {{.*#+}} ymm1 = [4,4,4,4,4,4,4,4294967295]
1140 ; X64-AVX-NEXT: # encoding: [0xc5,0xfd,0x6f,0x0d,A,A,A,A]
1141 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1142 ; X64-AVX-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm1 # encoding: [0xc4,0xe2,0x75,0x47,0x0d,A,A,A,A]
1143 ; X64-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1144 ; X64-AVX-NEXT: vpaddd %ymm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xfe,0xc1]
1145 ; X64-AVX-NEXT: retq # encoding: [0xc3]
1147 ; X64-AVX512VL-LABEL: test_x86_avx2_psllv_d_256_const:
1148 ; X64-AVX512VL: # %bb.0:
1149 ; X64-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0 # EVEX TO VEX Compression ymm0 = [2,9,0,4294967295,3,7,4294967295,0]
1150 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1151 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1152 ; X64-AVX512VL-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x47,0x05,A,A,A,A]
1153 ; X64-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1154 ; X64-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1 # EVEX TO VEX Compression ymm1 = [4,4,4,4,4,4,4,4294967295]
1155 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xfd,0x6f,0x0d,A,A,A,A]
1156 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1157 ; X64-AVX512VL-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm1 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x75,0x47,0x0d,A,A,A,A]
1158 ; X64-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1159 ; X64-AVX512VL-NEXT: vpaddd %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xfe,0xc1]
1160 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
1161 %res0 = call <8 x i32> @llvm.x86.avx2.psllv.d.256(<8 x i32> <i32 2, i32 9, i32 0, i32 -1, i32 3, i32 7, i32 -1, i32 0>, <8 x i32> <i32 1, i32 0, i32 33, i32 -1,i32 2, i32 0, i32 34, i32 -2>)
1162 %res1 = call <8 x i32> @llvm.x86.avx2.psllv.d.256(<8 x i32> <i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 -1>, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 -1>)
1163 %res2 = add <8 x i32> %res0, %res1
1166 declare <8 x i32> @llvm.x86.avx2.psllv.d.256(<8 x i32>, <8 x i32>) nounwind readnone
1169 define <2 x i64> @test_x86_avx2_psllv_q(<2 x i64> %a0, <2 x i64> %a1) {
1170 ; AVX2-LABEL: test_x86_avx2_psllv_q:
1172 ; AVX2-NEXT: vpsllvq %xmm1, %xmm0, %xmm0 # encoding: [0xc4,0xe2,0xf9,0x47,0xc1]
1173 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1175 ; AVX512VL-LABEL: test_x86_avx2_psllv_q:
1176 ; AVX512VL: # %bb.0:
1177 ; AVX512VL-NEXT: vpsllvq %xmm1, %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0xf9,0x47,0xc1]
1178 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1179 %res = call <2 x i64> @llvm.x86.avx2.psllv.q(<2 x i64> %a0, <2 x i64> %a1) ; <<2 x i64>> [#uses=1]
1182 define <2 x i64> @test_x86_avx2_psllv_q_const() {
1183 ; X86-AVX-LABEL: test_x86_avx2_psllv_q_const:
1185 ; X86-AVX-NEXT: vmovdqa {{.*#+}} xmm0 = [4,0,4294967295,4294967295]
1186 ; X86-AVX-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1187 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1188 ; X86-AVX-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0 # encoding: [0xc4,0xe2,0xf9,0x47,0x05,A,A,A,A]
1189 ; X86-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1190 ; X86-AVX-NEXT: retl # encoding: [0xc3]
1192 ; X86-AVX512VL-LABEL: test_x86_avx2_psllv_q_const:
1193 ; X86-AVX512VL: # %bb.0:
1194 ; X86-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0 # EVEX TO VEX Compression xmm0 = [4,0,4294967295,4294967295]
1195 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1196 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1197 ; X86-AVX512VL-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0xf9,0x47,0x05,A,A,A,A]
1198 ; X86-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1199 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
1201 ; X64-AVX-LABEL: test_x86_avx2_psllv_q_const:
1203 ; X64-AVX-NEXT: vmovdqa {{.*#+}} xmm0 = [4,18446744073709551615]
1204 ; X64-AVX-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1205 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1206 ; X64-AVX-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0 # encoding: [0xc4,0xe2,0xf9,0x47,0x05,A,A,A,A]
1207 ; X64-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1208 ; X64-AVX-NEXT: retq # encoding: [0xc3]
1210 ; X64-AVX512VL-LABEL: test_x86_avx2_psllv_q_const:
1211 ; X64-AVX512VL: # %bb.0:
1212 ; X64-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0 # EVEX TO VEX Compression xmm0 = [4,18446744073709551615]
1213 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1214 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1215 ; X64-AVX512VL-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0xf9,0x47,0x05,A,A,A,A]
1216 ; X64-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1217 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
1218 %res = call <2 x i64> @llvm.x86.avx2.psllv.q(<2 x i64> <i64 4, i64 -1>, <2 x i64> <i64 1, i64 -1>)
1221 declare <2 x i64> @llvm.x86.avx2.psllv.q(<2 x i64>, <2 x i64>) nounwind readnone
1224 define <4 x i64> @test_x86_avx2_psllv_q_256(<4 x i64> %a0, <4 x i64> %a1) {
1225 ; AVX2-LABEL: test_x86_avx2_psllv_q_256:
1227 ; AVX2-NEXT: vpsllvq %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0xfd,0x47,0xc1]
1228 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1230 ; AVX512VL-LABEL: test_x86_avx2_psllv_q_256:
1231 ; AVX512VL: # %bb.0:
1232 ; AVX512VL-NEXT: vpsllvq %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0xfd,0x47,0xc1]
1233 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1234 %res = call <4 x i64> @llvm.x86.avx2.psllv.q.256(<4 x i64> %a0, <4 x i64> %a1) ; <<4 x i64>> [#uses=1]
1238 define <4 x i64> @test_x86_avx2_psllv_q_256_const() {
1239 ; X86-AVX-LABEL: test_x86_avx2_psllv_q_256_const:
1241 ; X86-AVX-NEXT: vmovdqa {{.*#+}} ymm0 = [4,0,4,0,4,0,4294967295,4294967295]
1242 ; X86-AVX-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1243 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1244 ; X86-AVX-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0xfd,0x47,0x05,A,A,A,A]
1245 ; X86-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1246 ; X86-AVX-NEXT: retl # encoding: [0xc3]
1248 ; X86-AVX512VL-LABEL: test_x86_avx2_psllv_q_256_const:
1249 ; X86-AVX512VL: # %bb.0:
1250 ; X86-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0 # EVEX TO VEX Compression ymm0 = [4,0,4,0,4,0,4294967295,4294967295]
1251 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1252 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1253 ; X86-AVX512VL-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0xfd,0x47,0x05,A,A,A,A]
1254 ; X86-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1255 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
1257 ; X64-AVX-LABEL: test_x86_avx2_psllv_q_256_const:
1259 ; X64-AVX-NEXT: vmovdqa {{.*#+}} ymm0 = [4,4,4,18446744073709551615]
1260 ; X64-AVX-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1261 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1262 ; X64-AVX-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0 # encoding: [0xc4,0xe2,0xfd,0x47,0x05,A,A,A,A]
1263 ; X64-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1264 ; X64-AVX-NEXT: retq # encoding: [0xc3]
1266 ; X64-AVX512VL-LABEL: test_x86_avx2_psllv_q_256_const:
1267 ; X64-AVX512VL: # %bb.0:
1268 ; X64-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0 # EVEX TO VEX Compression ymm0 = [4,4,4,18446744073709551615]
1269 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1270 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1271 ; X64-AVX512VL-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0xfd,0x47,0x05,A,A,A,A]
1272 ; X64-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1273 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
1274 %res = call <4 x i64> @llvm.x86.avx2.psllv.q.256(<4 x i64> <i64 4, i64 4, i64 4, i64 -1>, <4 x i64> <i64 1, i64 1, i64 1, i64 -1>)
1277 declare <4 x i64> @llvm.x86.avx2.psllv.q.256(<4 x i64>, <4 x i64>) nounwind readnone
1280 define <4 x i32> @test_x86_avx2_psrlv_d(<4 x i32> %a0, <4 x i32> %a1) {
1281 ; AVX2-LABEL: test_x86_avx2_psrlv_d:
1283 ; AVX2-NEXT: vpsrlvd %xmm1, %xmm0, %xmm0 # encoding: [0xc4,0xe2,0x79,0x45,0xc1]
1284 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1286 ; AVX512VL-LABEL: test_x86_avx2_psrlv_d:
1287 ; AVX512VL: # %bb.0:
1288 ; AVX512VL-NEXT: vpsrlvd %xmm1, %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x45,0xc1]
1289 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1290 %res = call <4 x i32> @llvm.x86.avx2.psrlv.d(<4 x i32> %a0, <4 x i32> %a1) ; <<4 x i32>> [#uses=1]
1294 define <4 x i32> @test_x86_avx2_psrlv_d_const() {
1295 ; X86-AVX-LABEL: test_x86_avx2_psrlv_d_const:
1297 ; X86-AVX-NEXT: vmovdqa {{.*#+}} xmm0 = [2,9,0,4294967295]
1298 ; X86-AVX-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1299 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1300 ; X86-AVX-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0 # encoding: [0xc4,0xe2,0x79,0x45,0x05,A,A,A,A]
1301 ; X86-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1302 ; X86-AVX-NEXT: vmovdqa {{.*#+}} xmm1 = [4,4,4,4294967295]
1303 ; X86-AVX-NEXT: # encoding: [0xc5,0xf9,0x6f,0x0d,A,A,A,A]
1304 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1305 ; X86-AVX-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1, %xmm1 # encoding: [0xc4,0xe2,0x71,0x45,0x0d,A,A,A,A]
1306 ; X86-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1307 ; X86-AVX-NEXT: vpaddd %xmm1, %xmm0, %xmm0 # encoding: [0xc5,0xf9,0xfe,0xc1]
1308 ; X86-AVX-NEXT: retl # encoding: [0xc3]
1310 ; X86-AVX512VL-LABEL: test_x86_avx2_psrlv_d_const:
1311 ; X86-AVX512VL: # %bb.0:
1312 ; X86-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0 # EVEX TO VEX Compression xmm0 = [2,9,0,4294967295]
1313 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1314 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1315 ; X86-AVX512VL-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x45,0x05,A,A,A,A]
1316 ; X86-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1317 ; X86-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1 # EVEX TO VEX Compression xmm1 = [4,4,4,4294967295]
1318 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xf9,0x6f,0x0d,A,A,A,A]
1319 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1320 ; X86-AVX512VL-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1, %xmm1 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x71,0x45,0x0d,A,A,A,A]
1321 ; X86-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1322 ; X86-AVX512VL-NEXT: vpaddd %xmm1, %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc5,0xf9,0xfe,0xc1]
1323 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
1325 ; X64-AVX-LABEL: test_x86_avx2_psrlv_d_const:
1327 ; X64-AVX-NEXT: vmovdqa {{.*#+}} xmm0 = [2,9,0,4294967295]
1328 ; X64-AVX-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1329 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1330 ; X64-AVX-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0 # encoding: [0xc4,0xe2,0x79,0x45,0x05,A,A,A,A]
1331 ; X64-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1332 ; X64-AVX-NEXT: vmovdqa {{.*#+}} xmm1 = [4,4,4,4294967295]
1333 ; X64-AVX-NEXT: # encoding: [0xc5,0xf9,0x6f,0x0d,A,A,A,A]
1334 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1335 ; X64-AVX-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1 # encoding: [0xc4,0xe2,0x71,0x45,0x0d,A,A,A,A]
1336 ; X64-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1337 ; X64-AVX-NEXT: vpaddd %xmm1, %xmm0, %xmm0 # encoding: [0xc5,0xf9,0xfe,0xc1]
1338 ; X64-AVX-NEXT: retq # encoding: [0xc3]
1340 ; X64-AVX512VL-LABEL: test_x86_avx2_psrlv_d_const:
1341 ; X64-AVX512VL: # %bb.0:
1342 ; X64-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0 # EVEX TO VEX Compression xmm0 = [2,9,0,4294967295]
1343 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1344 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1345 ; X64-AVX512VL-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x45,0x05,A,A,A,A]
1346 ; X64-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1347 ; X64-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1 # EVEX TO VEX Compression xmm1 = [4,4,4,4294967295]
1348 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xf9,0x6f,0x0d,A,A,A,A]
1349 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1350 ; X64-AVX512VL-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x71,0x45,0x0d,A,A,A,A]
1351 ; X64-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1352 ; X64-AVX512VL-NEXT: vpaddd %xmm1, %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc5,0xf9,0xfe,0xc1]
1353 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
1354 %res0 = call <4 x i32> @llvm.x86.avx2.psrlv.d(<4 x i32> <i32 2, i32 9, i32 0, i32 -1>, <4 x i32> <i32 1, i32 0, i32 33, i32 -1>)
1355 %res1 = call <4 x i32> @llvm.x86.avx2.psrlv.d(<4 x i32> <i32 4, i32 4, i32 4, i32 -1>, <4 x i32> <i32 1, i32 1, i32 1, i32 -1>)
1356 %res2 = add <4 x i32> %res0, %res1
1359 declare <4 x i32> @llvm.x86.avx2.psrlv.d(<4 x i32>, <4 x i32>) nounwind readnone
1362 define <8 x i32> @test_x86_avx2_psrlv_d_256(<8 x i32> %a0, <8 x i32> %a1) {
1363 ; AVX2-LABEL: test_x86_avx2_psrlv_d_256:
1365 ; AVX2-NEXT: vpsrlvd %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x45,0xc1]
1366 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1368 ; AVX512VL-LABEL: test_x86_avx2_psrlv_d_256:
1369 ; AVX512VL: # %bb.0:
1370 ; AVX512VL-NEXT: vpsrlvd %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x45,0xc1]
1371 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1372 %res = call <8 x i32> @llvm.x86.avx2.psrlv.d.256(<8 x i32> %a0, <8 x i32> %a1) ; <<8 x i32>> [#uses=1]
1376 define <8 x i32> @test_x86_avx2_psrlv_d_256_const() {
1377 ; X86-AVX-LABEL: test_x86_avx2_psrlv_d_256_const:
1379 ; X86-AVX-NEXT: vmovdqa {{.*#+}} ymm0 = [2,9,0,4294967295,3,7,4294967295,0]
1380 ; X86-AVX-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1381 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1382 ; X86-AVX-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x45,0x05,A,A,A,A]
1383 ; X86-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1384 ; X86-AVX-NEXT: vmovdqa {{.*#+}} ymm1 = [4,4,4,4,4,4,4,4294967295]
1385 ; X86-AVX-NEXT: # encoding: [0xc5,0xfd,0x6f,0x0d,A,A,A,A]
1386 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1387 ; X86-AVX-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}, %ymm1, %ymm1 # encoding: [0xc4,0xe2,0x75,0x45,0x0d,A,A,A,A]
1388 ; X86-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1389 ; X86-AVX-NEXT: vpaddd %ymm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xfe,0xc1]
1390 ; X86-AVX-NEXT: retl # encoding: [0xc3]
1392 ; X86-AVX512VL-LABEL: test_x86_avx2_psrlv_d_256_const:
1393 ; X86-AVX512VL: # %bb.0:
1394 ; X86-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0 # EVEX TO VEX Compression ymm0 = [2,9,0,4294967295,3,7,4294967295,0]
1395 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1396 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1397 ; X86-AVX512VL-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x45,0x05,A,A,A,A]
1398 ; X86-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1399 ; X86-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}, %ymm1 # EVEX TO VEX Compression ymm1 = [4,4,4,4,4,4,4,4294967295]
1400 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xfd,0x6f,0x0d,A,A,A,A]
1401 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1402 ; X86-AVX512VL-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}, %ymm1, %ymm1 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x75,0x45,0x0d,A,A,A,A]
1403 ; X86-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1404 ; X86-AVX512VL-NEXT: vpaddd %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xfe,0xc1]
1405 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
1407 ; X64-AVX-LABEL: test_x86_avx2_psrlv_d_256_const:
1409 ; X64-AVX-NEXT: vmovdqa {{.*#+}} ymm0 = [2,9,0,4294967295,3,7,4294967295,0]
1410 ; X64-AVX-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1411 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1412 ; X64-AVX-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x45,0x05,A,A,A,A]
1413 ; X64-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1414 ; X64-AVX-NEXT: vmovdqa {{.*#+}} ymm1 = [4,4,4,4,4,4,4,4294967295]
1415 ; X64-AVX-NEXT: # encoding: [0xc5,0xfd,0x6f,0x0d,A,A,A,A]
1416 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1417 ; X64-AVX-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm1 # encoding: [0xc4,0xe2,0x75,0x45,0x0d,A,A,A,A]
1418 ; X64-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1419 ; X64-AVX-NEXT: vpaddd %ymm1, %ymm0, %ymm0 # encoding: [0xc5,0xfd,0xfe,0xc1]
1420 ; X64-AVX-NEXT: retq # encoding: [0xc3]
1422 ; X64-AVX512VL-LABEL: test_x86_avx2_psrlv_d_256_const:
1423 ; X64-AVX512VL: # %bb.0:
1424 ; X64-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0 # EVEX TO VEX Compression ymm0 = [2,9,0,4294967295,3,7,4294967295,0]
1425 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1426 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1427 ; X64-AVX512VL-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x45,0x05,A,A,A,A]
1428 ; X64-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1429 ; X64-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1 # EVEX TO VEX Compression ymm1 = [4,4,4,4,4,4,4,4294967295]
1430 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xfd,0x6f,0x0d,A,A,A,A]
1431 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1432 ; X64-AVX512VL-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm1 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x75,0x45,0x0d,A,A,A,A]
1433 ; X64-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1434 ; X64-AVX512VL-NEXT: vpaddd %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc5,0xfd,0xfe,0xc1]
1435 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
1436 %res0 = call <8 x i32> @llvm.x86.avx2.psrlv.d.256(<8 x i32> <i32 2, i32 9, i32 0, i32 -1, i32 3, i32 7, i32 -1, i32 0>, <8 x i32> <i32 1, i32 0, i32 33, i32 -1,i32 2, i32 0, i32 34, i32 -2>)
1437 %res1 = call <8 x i32> @llvm.x86.avx2.psrlv.d.256(<8 x i32> <i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 -1>, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 -1>)
1438 %res2 = add <8 x i32> %res0, %res1
1441 declare <8 x i32> @llvm.x86.avx2.psrlv.d.256(<8 x i32>, <8 x i32>) nounwind readnone
1444 define <2 x i64> @test_x86_avx2_psrlv_q(<2 x i64> %a0, <2 x i64> %a1) {
1445 ; AVX2-LABEL: test_x86_avx2_psrlv_q:
1447 ; AVX2-NEXT: vpsrlvq %xmm1, %xmm0, %xmm0 # encoding: [0xc4,0xe2,0xf9,0x45,0xc1]
1448 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1450 ; AVX512VL-LABEL: test_x86_avx2_psrlv_q:
1451 ; AVX512VL: # %bb.0:
1452 ; AVX512VL-NEXT: vpsrlvq %xmm1, %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0xf9,0x45,0xc1]
1453 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1454 %res = call <2 x i64> @llvm.x86.avx2.psrlv.q(<2 x i64> %a0, <2 x i64> %a1) ; <<2 x i64>> [#uses=1]
1458 define <2 x i64> @test_x86_avx2_psrlv_q_const() {
1459 ; X86-AVX-LABEL: test_x86_avx2_psrlv_q_const:
1461 ; X86-AVX-NEXT: vmovdqa {{.*#+}} xmm0 = [4,0,4,0]
1462 ; X86-AVX-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1463 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1464 ; X86-AVX-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0 # encoding: [0xc4,0xe2,0xf9,0x45,0x05,A,A,A,A]
1465 ; X86-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1466 ; X86-AVX-NEXT: retl # encoding: [0xc3]
1468 ; X86-AVX512VL-LABEL: test_x86_avx2_psrlv_q_const:
1469 ; X86-AVX512VL: # %bb.0:
1470 ; X86-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0 # EVEX TO VEX Compression xmm0 = [4,0,4,0]
1471 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1472 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1473 ; X86-AVX512VL-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0xf9,0x45,0x05,A,A,A,A]
1474 ; X86-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1475 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
1477 ; X64-AVX-LABEL: test_x86_avx2_psrlv_q_const:
1479 ; X64-AVX-NEXT: vmovdqa {{.*#+}} xmm0 = [4,4]
1480 ; X64-AVX-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1481 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1482 ; X64-AVX-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0 # encoding: [0xc4,0xe2,0xf9,0x45,0x05,A,A,A,A]
1483 ; X64-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1484 ; X64-AVX-NEXT: retq # encoding: [0xc3]
1486 ; X64-AVX512VL-LABEL: test_x86_avx2_psrlv_q_const:
1487 ; X64-AVX512VL: # %bb.0:
1488 ; X64-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0 # EVEX TO VEX Compression xmm0 = [4,4]
1489 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1490 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1491 ; X64-AVX512VL-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0xf9,0x45,0x05,A,A,A,A]
1492 ; X64-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1493 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
1494 %res = call <2 x i64> @llvm.x86.avx2.psrlv.q(<2 x i64> <i64 4, i64 4>, <2 x i64> <i64 1, i64 -1>)
1497 declare <2 x i64> @llvm.x86.avx2.psrlv.q(<2 x i64>, <2 x i64>) nounwind readnone
1500 define <4 x i64> @test_x86_avx2_psrlv_q_256(<4 x i64> %a0, <4 x i64> %a1) {
1501 ; AVX2-LABEL: test_x86_avx2_psrlv_q_256:
1503 ; AVX2-NEXT: vpsrlvq %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0xfd,0x45,0xc1]
1504 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1506 ; AVX512VL-LABEL: test_x86_avx2_psrlv_q_256:
1507 ; AVX512VL: # %bb.0:
1508 ; AVX512VL-NEXT: vpsrlvq %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0xfd,0x45,0xc1]
1509 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1510 %res = call <4 x i64> @llvm.x86.avx2.psrlv.q.256(<4 x i64> %a0, <4 x i64> %a1) ; <<4 x i64>> [#uses=1]
1515 define <4 x i64> @test_x86_avx2_psrlv_q_256_const() {
1516 ; X86-AVX-LABEL: test_x86_avx2_psrlv_q_256_const:
1518 ; X86-AVX-NEXT: vmovdqa {{.*#+}} ymm0 = [4,0,4,0,4,0,4,0]
1519 ; X86-AVX-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1520 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1521 ; X86-AVX-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0xfd,0x45,0x05,A,A,A,A]
1522 ; X86-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1523 ; X86-AVX-NEXT: retl # encoding: [0xc3]
1525 ; X86-AVX512VL-LABEL: test_x86_avx2_psrlv_q_256_const:
1526 ; X86-AVX512VL: # %bb.0:
1527 ; X86-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0 # EVEX TO VEX Compression ymm0 = [4,0,4,0,4,0,4,0]
1528 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1529 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1530 ; X86-AVX512VL-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0xfd,0x45,0x05,A,A,A,A]
1531 ; X86-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1532 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
1534 ; X64-AVX-LABEL: test_x86_avx2_psrlv_q_256_const:
1536 ; X64-AVX-NEXT: vpbroadcastq {{.*#+}} ymm0 = [4,4,4,4]
1537 ; X64-AVX-NEXT: # encoding: [0xc4,0xe2,0x7d,0x59,0x05,A,A,A,A]
1538 ; X64-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1539 ; X64-AVX-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0 # encoding: [0xc4,0xe2,0xfd,0x45,0x05,A,A,A,A]
1540 ; X64-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1541 ; X64-AVX-NEXT: retq # encoding: [0xc3]
1543 ; X64-AVX512VL-LABEL: test_x86_avx2_psrlv_q_256_const:
1544 ; X64-AVX512VL: # %bb.0:
1545 ; X64-AVX512VL-NEXT: vpbroadcastq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0 # EVEX TO VEX Compression ymm0 = [4,4,4,4]
1546 ; X64-AVX512VL-NEXT: # encoding: [0xc4,0xe2,0x7d,0x59,0x05,A,A,A,A]
1547 ; X64-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1548 ; X64-AVX512VL-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0xfd,0x45,0x05,A,A,A,A]
1549 ; X64-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1550 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
1551 %res = call <4 x i64> @llvm.x86.avx2.psrlv.q.256(<4 x i64> <i64 4, i64 4, i64 4, i64 4>, <4 x i64> <i64 1, i64 1, i64 1, i64 -1>)
1554 declare <4 x i64> @llvm.x86.avx2.psrlv.q.256(<4 x i64>, <4 x i64>) nounwind readnone
1557 define <4 x i32> @test_x86_avx2_psrav_d(<4 x i32> %a0, <4 x i32> %a1) {
1558 ; AVX2-LABEL: test_x86_avx2_psrav_d:
1560 ; AVX2-NEXT: vpsravd %xmm1, %xmm0, %xmm0 # encoding: [0xc4,0xe2,0x79,0x46,0xc1]
1561 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1563 ; AVX512VL-LABEL: test_x86_avx2_psrav_d:
1564 ; AVX512VL: # %bb.0:
1565 ; AVX512VL-NEXT: vpsravd %xmm1, %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x46,0xc1]
1566 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1567 %res = call <4 x i32> @llvm.x86.avx2.psrav.d(<4 x i32> %a0, <4 x i32> %a1) ; <<4 x i32>> [#uses=1]
1571 define <4 x i32> @test_x86_avx2_psrav_d_const() {
1572 ; X86-AVX-LABEL: test_x86_avx2_psrav_d_const:
1574 ; X86-AVX-NEXT: vmovdqa {{.*#+}} xmm0 = [2,9,4294967284,23]
1575 ; X86-AVX-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1576 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1577 ; X86-AVX-NEXT: vpsravd {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0 # encoding: [0xc4,0xe2,0x79,0x46,0x05,A,A,A,A]
1578 ; X86-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1579 ; X86-AVX-NEXT: retl # encoding: [0xc3]
1581 ; X86-AVX512VL-LABEL: test_x86_avx2_psrav_d_const:
1582 ; X86-AVX512VL: # %bb.0:
1583 ; X86-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0 # EVEX TO VEX Compression xmm0 = [2,9,4294967284,23]
1584 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1585 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1586 ; X86-AVX512VL-NEXT: vpsravd {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x46,0x05,A,A,A,A]
1587 ; X86-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1588 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
1590 ; X64-AVX-LABEL: test_x86_avx2_psrav_d_const:
1592 ; X64-AVX-NEXT: vmovdqa {{.*#+}} xmm0 = [2,9,4294967284,23]
1593 ; X64-AVX-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1594 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1595 ; X64-AVX-NEXT: vpsravd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0 # encoding: [0xc4,0xe2,0x79,0x46,0x05,A,A,A,A]
1596 ; X64-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1597 ; X64-AVX-NEXT: retq # encoding: [0xc3]
1599 ; X64-AVX512VL-LABEL: test_x86_avx2_psrav_d_const:
1600 ; X64-AVX512VL: # %bb.0:
1601 ; X64-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0 # EVEX TO VEX Compression xmm0 = [2,9,4294967284,23]
1602 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xf9,0x6f,0x05,A,A,A,A]
1603 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1604 ; X64-AVX512VL-NEXT: vpsravd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x46,0x05,A,A,A,A]
1605 ; X64-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1606 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
1607 %res = call <4 x i32> @llvm.x86.avx2.psrav.d(<4 x i32> <i32 2, i32 9, i32 -12, i32 23>, <4 x i32> <i32 1, i32 18, i32 35, i32 52>)
1610 declare <4 x i32> @llvm.x86.avx2.psrav.d(<4 x i32>, <4 x i32>) nounwind readnone
1612 define <8 x i32> @test_x86_avx2_psrav_d_256(<8 x i32> %a0, <8 x i32> %a1) {
1613 ; AVX2-LABEL: test_x86_avx2_psrav_d_256:
1615 ; AVX2-NEXT: vpsravd %ymm1, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x46,0xc1]
1616 ; AVX2-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1618 ; AVX512VL-LABEL: test_x86_avx2_psrav_d_256:
1619 ; AVX512VL: # %bb.0:
1620 ; AVX512VL-NEXT: vpsravd %ymm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x46,0xc1]
1621 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
1622 %res = call <8 x i32> @llvm.x86.avx2.psrav.d.256(<8 x i32> %a0, <8 x i32> %a1) ; <<8 x i32>> [#uses=1]
1626 define <8 x i32> @test_x86_avx2_psrav_d_256_const() {
1627 ; X86-AVX-LABEL: test_x86_avx2_psrav_d_256_const:
1629 ; X86-AVX-NEXT: vmovdqa {{.*#+}} ymm0 = [2,9,4294967284,23,4294967270,37,4294967256,51]
1630 ; X86-AVX-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1631 ; X86-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1632 ; X86-AVX-NEXT: vpsravd {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x46,0x05,A,A,A,A]
1633 ; X86-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1634 ; X86-AVX-NEXT: retl # encoding: [0xc3]
1636 ; X86-AVX512VL-LABEL: test_x86_avx2_psrav_d_256_const:
1637 ; X86-AVX512VL: # %bb.0:
1638 ; X86-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0 # EVEX TO VEX Compression ymm0 = [2,9,4294967284,23,4294967270,37,4294967256,51]
1639 ; X86-AVX512VL-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1640 ; X86-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1641 ; X86-AVX512VL-NEXT: vpsravd {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x46,0x05,A,A,A,A]
1642 ; X86-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}, kind: FK_Data_4
1643 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
1645 ; X64-AVX-LABEL: test_x86_avx2_psrav_d_256_const:
1647 ; X64-AVX-NEXT: vmovdqa {{.*#+}} ymm0 = [2,9,4294967284,23,4294967270,37,4294967256,51]
1648 ; X64-AVX-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1649 ; X64-AVX-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1650 ; X64-AVX-NEXT: vpsravd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x46,0x05,A,A,A,A]
1651 ; X64-AVX-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1652 ; X64-AVX-NEXT: retq # encoding: [0xc3]
1654 ; X64-AVX512VL-LABEL: test_x86_avx2_psrav_d_256_const:
1655 ; X64-AVX512VL: # %bb.0:
1656 ; X64-AVX512VL-NEXT: vmovdqa {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0 # EVEX TO VEX Compression ymm0 = [2,9,4294967284,23,4294967270,37,4294967256,51]
1657 ; X64-AVX512VL-NEXT: # encoding: [0xc5,0xfd,0x6f,0x05,A,A,A,A]
1658 ; X64-AVX512VL-NEXT: # fixup A - offset: 4, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1659 ; X64-AVX512VL-NEXT: vpsravd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x46,0x05,A,A,A,A]
1660 ; X64-AVX512VL-NEXT: # fixup A - offset: 5, value: {{\.?LCPI[0-9]+_[0-9]+}}-4, kind: reloc_riprel_4byte
1661 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
1662 %res = call <8 x i32> @llvm.x86.avx2.psrav.d.256(<8 x i32> <i32 2, i32 9, i32 -12, i32 23, i32 -26, i32 37, i32 -40, i32 51>, <8 x i32> <i32 1, i32 18, i32 35, i32 52, i32 69, i32 15, i32 32, i32 49>)
1665 declare <8 x i32> @llvm.x86.avx2.psrav.d.256(<8 x i32>, <8 x i32>) nounwind readnone
1667 define <2 x double> @test_x86_avx2_gather_d_pd(<2 x double> %a0, i8* %a1, <4 x i32> %idx, <2 x double> %mask) {
1668 ; X86-LABEL: test_x86_avx2_gather_d_pd:
1670 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1671 ; X86-NEXT: vgatherdpd %xmm2, (%eax,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0xe9,0x92,0x04,0x48]
1672 ; X86-NEXT: retl # encoding: [0xc3]
1674 ; X64-LABEL: test_x86_avx2_gather_d_pd:
1676 ; X64-NEXT: vgatherdpd %xmm2, (%rdi,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0xe9,0x92,0x04,0x4f]
1677 ; X64-NEXT: retq # encoding: [0xc3]
1678 %res = call <2 x double> @llvm.x86.avx2.gather.d.pd(<2 x double> %a0,
1679 i8* %a1, <4 x i32> %idx, <2 x double> %mask, i8 2) ;
1680 ret <2 x double> %res
1682 declare <2 x double> @llvm.x86.avx2.gather.d.pd(<2 x double>, i8*,
1683 <4 x i32>, <2 x double>, i8) nounwind readonly
1685 define <4 x double> @test_x86_avx2_gather_d_pd_256(<4 x double> %a0, i8* %a1, <4 x i32> %idx, <4 x double> %mask) {
1686 ; X86-LABEL: test_x86_avx2_gather_d_pd_256:
1688 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1689 ; X86-NEXT: vgatherdpd %ymm2, (%eax,%xmm1,2), %ymm0 # encoding: [0xc4,0xe2,0xed,0x92,0x04,0x48]
1690 ; X86-NEXT: retl # encoding: [0xc3]
1692 ; X64-LABEL: test_x86_avx2_gather_d_pd_256:
1694 ; X64-NEXT: vgatherdpd %ymm2, (%rdi,%xmm1,2), %ymm0 # encoding: [0xc4,0xe2,0xed,0x92,0x04,0x4f]
1695 ; X64-NEXT: retq # encoding: [0xc3]
1696 %res = call <4 x double> @llvm.x86.avx2.gather.d.pd.256(<4 x double> %a0,
1697 i8* %a1, <4 x i32> %idx, <4 x double> %mask, i8 2) ;
1698 ret <4 x double> %res
1700 declare <4 x double> @llvm.x86.avx2.gather.d.pd.256(<4 x double>, i8*,
1701 <4 x i32>, <4 x double>, i8) nounwind readonly
1703 define <2 x double> @test_x86_avx2_gather_q_pd(<2 x double> %a0, i8* %a1, <2 x i64> %idx, <2 x double> %mask) {
1704 ; X86-LABEL: test_x86_avx2_gather_q_pd:
1706 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1707 ; X86-NEXT: vgatherqpd %xmm2, (%eax,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0xe9,0x93,0x04,0x48]
1708 ; X86-NEXT: retl # encoding: [0xc3]
1710 ; X64-LABEL: test_x86_avx2_gather_q_pd:
1712 ; X64-NEXT: vgatherqpd %xmm2, (%rdi,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0xe9,0x93,0x04,0x4f]
1713 ; X64-NEXT: retq # encoding: [0xc3]
1714 %res = call <2 x double> @llvm.x86.avx2.gather.q.pd(<2 x double> %a0,
1715 i8* %a1, <2 x i64> %idx, <2 x double> %mask, i8 2) ;
1716 ret <2 x double> %res
1718 declare <2 x double> @llvm.x86.avx2.gather.q.pd(<2 x double>, i8*,
1719 <2 x i64>, <2 x double>, i8) nounwind readonly
1721 define <4 x double> @test_x86_avx2_gather_q_pd_256(<4 x double> %a0, i8* %a1, <4 x i64> %idx, <4 x double> %mask) {
1722 ; X86-LABEL: test_x86_avx2_gather_q_pd_256:
1724 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1725 ; X86-NEXT: vgatherqpd %ymm2, (%eax,%ymm1,2), %ymm0 # encoding: [0xc4,0xe2,0xed,0x93,0x04,0x48]
1726 ; X86-NEXT: retl # encoding: [0xc3]
1728 ; X64-LABEL: test_x86_avx2_gather_q_pd_256:
1730 ; X64-NEXT: vgatherqpd %ymm2, (%rdi,%ymm1,2), %ymm0 # encoding: [0xc4,0xe2,0xed,0x93,0x04,0x4f]
1731 ; X64-NEXT: retq # encoding: [0xc3]
1732 %res = call <4 x double> @llvm.x86.avx2.gather.q.pd.256(<4 x double> %a0,
1733 i8* %a1, <4 x i64> %idx, <4 x double> %mask, i8 2) ;
1734 ret <4 x double> %res
1736 declare <4 x double> @llvm.x86.avx2.gather.q.pd.256(<4 x double>, i8*,
1737 <4 x i64>, <4 x double>, i8) nounwind readonly
1739 define <4 x float> @test_x86_avx2_gather_d_ps(<4 x float> %a0, i8* %a1, <4 x i32> %idx, <4 x float> %mask) {
1740 ; X86-LABEL: test_x86_avx2_gather_d_ps:
1742 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1743 ; X86-NEXT: vgatherdps %xmm2, (%eax,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0x69,0x92,0x04,0x48]
1744 ; X86-NEXT: retl # encoding: [0xc3]
1746 ; X64-LABEL: test_x86_avx2_gather_d_ps:
1748 ; X64-NEXT: vgatherdps %xmm2, (%rdi,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0x69,0x92,0x04,0x4f]
1749 ; X64-NEXT: retq # encoding: [0xc3]
1750 %res = call <4 x float> @llvm.x86.avx2.gather.d.ps(<4 x float> %a0,
1751 i8* %a1, <4 x i32> %idx, <4 x float> %mask, i8 2) ;
1752 ret <4 x float> %res
1754 declare <4 x float> @llvm.x86.avx2.gather.d.ps(<4 x float>, i8*,
1755 <4 x i32>, <4 x float>, i8) nounwind readonly
1757 define <8 x float> @test_x86_avx2_gather_d_ps_256(<8 x float> %a0, i8* %a1, <8 x i32> %idx, <8 x float> %mask) {
1758 ; X86-LABEL: test_x86_avx2_gather_d_ps_256:
1760 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1761 ; X86-NEXT: vgatherdps %ymm2, (%eax,%ymm1,2), %ymm0 # encoding: [0xc4,0xe2,0x6d,0x92,0x04,0x48]
1762 ; X86-NEXT: retl # encoding: [0xc3]
1764 ; X64-LABEL: test_x86_avx2_gather_d_ps_256:
1766 ; X64-NEXT: vgatherdps %ymm2, (%rdi,%ymm1,2), %ymm0 # encoding: [0xc4,0xe2,0x6d,0x92,0x04,0x4f]
1767 ; X64-NEXT: retq # encoding: [0xc3]
1768 %res = call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> %a0,
1769 i8* %a1, <8 x i32> %idx, <8 x float> %mask, i8 2) ;
1770 ret <8 x float> %res
1772 declare <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float>, i8*,
1773 <8 x i32>, <8 x float>, i8) nounwind readonly
1775 define <4 x float> @test_x86_avx2_gather_q_ps(<4 x float> %a0, i8* %a1, <2 x i64> %idx, <4 x float> %mask) {
1776 ; X86-LABEL: test_x86_avx2_gather_q_ps:
1778 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1779 ; X86-NEXT: vgatherqps %xmm2, (%eax,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0x69,0x93,0x04,0x48]
1780 ; X86-NEXT: retl # encoding: [0xc3]
1782 ; X64-LABEL: test_x86_avx2_gather_q_ps:
1784 ; X64-NEXT: vgatherqps %xmm2, (%rdi,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0x69,0x93,0x04,0x4f]
1785 ; X64-NEXT: retq # encoding: [0xc3]
1786 %res = call <4 x float> @llvm.x86.avx2.gather.q.ps(<4 x float> %a0,
1787 i8* %a1, <2 x i64> %idx, <4 x float> %mask, i8 2) ;
1788 ret <4 x float> %res
1790 declare <4 x float> @llvm.x86.avx2.gather.q.ps(<4 x float>, i8*,
1791 <2 x i64>, <4 x float>, i8) nounwind readonly
1793 define <4 x float> @test_x86_avx2_gather_q_ps_256(<4 x float> %a0, i8* %a1, <4 x i64> %idx, <4 x float> %mask) {
1794 ; X86-LABEL: test_x86_avx2_gather_q_ps_256:
1796 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1797 ; X86-NEXT: vgatherqps %xmm2, (%eax,%ymm1,2), %xmm0 # encoding: [0xc4,0xe2,0x6d,0x93,0x04,0x48]
1798 ; X86-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
1799 ; X86-NEXT: retl # encoding: [0xc3]
1801 ; X64-LABEL: test_x86_avx2_gather_q_ps_256:
1803 ; X64-NEXT: vgatherqps %xmm2, (%rdi,%ymm1,2), %xmm0 # encoding: [0xc4,0xe2,0x6d,0x93,0x04,0x4f]
1804 ; X64-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
1805 ; X64-NEXT: retq # encoding: [0xc3]
1806 %res = call <4 x float> @llvm.x86.avx2.gather.q.ps.256(<4 x float> %a0,
1807 i8* %a1, <4 x i64> %idx, <4 x float> %mask, i8 2) ;
1808 ret <4 x float> %res
1810 declare <4 x float> @llvm.x86.avx2.gather.q.ps.256(<4 x float>, i8*,
1811 <4 x i64>, <4 x float>, i8) nounwind readonly
1813 define <2 x i64> @test_x86_avx2_gather_d_q(<2 x i64> %a0, i8* %a1, <4 x i32> %idx, <2 x i64> %mask) {
1814 ; X86-LABEL: test_x86_avx2_gather_d_q:
1816 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1817 ; X86-NEXT: vpgatherdq %xmm2, (%eax,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0xe9,0x90,0x04,0x48]
1818 ; X86-NEXT: retl # encoding: [0xc3]
1820 ; X64-LABEL: test_x86_avx2_gather_d_q:
1822 ; X64-NEXT: vpgatherdq %xmm2, (%rdi,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0xe9,0x90,0x04,0x4f]
1823 ; X64-NEXT: retq # encoding: [0xc3]
1824 %res = call <2 x i64> @llvm.x86.avx2.gather.d.q(<2 x i64> %a0,
1825 i8* %a1, <4 x i32> %idx, <2 x i64> %mask, i8 2) ;
1828 declare <2 x i64> @llvm.x86.avx2.gather.d.q(<2 x i64>, i8*,
1829 <4 x i32>, <2 x i64>, i8) nounwind readonly
1831 define <4 x i64> @test_x86_avx2_gather_d_q_256(<4 x i64> %a0, i8* %a1, <4 x i32> %idx, <4 x i64> %mask) {
1832 ; X86-LABEL: test_x86_avx2_gather_d_q_256:
1834 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1835 ; X86-NEXT: vpgatherdq %ymm2, (%eax,%xmm1,2), %ymm0 # encoding: [0xc4,0xe2,0xed,0x90,0x04,0x48]
1836 ; X86-NEXT: retl # encoding: [0xc3]
1838 ; X64-LABEL: test_x86_avx2_gather_d_q_256:
1840 ; X64-NEXT: vpgatherdq %ymm2, (%rdi,%xmm1,2), %ymm0 # encoding: [0xc4,0xe2,0xed,0x90,0x04,0x4f]
1841 ; X64-NEXT: retq # encoding: [0xc3]
1842 %res = call <4 x i64> @llvm.x86.avx2.gather.d.q.256(<4 x i64> %a0,
1843 i8* %a1, <4 x i32> %idx, <4 x i64> %mask, i8 2) ;
1846 declare <4 x i64> @llvm.x86.avx2.gather.d.q.256(<4 x i64>, i8*,
1847 <4 x i32>, <4 x i64>, i8) nounwind readonly
1849 define <2 x i64> @test_x86_avx2_gather_q_q(<2 x i64> %a0, i8* %a1, <2 x i64> %idx, <2 x i64> %mask) {
1850 ; X86-LABEL: test_x86_avx2_gather_q_q:
1852 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1853 ; X86-NEXT: vpgatherqq %xmm2, (%eax,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0xe9,0x91,0x04,0x48]
1854 ; X86-NEXT: retl # encoding: [0xc3]
1856 ; X64-LABEL: test_x86_avx2_gather_q_q:
1858 ; X64-NEXT: vpgatherqq %xmm2, (%rdi,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0xe9,0x91,0x04,0x4f]
1859 ; X64-NEXT: retq # encoding: [0xc3]
1860 %res = call <2 x i64> @llvm.x86.avx2.gather.q.q(<2 x i64> %a0,
1861 i8* %a1, <2 x i64> %idx, <2 x i64> %mask, i8 2) ;
1864 declare <2 x i64> @llvm.x86.avx2.gather.q.q(<2 x i64>, i8*,
1865 <2 x i64>, <2 x i64>, i8) nounwind readonly
1867 define <4 x i64> @test_x86_avx2_gather_q_q_256(<4 x i64> %a0, i8* %a1, <4 x i64> %idx, <4 x i64> %mask) {
1868 ; X86-LABEL: test_x86_avx2_gather_q_q_256:
1870 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1871 ; X86-NEXT: vpgatherqq %ymm2, (%eax,%ymm1,2), %ymm0 # encoding: [0xc4,0xe2,0xed,0x91,0x04,0x48]
1872 ; X86-NEXT: retl # encoding: [0xc3]
1874 ; X64-LABEL: test_x86_avx2_gather_q_q_256:
1876 ; X64-NEXT: vpgatherqq %ymm2, (%rdi,%ymm1,2), %ymm0 # encoding: [0xc4,0xe2,0xed,0x91,0x04,0x4f]
1877 ; X64-NEXT: retq # encoding: [0xc3]
1878 %res = call <4 x i64> @llvm.x86.avx2.gather.q.q.256(<4 x i64> %a0,
1879 i8* %a1, <4 x i64> %idx, <4 x i64> %mask, i8 2) ;
1882 declare <4 x i64> @llvm.x86.avx2.gather.q.q.256(<4 x i64>, i8*,
1883 <4 x i64>, <4 x i64>, i8) nounwind readonly
1885 define <4 x i32> @test_x86_avx2_gather_d_d(<4 x i32> %a0, i8* %a1, <4 x i32> %idx, <4 x i32> %mask) {
1886 ; X86-LABEL: test_x86_avx2_gather_d_d:
1888 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1889 ; X86-NEXT: vpgatherdd %xmm2, (%eax,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0x69,0x90,0x04,0x48]
1890 ; X86-NEXT: retl # encoding: [0xc3]
1892 ; X64-LABEL: test_x86_avx2_gather_d_d:
1894 ; X64-NEXT: vpgatherdd %xmm2, (%rdi,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0x69,0x90,0x04,0x4f]
1895 ; X64-NEXT: retq # encoding: [0xc3]
1896 %res = call <4 x i32> @llvm.x86.avx2.gather.d.d(<4 x i32> %a0,
1897 i8* %a1, <4 x i32> %idx, <4 x i32> %mask, i8 2) ;
1900 declare <4 x i32> @llvm.x86.avx2.gather.d.d(<4 x i32>, i8*,
1901 <4 x i32>, <4 x i32>, i8) nounwind readonly
1903 define <8 x i32> @test_x86_avx2_gather_d_d_256(<8 x i32> %a0, i8* %a1, <8 x i32> %idx, <8 x i32> %mask) {
1904 ; X86-LABEL: test_x86_avx2_gather_d_d_256:
1906 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1907 ; X86-NEXT: vpgatherdd %ymm2, (%eax,%ymm1,2), %ymm0 # encoding: [0xc4,0xe2,0x6d,0x90,0x04,0x48]
1908 ; X86-NEXT: retl # encoding: [0xc3]
1910 ; X64-LABEL: test_x86_avx2_gather_d_d_256:
1912 ; X64-NEXT: vpgatherdd %ymm2, (%rdi,%ymm1,2), %ymm0 # encoding: [0xc4,0xe2,0x6d,0x90,0x04,0x4f]
1913 ; X64-NEXT: retq # encoding: [0xc3]
1914 %res = call <8 x i32> @llvm.x86.avx2.gather.d.d.256(<8 x i32> %a0,
1915 i8* %a1, <8 x i32> %idx, <8 x i32> %mask, i8 2) ;
1918 declare <8 x i32> @llvm.x86.avx2.gather.d.d.256(<8 x i32>, i8*,
1919 <8 x i32>, <8 x i32>, i8) nounwind readonly
1921 define <4 x i32> @test_x86_avx2_gather_q_d(<4 x i32> %a0, i8* %a1, <2 x i64> %idx, <4 x i32> %mask) {
1922 ; X86-LABEL: test_x86_avx2_gather_q_d:
1924 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1925 ; X86-NEXT: vpgatherqd %xmm2, (%eax,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0x69,0x91,0x04,0x48]
1926 ; X86-NEXT: retl # encoding: [0xc3]
1928 ; X64-LABEL: test_x86_avx2_gather_q_d:
1930 ; X64-NEXT: vpgatherqd %xmm2, (%rdi,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0x69,0x91,0x04,0x4f]
1931 ; X64-NEXT: retq # encoding: [0xc3]
1932 %res = call <4 x i32> @llvm.x86.avx2.gather.q.d(<4 x i32> %a0,
1933 i8* %a1, <2 x i64> %idx, <4 x i32> %mask, i8 2) ;
1936 declare <4 x i32> @llvm.x86.avx2.gather.q.d(<4 x i32>, i8*,
1937 <2 x i64>, <4 x i32>, i8) nounwind readonly
1939 define <4 x i32> @test_x86_avx2_gather_q_d_256(<4 x i32> %a0, i8* %a1, <4 x i64> %idx, <4 x i32> %mask) {
1940 ; X86-LABEL: test_x86_avx2_gather_q_d_256:
1942 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
1943 ; X86-NEXT: vpgatherqd %xmm2, (%eax,%ymm1,2), %xmm0 # encoding: [0xc4,0xe2,0x6d,0x91,0x04,0x48]
1944 ; X86-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
1945 ; X86-NEXT: retl # encoding: [0xc3]
1947 ; X64-LABEL: test_x86_avx2_gather_q_d_256:
1949 ; X64-NEXT: vpgatherqd %xmm2, (%rdi,%ymm1,2), %xmm0 # encoding: [0xc4,0xe2,0x6d,0x91,0x04,0x4f]
1950 ; X64-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
1951 ; X64-NEXT: retq # encoding: [0xc3]
1952 %res = call <4 x i32> @llvm.x86.avx2.gather.q.d.256(<4 x i32> %a0,
1953 i8* %a1, <4 x i64> %idx, <4 x i32> %mask, i8 2) ;
1956 declare <4 x i32> @llvm.x86.avx2.gather.q.d.256(<4 x i32>, i8*,
1957 <4 x i64>, <4 x i32>, i8) nounwind readonly
1960 define <8 x float> @test_gather_mask(<8 x float> %a0, float* %a, <8 x i32> %idx, <8 x float> %mask, float* nocapture %out) {
1962 ; X86-AVX-LABEL: test_gather_mask:
1964 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x08]
1965 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %ecx # encoding: [0x8b,0x4c,0x24,0x04]
1966 ; X86-AVX-NEXT: vmovaps %ymm2, %ymm3 # encoding: [0xc5,0xfc,0x28,0xda]
1967 ; X86-AVX-NEXT: vgatherdps %ymm3, (%ecx,%ymm1,4), %ymm0 # encoding: [0xc4,0xe2,0x65,0x92,0x04,0x89]
1968 ; X86-AVX-NEXT: vmovups %ymm2, (%eax) # encoding: [0xc5,0xfc,0x11,0x10]
1969 ; X86-AVX-NEXT: retl # encoding: [0xc3]
1971 ; X86-AVX512VL-LABEL: test_gather_mask:
1972 ; X86-AVX512VL: # %bb.0:
1973 ; X86-AVX512VL-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x08]
1974 ; X86-AVX512VL-NEXT: movl {{[0-9]+}}(%esp), %ecx # encoding: [0x8b,0x4c,0x24,0x04]
1975 ; X86-AVX512VL-NEXT: vmovaps %ymm2, %ymm3 # EVEX TO VEX Compression encoding: [0xc5,0xfc,0x28,0xda]
1976 ; X86-AVX512VL-NEXT: vgatherdps %ymm3, (%ecx,%ymm1,4), %ymm0 # encoding: [0xc4,0xe2,0x65,0x92,0x04,0x89]
1977 ; X86-AVX512VL-NEXT: vmovups %ymm2, (%eax) # EVEX TO VEX Compression encoding: [0xc5,0xfc,0x11,0x10]
1978 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
1980 ; X64-AVX-LABEL: test_gather_mask:
1982 ; X64-AVX-NEXT: vmovaps %ymm2, %ymm3 # encoding: [0xc5,0xfc,0x28,0xda]
1983 ; X64-AVX-NEXT: vgatherdps %ymm3, (%rdi,%ymm1,4), %ymm0 # encoding: [0xc4,0xe2,0x65,0x92,0x04,0x8f]
1984 ; X64-AVX-NEXT: vmovups %ymm2, (%rsi) # encoding: [0xc5,0xfc,0x11,0x16]
1985 ; X64-AVX-NEXT: retq # encoding: [0xc3]
1987 ; X64-AVX512VL-LABEL: test_gather_mask:
1988 ; X64-AVX512VL: # %bb.0:
1989 ; X64-AVX512VL-NEXT: vmovaps %ymm2, %ymm3 # EVEX TO VEX Compression encoding: [0xc5,0xfc,0x28,0xda]
1990 ; X64-AVX512VL-NEXT: vgatherdps %ymm3, (%rdi,%ymm1,4), %ymm0 # encoding: [0xc4,0xe2,0x65,0x92,0x04,0x8f]
1991 ; X64-AVX512VL-NEXT: vmovups %ymm2, (%rsi) # EVEX TO VEX Compression encoding: [0xc5,0xfc,0x11,0x16]
1992 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
1993 %a_i8 = bitcast float* %a to i8*
1994 %res = call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> %a0,
1995 i8* %a_i8, <8 x i32> %idx, <8 x float> %mask, i8 4) ;
1997 ;; for debugging, we'll just dump out the mask
1998 %out_ptr = bitcast float * %out to <8 x float> *
1999 store <8 x float> %mask, <8 x float> * %out_ptr, align 4
2001 ret <8 x float> %res
2004 define <2 x i64> @test_mask_demanded_bits(<2 x i64> %a0, i8* %a1, <2 x i64> %idx, <2 x i1> %mask) {
2005 ; X86-AVX-LABEL: test_mask_demanded_bits:
2007 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
2008 ; X86-AVX-NEXT: vpsllq $63, %xmm2, %xmm2 # encoding: [0xc5,0xe9,0x73,0xf2,0x3f]
2009 ; X86-AVX-NEXT: vpgatherqq %xmm2, (%eax,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0xe9,0x91,0x04,0x48]
2010 ; X86-AVX-NEXT: retl # encoding: [0xc3]
2012 ; X86-AVX512VL-LABEL: test_mask_demanded_bits:
2013 ; X86-AVX512VL: # %bb.0:
2014 ; X86-AVX512VL-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
2015 ; X86-AVX512VL-NEXT: vpsllq $63, %xmm2, %xmm2 # EVEX TO VEX Compression encoding: [0xc5,0xe9,0x73,0xf2,0x3f]
2016 ; X86-AVX512VL-NEXT: vpgatherqq %xmm2, (%eax,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0xe9,0x91,0x04,0x48]
2017 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
2019 ; X64-AVX-LABEL: test_mask_demanded_bits:
2021 ; X64-AVX-NEXT: vpsllq $63, %xmm2, %xmm2 # encoding: [0xc5,0xe9,0x73,0xf2,0x3f]
2022 ; X64-AVX-NEXT: vpgatherqq %xmm2, (%rdi,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0xe9,0x91,0x04,0x4f]
2023 ; X64-AVX-NEXT: retq # encoding: [0xc3]
2025 ; X64-AVX512VL-LABEL: test_mask_demanded_bits:
2026 ; X64-AVX512VL: # %bb.0:
2027 ; X64-AVX512VL-NEXT: vpsllq $63, %xmm2, %xmm2 # EVEX TO VEX Compression encoding: [0xc5,0xe9,0x73,0xf2,0x3f]
2028 ; X64-AVX512VL-NEXT: vpgatherqq %xmm2, (%rdi,%xmm1,2), %xmm0 # encoding: [0xc4,0xe2,0xe9,0x91,0x04,0x4f]
2029 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
2030 %mask1 = sext <2 x i1> %mask to <2 x i64>
2031 %res = call <2 x i64> @llvm.x86.avx2.gather.q.q(<2 x i64> %a0,
2032 i8* %a1, <2 x i64> %idx, <2 x i64> %mask1, i8 2) ;