1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512vl %s -o - | FileCheck %s
4 define <4 x float> @test_4xfloat_shuff_mask0(<4 x float> %vec1, <4 x float> %vec2) {
5 ; CHECK-LABEL: test_4xfloat_shuff_mask0:
7 ; CHECK-NEXT: vshufps {{.*#+}} xmm0 = xmm0[2,1],xmm1[3,1]
9 %res = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 2, i32 1, i32 7, i32 5>
12 define <4 x float> @test_4xfloat_masked_shuff_mask0(<4 x float> %vec1, <4 x float> %vec2, <4 x float> %vec3, <4 x float> %mask) {
13 ; CHECK-LABEL: test_4xfloat_masked_shuff_mask0:
15 ; CHECK-NEXT: vxorps %xmm4, %xmm4, %xmm4
16 ; CHECK-NEXT: vcmpeqps %xmm4, %xmm3, %k1
17 ; CHECK-NEXT: vshufps {{.*#+}} xmm2 {%k1} = xmm0[2,1],xmm1[3,1]
18 ; CHECK-NEXT: vmovaps %xmm2, %xmm0
20 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 2, i32 1, i32 7, i32 5>
21 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
22 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> %vec3
26 define <4 x float> @test_4xfloat_zero_masked_shuff_mask0(<4 x float> %vec1, <4 x float> %vec2, <4 x float> %mask) {
27 ; CHECK-LABEL: test_4xfloat_zero_masked_shuff_mask0:
29 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
30 ; CHECK-NEXT: vcmpeqps %xmm3, %xmm2, %k1
31 ; CHECK-NEXT: vshufps {{.*#+}} xmm0 {%k1} {z} = xmm0[2,1],xmm1[3,1]
33 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 2, i32 1, i32 7, i32 5>
34 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
35 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> zeroinitializer
38 define <4 x float> @test_4xfloat_masked_shuff_mask1(<4 x float> %vec1, <4 x float> %vec2, <4 x float> %vec3, <4 x float> %mask) {
39 ; CHECK-LABEL: test_4xfloat_masked_shuff_mask1:
41 ; CHECK-NEXT: vxorps %xmm4, %xmm4, %xmm4
42 ; CHECK-NEXT: vcmpeqps %xmm4, %xmm3, %k1
43 ; CHECK-NEXT: vshufps {{.*#+}} xmm2 {%k1} = xmm0[1,2],xmm1[3,2]
44 ; CHECK-NEXT: vmovaps %xmm2, %xmm0
46 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 1, i32 2, i32 7, i32 6>
47 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
48 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> %vec3
52 define <4 x float> @test_4xfloat_zero_masked_shuff_mask1(<4 x float> %vec1, <4 x float> %vec2, <4 x float> %mask) {
53 ; CHECK-LABEL: test_4xfloat_zero_masked_shuff_mask1:
55 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
56 ; CHECK-NEXT: vcmpeqps %xmm3, %xmm2, %k1
57 ; CHECK-NEXT: vshufps {{.*#+}} xmm0 {%k1} {z} = xmm0[1,2],xmm1[3,2]
59 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 1, i32 2, i32 7, i32 6>
60 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
61 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> zeroinitializer
64 define <4 x float> @test_4xfloat_masked_shuff_mask2(<4 x float> %vec1, <4 x float> %vec2, <4 x float> %vec3, <4 x float> %mask) {
65 ; CHECK-LABEL: test_4xfloat_masked_shuff_mask2:
67 ; CHECK-NEXT: vxorps %xmm4, %xmm4, %xmm4
68 ; CHECK-NEXT: vcmpeqps %xmm4, %xmm3, %k1
69 ; CHECK-NEXT: vshufps {{.*#+}} xmm2 {%k1} = xmm0[1,3],xmm1[2,1]
70 ; CHECK-NEXT: vmovaps %xmm2, %xmm0
72 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 1, i32 3, i32 6, i32 5>
73 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
74 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> %vec3
78 define <4 x float> @test_4xfloat_zero_masked_shuff_mask2(<4 x float> %vec1, <4 x float> %vec2, <4 x float> %mask) {
79 ; CHECK-LABEL: test_4xfloat_zero_masked_shuff_mask2:
81 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
82 ; CHECK-NEXT: vcmpeqps %xmm3, %xmm2, %k1
83 ; CHECK-NEXT: vshufps {{.*#+}} xmm0 {%k1} {z} = xmm0[1,3],xmm1[2,1]
85 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 1, i32 3, i32 6, i32 5>
86 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
87 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> zeroinitializer
90 define <4 x float> @test_4xfloat_shuff_mask3(<4 x float> %vec1, <4 x float> %vec2) {
91 ; CHECK-LABEL: test_4xfloat_shuff_mask3:
93 ; CHECK-NEXT: vshufps {{.*#+}} xmm0 = xmm0[3,3],xmm1[3,3]
95 %res = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 3, i32 3, i32 7, i32 7>
98 define <4 x float> @test_4xfloat_masked_shuff_mask3(<4 x float> %vec1, <4 x float> %vec2, <4 x float> %vec3, <4 x float> %mask) {
99 ; CHECK-LABEL: test_4xfloat_masked_shuff_mask3:
101 ; CHECK-NEXT: vxorps %xmm4, %xmm4, %xmm4
102 ; CHECK-NEXT: vcmpeqps %xmm4, %xmm3, %k1
103 ; CHECK-NEXT: vshufps {{.*#+}} xmm2 {%k1} = xmm0[3,3],xmm1[3,3]
104 ; CHECK-NEXT: vmovaps %xmm2, %xmm0
106 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 3, i32 3, i32 7, i32 7>
107 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
108 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> %vec3
112 define <4 x float> @test_4xfloat_zero_masked_shuff_mask3(<4 x float> %vec1, <4 x float> %vec2, <4 x float> %mask) {
113 ; CHECK-LABEL: test_4xfloat_zero_masked_shuff_mask3:
115 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
116 ; CHECK-NEXT: vcmpeqps %xmm3, %xmm2, %k1
117 ; CHECK-NEXT: vshufps {{.*#+}} xmm0 {%k1} {z} = xmm0[3,3],xmm1[3,3]
119 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 3, i32 3, i32 7, i32 7>
120 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
121 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> zeroinitializer
124 define <4 x float> @test_4xfloat_shuff_mem_mask0(<4 x float> %vec1, <4 x float>* %vec2p) {
125 ; CHECK-LABEL: test_4xfloat_shuff_mem_mask0:
127 ; CHECK-NEXT: vshufps {{.*#+}} xmm0 = xmm0[1,0],mem[1,2]
129 %vec2 = load <4 x float>, <4 x float>* %vec2p
130 %res = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 1, i32 0, i32 5, i32 6>
133 define <4 x float> @test_4xfloat_masked_shuff_mem_mask0(<4 x float> %vec1, <4 x float>* %vec2p, <4 x float> %vec3, <4 x float> %mask) {
134 ; CHECK-LABEL: test_4xfloat_masked_shuff_mem_mask0:
136 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
137 ; CHECK-NEXT: vcmpeqps %xmm3, %xmm2, %k1
138 ; CHECK-NEXT: vshufps {{.*#+}} xmm1 {%k1} = xmm0[1,0],mem[1,2]
139 ; CHECK-NEXT: vmovaps %xmm1, %xmm0
141 %vec2 = load <4 x float>, <4 x float>* %vec2p
142 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 1, i32 0, i32 5, i32 6>
143 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
144 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> %vec3
148 define <4 x float> @test_4xfloat_zero_masked_shuff_mem_mask0(<4 x float> %vec1, <4 x float>* %vec2p, <4 x float> %mask) {
149 ; CHECK-LABEL: test_4xfloat_zero_masked_shuff_mem_mask0:
151 ; CHECK-NEXT: vxorps %xmm2, %xmm2, %xmm2
152 ; CHECK-NEXT: vcmpeqps %xmm2, %xmm1, %k1
153 ; CHECK-NEXT: vshufps {{.*#+}} xmm0 {%k1} {z} = xmm0[1,0],mem[1,2]
155 %vec2 = load <4 x float>, <4 x float>* %vec2p
156 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 1, i32 0, i32 5, i32 6>
157 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
158 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> zeroinitializer
162 define <4 x float> @test_4xfloat_masked_shuff_mem_mask1(<4 x float> %vec1, <4 x float>* %vec2p, <4 x float> %vec3, <4 x float> %mask) {
163 ; CHECK-LABEL: test_4xfloat_masked_shuff_mem_mask1:
165 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
166 ; CHECK-NEXT: vcmpeqps %xmm3, %xmm2, %k1
167 ; CHECK-NEXT: vshufps {{.*#+}} xmm1 {%k1} = xmm0[3,3],mem[1,3]
168 ; CHECK-NEXT: vmovaps %xmm1, %xmm0
170 %vec2 = load <4 x float>, <4 x float>* %vec2p
171 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 3, i32 3, i32 5, i32 7>
172 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
173 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> %vec3
177 define <4 x float> @test_4xfloat_zero_masked_shuff_mem_mask1(<4 x float> %vec1, <4 x float>* %vec2p, <4 x float> %mask) {
178 ; CHECK-LABEL: test_4xfloat_zero_masked_shuff_mem_mask1:
180 ; CHECK-NEXT: vxorps %xmm2, %xmm2, %xmm2
181 ; CHECK-NEXT: vcmpeqps %xmm2, %xmm1, %k1
182 ; CHECK-NEXT: vshufps {{.*#+}} xmm0 {%k1} {z} = xmm0[3,3],mem[1,3]
184 %vec2 = load <4 x float>, <4 x float>* %vec2p
185 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 3, i32 3, i32 5, i32 7>
186 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
187 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> zeroinitializer
191 define <4 x float> @test_4xfloat_masked_shuff_mem_mask2(<4 x float> %vec1, <4 x float>* %vec2p, <4 x float> %vec3, <4 x float> %mask) {
192 ; CHECK-LABEL: test_4xfloat_masked_shuff_mem_mask2:
194 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
195 ; CHECK-NEXT: vcmpeqps %xmm3, %xmm2, %k1
196 ; CHECK-NEXT: vshufps {{.*#+}} xmm1 {%k1} = xmm0[1,3],mem[2,0]
197 ; CHECK-NEXT: vmovaps %xmm1, %xmm0
199 %vec2 = load <4 x float>, <4 x float>* %vec2p
200 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 1, i32 3, i32 6, i32 4>
201 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
202 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> %vec3
206 define <4 x float> @test_4xfloat_zero_masked_shuff_mem_mask2(<4 x float> %vec1, <4 x float>* %vec2p, <4 x float> %mask) {
207 ; CHECK-LABEL: test_4xfloat_zero_masked_shuff_mem_mask2:
209 ; CHECK-NEXT: vxorps %xmm2, %xmm2, %xmm2
210 ; CHECK-NEXT: vcmpeqps %xmm2, %xmm1, %k1
211 ; CHECK-NEXT: vshufps {{.*#+}} xmm0 {%k1} {z} = xmm0[1,3],mem[2,0]
213 %vec2 = load <4 x float>, <4 x float>* %vec2p
214 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 1, i32 3, i32 6, i32 4>
215 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
216 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> zeroinitializer
220 define <4 x float> @test_4xfloat_shuff_mem_mask3(<4 x float> %vec1, <4 x float>* %vec2p) {
221 ; CHECK-LABEL: test_4xfloat_shuff_mem_mask3:
223 ; CHECK-NEXT: vshufps {{.*#+}} xmm0 = xmm0[2,1],mem[3,2]
225 %vec2 = load <4 x float>, <4 x float>* %vec2p
226 %res = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 2, i32 1, i32 7, i32 6>
229 define <4 x float> @test_4xfloat_masked_shuff_mem_mask3(<4 x float> %vec1, <4 x float>* %vec2p, <4 x float> %vec3, <4 x float> %mask) {
230 ; CHECK-LABEL: test_4xfloat_masked_shuff_mem_mask3:
232 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
233 ; CHECK-NEXT: vcmpeqps %xmm3, %xmm2, %k1
234 ; CHECK-NEXT: vshufps {{.*#+}} xmm1 {%k1} = xmm0[2,1],mem[3,2]
235 ; CHECK-NEXT: vmovaps %xmm1, %xmm0
237 %vec2 = load <4 x float>, <4 x float>* %vec2p
238 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 2, i32 1, i32 7, i32 6>
239 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
240 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> %vec3
244 define <4 x float> @test_4xfloat_zero_masked_shuff_mem_mask3(<4 x float> %vec1, <4 x float>* %vec2p, <4 x float> %mask) {
245 ; CHECK-LABEL: test_4xfloat_zero_masked_shuff_mem_mask3:
247 ; CHECK-NEXT: vxorps %xmm2, %xmm2, %xmm2
248 ; CHECK-NEXT: vcmpeqps %xmm2, %xmm1, %k1
249 ; CHECK-NEXT: vshufps {{.*#+}} xmm0 {%k1} {z} = xmm0[2,1],mem[3,2]
251 %vec2 = load <4 x float>, <4 x float>* %vec2p
252 %shuf = shufflevector <4 x float> %vec1, <4 x float> %vec2, <4 x i32> <i32 2, i32 1, i32 7, i32 6>
253 %cmp = fcmp oeq <4 x float> %mask, zeroinitializer
254 %res = select <4 x i1> %cmp, <4 x float> %shuf, <4 x float> zeroinitializer
258 define <8 x float> @test_8xfloat_shuff_mask0(<8 x float> %vec1, <8 x float> %vec2) {
259 ; CHECK-LABEL: test_8xfloat_shuff_mask0:
261 ; CHECK-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[0,2],ymm0[5,7],ymm1[4,6]
263 %res = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 1, i32 3, i32 8, i32 10, i32 5, i32 7, i32 12, i32 14>
266 define <8 x float> @test_8xfloat_masked_shuff_mask0(<8 x float> %vec1, <8 x float> %vec2, <8 x float> %vec3, <8 x float> %mask) {
267 ; CHECK-LABEL: test_8xfloat_masked_shuff_mask0:
269 ; CHECK-NEXT: vxorps %xmm4, %xmm4, %xmm4
270 ; CHECK-NEXT: vcmpeqps %ymm4, %ymm3, %k1
271 ; CHECK-NEXT: vshufps {{.*#+}} ymm2 {%k1} = ymm0[1,3],ymm1[0,2],ymm0[5,7],ymm1[4,6]
272 ; CHECK-NEXT: vmovaps %ymm2, %ymm0
274 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 1, i32 3, i32 8, i32 10, i32 5, i32 7, i32 12, i32 14>
275 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
276 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> %vec3
280 define <8 x float> @test_8xfloat_zero_masked_shuff_mask0(<8 x float> %vec1, <8 x float> %vec2, <8 x float> %mask) {
281 ; CHECK-LABEL: test_8xfloat_zero_masked_shuff_mask0:
283 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
284 ; CHECK-NEXT: vcmpeqps %ymm3, %ymm2, %k1
285 ; CHECK-NEXT: vshufps {{.*#+}} ymm0 {%k1} {z} = ymm0[1,3],ymm1[0,2],ymm0[5,7],ymm1[4,6]
287 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 1, i32 3, i32 8, i32 10, i32 5, i32 7, i32 12, i32 14>
288 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
289 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> zeroinitializer
292 define <8 x float> @test_8xfloat_masked_shuff_mask1(<8 x float> %vec1, <8 x float> %vec2, <8 x float> %vec3, <8 x float> %mask) {
293 ; CHECK-LABEL: test_8xfloat_masked_shuff_mask1:
295 ; CHECK-NEXT: vxorps %xmm4, %xmm4, %xmm4
296 ; CHECK-NEXT: vcmpeqps %ymm4, %ymm3, %k1
297 ; CHECK-NEXT: vshufps {{.*#+}} ymm2 {%k1} = ymm0[0,3],ymm1[3,1],ymm0[4,7],ymm1[7,5]
298 ; CHECK-NEXT: vmovaps %ymm2, %ymm0
300 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 0, i32 3, i32 11, i32 9, i32 4, i32 7, i32 15, i32 13>
301 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
302 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> %vec3
306 define <8 x float> @test_8xfloat_zero_masked_shuff_mask1(<8 x float> %vec1, <8 x float> %vec2, <8 x float> %mask) {
307 ; CHECK-LABEL: test_8xfloat_zero_masked_shuff_mask1:
309 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
310 ; CHECK-NEXT: vcmpeqps %ymm3, %ymm2, %k1
311 ; CHECK-NEXT: vshufps {{.*#+}} ymm0 {%k1} {z} = ymm0[0,3],ymm1[3,1],ymm0[4,7],ymm1[7,5]
313 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 0, i32 3, i32 11, i32 9, i32 4, i32 7, i32 15, i32 13>
314 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
315 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> zeroinitializer
318 define <8 x float> @test_8xfloat_masked_shuff_mask2(<8 x float> %vec1, <8 x float> %vec2, <8 x float> %vec3, <8 x float> %mask) {
319 ; CHECK-LABEL: test_8xfloat_masked_shuff_mask2:
321 ; CHECK-NEXT: vxorps %xmm4, %xmm4, %xmm4
322 ; CHECK-NEXT: vcmpeqps %ymm4, %ymm3, %k1
323 ; CHECK-NEXT: vshufps {{.*#+}} ymm2 {%k1} = ymm0[0,2],ymm1[2,2],ymm0[4,6],ymm1[6,6]
324 ; CHECK-NEXT: vmovaps %ymm2, %ymm0
326 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 0, i32 2, i32 10, i32 10, i32 4, i32 6, i32 14, i32 14>
327 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
328 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> %vec3
332 define <8 x float> @test_8xfloat_zero_masked_shuff_mask2(<8 x float> %vec1, <8 x float> %vec2, <8 x float> %mask) {
333 ; CHECK-LABEL: test_8xfloat_zero_masked_shuff_mask2:
335 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
336 ; CHECK-NEXT: vcmpeqps %ymm3, %ymm2, %k1
337 ; CHECK-NEXT: vshufps {{.*#+}} ymm0 {%k1} {z} = ymm0[0,2],ymm1[2,2],ymm0[4,6],ymm1[6,6]
339 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 0, i32 2, i32 10, i32 10, i32 4, i32 6, i32 14, i32 14>
340 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
341 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> zeroinitializer
344 define <8 x float> @test_8xfloat_shuff_mask3(<8 x float> %vec1, <8 x float> %vec2) {
345 ; CHECK-LABEL: test_8xfloat_shuff_mask3:
347 ; CHECK-NEXT: vshufps {{.*#+}} ymm0 = ymm0[3,2],ymm1[3,2],ymm0[7,6],ymm1[7,6]
349 %res = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 3, i32 2, i32 11, i32 10, i32 7, i32 6, i32 15, i32 14>
352 define <8 x float> @test_8xfloat_masked_shuff_mask3(<8 x float> %vec1, <8 x float> %vec2, <8 x float> %vec3, <8 x float> %mask) {
353 ; CHECK-LABEL: test_8xfloat_masked_shuff_mask3:
355 ; CHECK-NEXT: vxorps %xmm4, %xmm4, %xmm4
356 ; CHECK-NEXT: vcmpeqps %ymm4, %ymm3, %k1
357 ; CHECK-NEXT: vshufps {{.*#+}} ymm2 {%k1} = ymm0[3,2],ymm1[3,2],ymm0[7,6],ymm1[7,6]
358 ; CHECK-NEXT: vmovaps %ymm2, %ymm0
360 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 3, i32 2, i32 11, i32 10, i32 7, i32 6, i32 15, i32 14>
361 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
362 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> %vec3
366 define <8 x float> @test_8xfloat_zero_masked_shuff_mask3(<8 x float> %vec1, <8 x float> %vec2, <8 x float> %mask) {
367 ; CHECK-LABEL: test_8xfloat_zero_masked_shuff_mask3:
369 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
370 ; CHECK-NEXT: vcmpeqps %ymm3, %ymm2, %k1
371 ; CHECK-NEXT: vshufps {{.*#+}} ymm0 {%k1} {z} = ymm0[3,2],ymm1[3,2],ymm0[7,6],ymm1[7,6]
373 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 3, i32 2, i32 11, i32 10, i32 7, i32 6, i32 15, i32 14>
374 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
375 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> zeroinitializer
378 define <8 x float> @test_8xfloat_shuff_mem_mask0(<8 x float> %vec1, <8 x float>* %vec2p) {
379 ; CHECK-LABEL: test_8xfloat_shuff_mem_mask0:
381 ; CHECK-NEXT: vshufps {{.*#+}} ymm0 = ymm0[2,1],mem[0,0],ymm0[6,5],mem[4,4]
383 %vec2 = load <8 x float>, <8 x float>* %vec2p
384 %res = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 2, i32 1, i32 8, i32 8, i32 6, i32 5, i32 12, i32 12>
387 define <8 x float> @test_8xfloat_masked_shuff_mem_mask0(<8 x float> %vec1, <8 x float>* %vec2p, <8 x float> %vec3, <8 x float> %mask) {
388 ; CHECK-LABEL: test_8xfloat_masked_shuff_mem_mask0:
390 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
391 ; CHECK-NEXT: vcmpeqps %ymm3, %ymm2, %k1
392 ; CHECK-NEXT: vshufps {{.*#+}} ymm1 {%k1} = ymm0[2,1],mem[0,0],ymm0[6,5],mem[4,4]
393 ; CHECK-NEXT: vmovaps %ymm1, %ymm0
395 %vec2 = load <8 x float>, <8 x float>* %vec2p
396 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 2, i32 1, i32 8, i32 8, i32 6, i32 5, i32 12, i32 12>
397 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
398 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> %vec3
402 define <8 x float> @test_8xfloat_zero_masked_shuff_mem_mask0(<8 x float> %vec1, <8 x float>* %vec2p, <8 x float> %mask) {
403 ; CHECK-LABEL: test_8xfloat_zero_masked_shuff_mem_mask0:
405 ; CHECK-NEXT: vxorps %xmm2, %xmm2, %xmm2
406 ; CHECK-NEXT: vcmpeqps %ymm2, %ymm1, %k1
407 ; CHECK-NEXT: vshufps {{.*#+}} ymm0 {%k1} {z} = ymm0[2,1],mem[0,0],ymm0[6,5],mem[4,4]
409 %vec2 = load <8 x float>, <8 x float>* %vec2p
410 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 2, i32 1, i32 8, i32 8, i32 6, i32 5, i32 12, i32 12>
411 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
412 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> zeroinitializer
416 define <8 x float> @test_8xfloat_masked_shuff_mem_mask1(<8 x float> %vec1, <8 x float>* %vec2p, <8 x float> %vec3, <8 x float> %mask) {
417 ; CHECK-LABEL: test_8xfloat_masked_shuff_mem_mask1:
419 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
420 ; CHECK-NEXT: vcmpeqps %ymm3, %ymm2, %k1
421 ; CHECK-NEXT: vshufps {{.*#+}} ymm1 {%k1} = ymm0[2,2],mem[1,0],ymm0[6,6],mem[5,4]
422 ; CHECK-NEXT: vmovaps %ymm1, %ymm0
424 %vec2 = load <8 x float>, <8 x float>* %vec2p
425 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 2, i32 2, i32 9, i32 8, i32 6, i32 6, i32 13, i32 12>
426 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
427 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> %vec3
431 define <8 x float> @test_8xfloat_zero_masked_shuff_mem_mask1(<8 x float> %vec1, <8 x float>* %vec2p, <8 x float> %mask) {
432 ; CHECK-LABEL: test_8xfloat_zero_masked_shuff_mem_mask1:
434 ; CHECK-NEXT: vxorps %xmm2, %xmm2, %xmm2
435 ; CHECK-NEXT: vcmpeqps %ymm2, %ymm1, %k1
436 ; CHECK-NEXT: vshufps {{.*#+}} ymm0 {%k1} {z} = ymm0[2,2],mem[1,0],ymm0[6,6],mem[5,4]
438 %vec2 = load <8 x float>, <8 x float>* %vec2p
439 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 2, i32 2, i32 9, i32 8, i32 6, i32 6, i32 13, i32 12>
440 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
441 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> zeroinitializer
445 define <8 x float> @test_8xfloat_masked_shuff_mem_mask2(<8 x float> %vec1, <8 x float>* %vec2p, <8 x float> %vec3, <8 x float> %mask) {
446 ; CHECK-LABEL: test_8xfloat_masked_shuff_mem_mask2:
448 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
449 ; CHECK-NEXT: vcmpeqps %ymm3, %ymm2, %k1
450 ; CHECK-NEXT: vshufps {{.*#+}} ymm1 {%k1} = ymm0[3,3],mem[3,3],ymm0[7,7],mem[7,7]
451 ; CHECK-NEXT: vmovaps %ymm1, %ymm0
453 %vec2 = load <8 x float>, <8 x float>* %vec2p
454 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 3, i32 3, i32 11, i32 11, i32 7, i32 7, i32 15, i32 15>
455 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
456 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> %vec3
460 define <8 x float> @test_8xfloat_zero_masked_shuff_mem_mask2(<8 x float> %vec1, <8 x float>* %vec2p, <8 x float> %mask) {
461 ; CHECK-LABEL: test_8xfloat_zero_masked_shuff_mem_mask2:
463 ; CHECK-NEXT: vxorps %xmm2, %xmm2, %xmm2
464 ; CHECK-NEXT: vcmpeqps %ymm2, %ymm1, %k1
465 ; CHECK-NEXT: vshufps {{.*#+}} ymm0 {%k1} {z} = ymm0[3,3],mem[3,3],ymm0[7,7],mem[7,7]
467 %vec2 = load <8 x float>, <8 x float>* %vec2p
468 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 3, i32 3, i32 11, i32 11, i32 7, i32 7, i32 15, i32 15>
469 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
470 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> zeroinitializer
474 define <8 x float> @test_8xfloat_shuff_mem_mask3(<8 x float> %vec1, <8 x float>* %vec2p) {
475 ; CHECK-LABEL: test_8xfloat_shuff_mem_mask3:
477 ; CHECK-NEXT: vshufps {{.*#+}} ymm0 = ymm0[3,3],mem[2,1],ymm0[7,7],mem[6,5]
479 %vec2 = load <8 x float>, <8 x float>* %vec2p
480 %res = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 3, i32 3, i32 10, i32 9, i32 7, i32 7, i32 14, i32 13>
483 define <8 x float> @test_8xfloat_masked_shuff_mem_mask3(<8 x float> %vec1, <8 x float>* %vec2p, <8 x float> %vec3, <8 x float> %mask) {
484 ; CHECK-LABEL: test_8xfloat_masked_shuff_mem_mask3:
486 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
487 ; CHECK-NEXT: vcmpeqps %ymm3, %ymm2, %k1
488 ; CHECK-NEXT: vshufps {{.*#+}} ymm1 {%k1} = ymm0[3,3],mem[2,1],ymm0[7,7],mem[6,5]
489 ; CHECK-NEXT: vmovaps %ymm1, %ymm0
491 %vec2 = load <8 x float>, <8 x float>* %vec2p
492 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 3, i32 3, i32 10, i32 9, i32 7, i32 7, i32 14, i32 13>
493 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
494 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> %vec3
498 define <8 x float> @test_8xfloat_zero_masked_shuff_mem_mask3(<8 x float> %vec1, <8 x float>* %vec2p, <8 x float> %mask) {
499 ; CHECK-LABEL: test_8xfloat_zero_masked_shuff_mem_mask3:
501 ; CHECK-NEXT: vxorps %xmm2, %xmm2, %xmm2
502 ; CHECK-NEXT: vcmpeqps %ymm2, %ymm1, %k1
503 ; CHECK-NEXT: vshufps {{.*#+}} ymm0 {%k1} {z} = ymm0[3,3],mem[2,1],ymm0[7,7],mem[6,5]
505 %vec2 = load <8 x float>, <8 x float>* %vec2p
506 %shuf = shufflevector <8 x float> %vec1, <8 x float> %vec2, <8 x i32> <i32 3, i32 3, i32 10, i32 9, i32 7, i32 7, i32 14, i32 13>
507 %cmp = fcmp oeq <8 x float> %mask, zeroinitializer
508 %res = select <8 x i1> %cmp, <8 x float> %shuf, <8 x float> zeroinitializer
512 define <16 x float> @test_16xfloat_shuff_mask0(<16 x float> %vec1, <16 x float> %vec2) {
513 ; CHECK-LABEL: test_16xfloat_shuff_mask0:
515 ; CHECK-NEXT: vshufps {{.*#+}} zmm0 = zmm0[3,2],zmm1[3,2],zmm0[7,6],zmm1[7,6],zmm0[11,10],zmm1[11,10],zmm0[15,14],zmm1[15,14]
517 %res = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 3, i32 2, i32 19, i32 18, i32 7, i32 6, i32 23, i32 22, i32 11, i32 10, i32 27, i32 26, i32 15, i32 14, i32 31, i32 30>
518 ret <16 x float> %res
520 define <16 x float> @test_16xfloat_masked_shuff_mask0(<16 x float> %vec1, <16 x float> %vec2, <16 x float> %vec3, <16 x float> %mask) {
521 ; CHECK-LABEL: test_16xfloat_masked_shuff_mask0:
523 ; CHECK-NEXT: vxorps %xmm4, %xmm4, %xmm4
524 ; CHECK-NEXT: vcmpeqps %zmm4, %zmm3, %k1
525 ; CHECK-NEXT: vshufps {{.*#+}} zmm2 {%k1} = zmm0[3,2],zmm1[3,2],zmm0[7,6],zmm1[7,6],zmm0[11,10],zmm1[11,10],zmm0[15,14],zmm1[15,14]
526 ; CHECK-NEXT: vmovaps %zmm2, %zmm0
528 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 3, i32 2, i32 19, i32 18, i32 7, i32 6, i32 23, i32 22, i32 11, i32 10, i32 27, i32 26, i32 15, i32 14, i32 31, i32 30>
529 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
530 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> %vec3
531 ret <16 x float> %res
534 define <16 x float> @test_16xfloat_zero_masked_shuff_mask0(<16 x float> %vec1, <16 x float> %vec2, <16 x float> %mask) {
535 ; CHECK-LABEL: test_16xfloat_zero_masked_shuff_mask0:
537 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
538 ; CHECK-NEXT: vcmpeqps %zmm3, %zmm2, %k1
539 ; CHECK-NEXT: vshufps {{.*#+}} zmm0 {%k1} {z} = zmm0[3,2],zmm1[3,2],zmm0[7,6],zmm1[7,6],zmm0[11,10],zmm1[11,10],zmm0[15,14],zmm1[15,14]
541 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 3, i32 2, i32 19, i32 18, i32 7, i32 6, i32 23, i32 22, i32 11, i32 10, i32 27, i32 26, i32 15, i32 14, i32 31, i32 30>
542 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
543 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> zeroinitializer
544 ret <16 x float> %res
546 define <16 x float> @test_16xfloat_masked_shuff_mask1(<16 x float> %vec1, <16 x float> %vec2, <16 x float> %vec3, <16 x float> %mask) {
547 ; CHECK-LABEL: test_16xfloat_masked_shuff_mask1:
549 ; CHECK-NEXT: vxorps %xmm4, %xmm4, %xmm4
550 ; CHECK-NEXT: vcmpeqps %zmm4, %zmm3, %k1
551 ; CHECK-NEXT: vshufps {{.*#+}} zmm2 {%k1} = zmm0[1,2],zmm1[3,3],zmm0[5,6],zmm1[7,7],zmm0[9,10],zmm1[11,11],zmm0[13,14],zmm1[15,15]
552 ; CHECK-NEXT: vmovaps %zmm2, %zmm0
554 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 1, i32 2, i32 19, i32 19, i32 5, i32 6, i32 23, i32 23, i32 9, i32 10, i32 27, i32 27, i32 13, i32 14, i32 31, i32 31>
555 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
556 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> %vec3
557 ret <16 x float> %res
560 define <16 x float> @test_16xfloat_zero_masked_shuff_mask1(<16 x float> %vec1, <16 x float> %vec2, <16 x float> %mask) {
561 ; CHECK-LABEL: test_16xfloat_zero_masked_shuff_mask1:
563 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
564 ; CHECK-NEXT: vcmpeqps %zmm3, %zmm2, %k1
565 ; CHECK-NEXT: vshufps {{.*#+}} zmm0 {%k1} {z} = zmm0[1,2],zmm1[3,3],zmm0[5,6],zmm1[7,7],zmm0[9,10],zmm1[11,11],zmm0[13,14],zmm1[15,15]
567 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 1, i32 2, i32 19, i32 19, i32 5, i32 6, i32 23, i32 23, i32 9, i32 10, i32 27, i32 27, i32 13, i32 14, i32 31, i32 31>
568 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
569 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> zeroinitializer
570 ret <16 x float> %res
572 define <16 x float> @test_16xfloat_masked_shuff_mask2(<16 x float> %vec1, <16 x float> %vec2, <16 x float> %vec3, <16 x float> %mask) {
573 ; CHECK-LABEL: test_16xfloat_masked_shuff_mask2:
575 ; CHECK-NEXT: vxorps %xmm4, %xmm4, %xmm4
576 ; CHECK-NEXT: vcmpeqps %zmm4, %zmm3, %k1
577 ; CHECK-NEXT: vshufps {{.*#+}} zmm2 {%k1} = zmm0[3,0],zmm1[2,1],zmm0[7,4],zmm1[6,5],zmm0[11,8],zmm1[10,9],zmm0[15,12],zmm1[14,13]
578 ; CHECK-NEXT: vmovaps %zmm2, %zmm0
580 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 3, i32 0, i32 18, i32 17, i32 7, i32 4, i32 22, i32 21, i32 11, i32 8, i32 26, i32 25, i32 15, i32 12, i32 30, i32 29>
581 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
582 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> %vec3
583 ret <16 x float> %res
586 define <16 x float> @test_16xfloat_zero_masked_shuff_mask2(<16 x float> %vec1, <16 x float> %vec2, <16 x float> %mask) {
587 ; CHECK-LABEL: test_16xfloat_zero_masked_shuff_mask2:
589 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
590 ; CHECK-NEXT: vcmpeqps %zmm3, %zmm2, %k1
591 ; CHECK-NEXT: vshufps {{.*#+}} zmm0 {%k1} {z} = zmm0[3,0],zmm1[2,1],zmm0[7,4],zmm1[6,5],zmm0[11,8],zmm1[10,9],zmm0[15,12],zmm1[14,13]
593 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 3, i32 0, i32 18, i32 17, i32 7, i32 4, i32 22, i32 21, i32 11, i32 8, i32 26, i32 25, i32 15, i32 12, i32 30, i32 29>
594 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
595 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> zeroinitializer
596 ret <16 x float> %res
598 define <16 x float> @test_16xfloat_shuff_mask3(<16 x float> %vec1, <16 x float> %vec2) {
599 ; CHECK-LABEL: test_16xfloat_shuff_mask3:
601 ; CHECK-NEXT: vshufps {{.*#+}} zmm0 = zmm0[2,3],zmm1[0,2],zmm0[6,7],zmm1[4,6],zmm0[10,11],zmm1[8,10],zmm0[14,15],zmm1[12,14]
603 %res = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 2, i32 3, i32 16, i32 18, i32 6, i32 7, i32 20, i32 22, i32 10, i32 11, i32 24, i32 26, i32 14, i32 15, i32 28, i32 30>
604 ret <16 x float> %res
606 define <16 x float> @test_16xfloat_masked_shuff_mask3(<16 x float> %vec1, <16 x float> %vec2, <16 x float> %vec3, <16 x float> %mask) {
607 ; CHECK-LABEL: test_16xfloat_masked_shuff_mask3:
609 ; CHECK-NEXT: vxorps %xmm4, %xmm4, %xmm4
610 ; CHECK-NEXT: vcmpeqps %zmm4, %zmm3, %k1
611 ; CHECK-NEXT: vshufps {{.*#+}} zmm2 {%k1} = zmm0[2,3],zmm1[0,2],zmm0[6,7],zmm1[4,6],zmm0[10,11],zmm1[8,10],zmm0[14,15],zmm1[12,14]
612 ; CHECK-NEXT: vmovaps %zmm2, %zmm0
614 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 2, i32 3, i32 16, i32 18, i32 6, i32 7, i32 20, i32 22, i32 10, i32 11, i32 24, i32 26, i32 14, i32 15, i32 28, i32 30>
615 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
616 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> %vec3
617 ret <16 x float> %res
620 define <16 x float> @test_16xfloat_zero_masked_shuff_mask3(<16 x float> %vec1, <16 x float> %vec2, <16 x float> %mask) {
621 ; CHECK-LABEL: test_16xfloat_zero_masked_shuff_mask3:
623 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
624 ; CHECK-NEXT: vcmpeqps %zmm3, %zmm2, %k1
625 ; CHECK-NEXT: vshufps {{.*#+}} zmm0 {%k1} {z} = zmm0[2,3],zmm1[0,2],zmm0[6,7],zmm1[4,6],zmm0[10,11],zmm1[8,10],zmm0[14,15],zmm1[12,14]
627 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 2, i32 3, i32 16, i32 18, i32 6, i32 7, i32 20, i32 22, i32 10, i32 11, i32 24, i32 26, i32 14, i32 15, i32 28, i32 30>
628 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
629 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> zeroinitializer
630 ret <16 x float> %res
632 define <16 x float> @test_16xfloat_shuff_mem_mask0(<16 x float> %vec1, <16 x float>* %vec2p) {
633 ; CHECK-LABEL: test_16xfloat_shuff_mem_mask0:
635 ; CHECK-NEXT: vshufps {{.*#+}} zmm0 = zmm0[3,0],mem[0,2],zmm0[7,4],mem[4,6],zmm0[11,8],mem[8,10],zmm0[15,12],mem[12,14]
637 %vec2 = load <16 x float>, <16 x float>* %vec2p
638 %res = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 3, i32 0, i32 16, i32 18, i32 7, i32 4, i32 20, i32 22, i32 11, i32 8, i32 24, i32 26, i32 15, i32 12, i32 28, i32 30>
639 ret <16 x float> %res
641 define <16 x float> @test_16xfloat_masked_shuff_mem_mask0(<16 x float> %vec1, <16 x float>* %vec2p, <16 x float> %vec3, <16 x float> %mask) {
642 ; CHECK-LABEL: test_16xfloat_masked_shuff_mem_mask0:
644 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
645 ; CHECK-NEXT: vcmpeqps %zmm3, %zmm2, %k1
646 ; CHECK-NEXT: vshufps {{.*#+}} zmm1 {%k1} = zmm0[3,0],mem[0,2],zmm0[7,4],mem[4,6],zmm0[11,8],mem[8,10],zmm0[15,12],mem[12,14]
647 ; CHECK-NEXT: vmovaps %zmm1, %zmm0
649 %vec2 = load <16 x float>, <16 x float>* %vec2p
650 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 3, i32 0, i32 16, i32 18, i32 7, i32 4, i32 20, i32 22, i32 11, i32 8, i32 24, i32 26, i32 15, i32 12, i32 28, i32 30>
651 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
652 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> %vec3
653 ret <16 x float> %res
656 define <16 x float> @test_16xfloat_zero_masked_shuff_mem_mask0(<16 x float> %vec1, <16 x float>* %vec2p, <16 x float> %mask) {
657 ; CHECK-LABEL: test_16xfloat_zero_masked_shuff_mem_mask0:
659 ; CHECK-NEXT: vxorps %xmm2, %xmm2, %xmm2
660 ; CHECK-NEXT: vcmpeqps %zmm2, %zmm1, %k1
661 ; CHECK-NEXT: vshufps {{.*#+}} zmm0 {%k1} {z} = zmm0[3,0],mem[0,2],zmm0[7,4],mem[4,6],zmm0[11,8],mem[8,10],zmm0[15,12],mem[12,14]
663 %vec2 = load <16 x float>, <16 x float>* %vec2p
664 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 3, i32 0, i32 16, i32 18, i32 7, i32 4, i32 20, i32 22, i32 11, i32 8, i32 24, i32 26, i32 15, i32 12, i32 28, i32 30>
665 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
666 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> zeroinitializer
667 ret <16 x float> %res
670 define <16 x float> @test_16xfloat_masked_shuff_mem_mask1(<16 x float> %vec1, <16 x float>* %vec2p, <16 x float> %vec3, <16 x float> %mask) {
671 ; CHECK-LABEL: test_16xfloat_masked_shuff_mem_mask1:
673 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
674 ; CHECK-NEXT: vcmpeqps %zmm3, %zmm2, %k1
675 ; CHECK-NEXT: vshufps {{.*#+}} zmm1 {%k1} = zmm0[0,2],mem[3,2],zmm0[4,6],mem[7,6],zmm0[8,10],mem[11,10],zmm0[12,14],mem[15,14]
676 ; CHECK-NEXT: vmovaps %zmm1, %zmm0
678 %vec2 = load <16 x float>, <16 x float>* %vec2p
679 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 0, i32 2, i32 19, i32 18, i32 4, i32 6, i32 23, i32 22, i32 8, i32 10, i32 27, i32 26, i32 12, i32 14, i32 31, i32 30>
680 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
681 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> %vec3
682 ret <16 x float> %res
685 define <16 x float> @test_16xfloat_zero_masked_shuff_mem_mask1(<16 x float> %vec1, <16 x float>* %vec2p, <16 x float> %mask) {
686 ; CHECK-LABEL: test_16xfloat_zero_masked_shuff_mem_mask1:
688 ; CHECK-NEXT: vxorps %xmm2, %xmm2, %xmm2
689 ; CHECK-NEXT: vcmpeqps %zmm2, %zmm1, %k1
690 ; CHECK-NEXT: vshufps {{.*#+}} zmm0 {%k1} {z} = zmm0[0,2],mem[3,2],zmm0[4,6],mem[7,6],zmm0[8,10],mem[11,10],zmm0[12,14],mem[15,14]
692 %vec2 = load <16 x float>, <16 x float>* %vec2p
693 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 0, i32 2, i32 19, i32 18, i32 4, i32 6, i32 23, i32 22, i32 8, i32 10, i32 27, i32 26, i32 12, i32 14, i32 31, i32 30>
694 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
695 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> zeroinitializer
696 ret <16 x float> %res
699 define <16 x float> @test_16xfloat_masked_shuff_mem_mask2(<16 x float> %vec1, <16 x float>* %vec2p, <16 x float> %vec3, <16 x float> %mask) {
700 ; CHECK-LABEL: test_16xfloat_masked_shuff_mem_mask2:
702 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
703 ; CHECK-NEXT: vcmpeqps %zmm3, %zmm2, %k1
704 ; CHECK-NEXT: vshufps {{.*#+}} zmm1 {%k1} = zmm0[2,0],mem[2,2],zmm0[6,4],mem[6,6],zmm0[10,8],mem[10,10],zmm0[14,12],mem[14,14]
705 ; CHECK-NEXT: vmovaps %zmm1, %zmm0
707 %vec2 = load <16 x float>, <16 x float>* %vec2p
708 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 2, i32 0, i32 18, i32 18, i32 6, i32 4, i32 22, i32 22, i32 10, i32 8, i32 26, i32 26, i32 14, i32 12, i32 30, i32 30>
709 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
710 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> %vec3
711 ret <16 x float> %res
714 define <16 x float> @test_16xfloat_zero_masked_shuff_mem_mask2(<16 x float> %vec1, <16 x float>* %vec2p, <16 x float> %mask) {
715 ; CHECK-LABEL: test_16xfloat_zero_masked_shuff_mem_mask2:
717 ; CHECK-NEXT: vxorps %xmm2, %xmm2, %xmm2
718 ; CHECK-NEXT: vcmpeqps %zmm2, %zmm1, %k1
719 ; CHECK-NEXT: vshufps {{.*#+}} zmm0 {%k1} {z} = zmm0[2,0],mem[2,2],zmm0[6,4],mem[6,6],zmm0[10,8],mem[10,10],zmm0[14,12],mem[14,14]
721 %vec2 = load <16 x float>, <16 x float>* %vec2p
722 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 2, i32 0, i32 18, i32 18, i32 6, i32 4, i32 22, i32 22, i32 10, i32 8, i32 26, i32 26, i32 14, i32 12, i32 30, i32 30>
723 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
724 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> zeroinitializer
725 ret <16 x float> %res
728 define <16 x float> @test_16xfloat_shuff_mem_mask3(<16 x float> %vec1, <16 x float>* %vec2p) {
729 ; CHECK-LABEL: test_16xfloat_shuff_mem_mask3:
731 ; CHECK-NEXT: vshufps {{.*#+}} zmm0 = zmm0[2,1],mem[1,3],zmm0[6,5],mem[5,7],zmm0[10,9],mem[9,11],zmm0[14,13],mem[13,15]
733 %vec2 = load <16 x float>, <16 x float>* %vec2p
734 %res = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 2, i32 1, i32 17, i32 19, i32 6, i32 5, i32 21, i32 23, i32 10, i32 9, i32 25, i32 27, i32 14, i32 13, i32 29, i32 31>
735 ret <16 x float> %res
737 define <16 x float> @test_16xfloat_masked_shuff_mem_mask3(<16 x float> %vec1, <16 x float>* %vec2p, <16 x float> %vec3, <16 x float> %mask) {
738 ; CHECK-LABEL: test_16xfloat_masked_shuff_mem_mask3:
740 ; CHECK-NEXT: vxorps %xmm3, %xmm3, %xmm3
741 ; CHECK-NEXT: vcmpeqps %zmm3, %zmm2, %k1
742 ; CHECK-NEXT: vshufps {{.*#+}} zmm1 {%k1} = zmm0[2,1],mem[1,3],zmm0[6,5],mem[5,7],zmm0[10,9],mem[9,11],zmm0[14,13],mem[13,15]
743 ; CHECK-NEXT: vmovaps %zmm1, %zmm0
745 %vec2 = load <16 x float>, <16 x float>* %vec2p
746 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 2, i32 1, i32 17, i32 19, i32 6, i32 5, i32 21, i32 23, i32 10, i32 9, i32 25, i32 27, i32 14, i32 13, i32 29, i32 31>
747 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
748 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> %vec3
749 ret <16 x float> %res
752 define <16 x float> @test_16xfloat_zero_masked_shuff_mem_mask3(<16 x float> %vec1, <16 x float>* %vec2p, <16 x float> %mask) {
753 ; CHECK-LABEL: test_16xfloat_zero_masked_shuff_mem_mask3:
755 ; CHECK-NEXT: vxorps %xmm2, %xmm2, %xmm2
756 ; CHECK-NEXT: vcmpeqps %zmm2, %zmm1, %k1
757 ; CHECK-NEXT: vshufps {{.*#+}} zmm0 {%k1} {z} = zmm0[2,1],mem[1,3],zmm0[6,5],mem[5,7],zmm0[10,9],mem[9,11],zmm0[14,13],mem[13,15]
759 %vec2 = load <16 x float>, <16 x float>* %vec2p
760 %shuf = shufflevector <16 x float> %vec1, <16 x float> %vec2, <16 x i32> <i32 2, i32 1, i32 17, i32 19, i32 6, i32 5, i32 21, i32 23, i32 10, i32 9, i32 25, i32 27, i32 14, i32 13, i32 29, i32 31>
761 %cmp = fcmp oeq <16 x float> %mask, zeroinitializer
762 %res = select <16 x i1> %cmp, <16 x float> %shuf, <16 x float> zeroinitializer
763 ret <16 x float> %res
766 define <2 x double> @test_2xdouble_shuff_mask0(<2 x double> %vec1, <2 x double> %vec2) {
767 ; CHECK-LABEL: test_2xdouble_shuff_mask0:
769 ; CHECK-NEXT: vshufpd {{.*#+}} xmm0 = xmm0[1],xmm1[0]
771 %res = shufflevector <2 x double> %vec1, <2 x double> %vec2, <2 x i32> <i32 1, i32 2>
772 ret <2 x double> %res
774 define <2 x double> @test_2xdouble_masked_shuff_mask0(<2 x double> %vec1, <2 x double> %vec2, <2 x double> %vec3, <2 x double> %mask) {
775 ; CHECK-LABEL: test_2xdouble_masked_shuff_mask0:
777 ; CHECK-NEXT: vxorpd %xmm4, %xmm4, %xmm4
778 ; CHECK-NEXT: vcmpeqpd %xmm4, %xmm3, %k1
779 ; CHECK-NEXT: vshufpd {{.*#+}} xmm2 {%k1} = xmm0[1],xmm1[0]
780 ; CHECK-NEXT: vmovapd %xmm2, %xmm0
782 %shuf = shufflevector <2 x double> %vec1, <2 x double> %vec2, <2 x i32> <i32 1, i32 2>
783 %cmp = fcmp oeq <2 x double> %mask, zeroinitializer
784 %res = select <2 x i1> %cmp, <2 x double> %shuf, <2 x double> %vec3
785 ret <2 x double> %res
788 define <2 x double> @test_2xdouble_zero_masked_shuff_mask0(<2 x double> %vec1, <2 x double> %vec2, <2 x double> %mask) {
789 ; CHECK-LABEL: test_2xdouble_zero_masked_shuff_mask0:
791 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
792 ; CHECK-NEXT: vcmpeqpd %xmm3, %xmm2, %k1
793 ; CHECK-NEXT: vshufpd {{.*#+}} xmm0 {%k1} {z} = xmm0[1],xmm1[0]
795 %shuf = shufflevector <2 x double> %vec1, <2 x double> %vec2, <2 x i32> <i32 1, i32 2>
796 %cmp = fcmp oeq <2 x double> %mask, zeroinitializer
797 %res = select <2 x i1> %cmp, <2 x double> %shuf, <2 x double> zeroinitializer
798 ret <2 x double> %res
800 define <2 x double> @test_2xdouble_masked_shuff_mask1(<2 x double> %vec1, <2 x double> %vec2, <2 x double> %vec3, <2 x double> %mask) {
801 ; CHECK-LABEL: test_2xdouble_masked_shuff_mask1:
803 ; CHECK-NEXT: vxorpd %xmm4, %xmm4, %xmm4
804 ; CHECK-NEXT: vcmpeqpd %xmm4, %xmm3, %k1
805 ; CHECK-NEXT: vshufpd {{.*#+}} xmm2 {%k1} = xmm0[1],xmm1[0]
806 ; CHECK-NEXT: vmovapd %xmm2, %xmm0
808 %shuf = shufflevector <2 x double> %vec1, <2 x double> %vec2, <2 x i32> <i32 1, i32 2>
809 %cmp = fcmp oeq <2 x double> %mask, zeroinitializer
810 %res = select <2 x i1> %cmp, <2 x double> %shuf, <2 x double> %vec3
811 ret <2 x double> %res
814 define <2 x double> @test_2xdouble_zero_masked_shuff_mask1(<2 x double> %vec1, <2 x double> %vec2, <2 x double> %mask) {
815 ; CHECK-LABEL: test_2xdouble_zero_masked_shuff_mask1:
817 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
818 ; CHECK-NEXT: vcmpeqpd %xmm3, %xmm2, %k1
819 ; CHECK-NEXT: vshufpd {{.*#+}} xmm0 {%k1} {z} = xmm0[1],xmm1[0]
821 %shuf = shufflevector <2 x double> %vec1, <2 x double> %vec2, <2 x i32> <i32 1, i32 2>
822 %cmp = fcmp oeq <2 x double> %mask, zeroinitializer
823 %res = select <2 x i1> %cmp, <2 x double> %shuf, <2 x double> zeroinitializer
824 ret <2 x double> %res
826 define <2 x double> @test_2xdouble_shuff_mem_mask0(<2 x double> %vec1, <2 x double>* %vec2p) {
827 ; CHECK-LABEL: test_2xdouble_shuff_mem_mask0:
829 ; CHECK-NEXT: vshufpd {{.*#+}} xmm0 = xmm0[1],mem[0]
831 %vec2 = load <2 x double>, <2 x double>* %vec2p
832 %res = shufflevector <2 x double> %vec1, <2 x double> %vec2, <2 x i32> <i32 1, i32 2>
833 ret <2 x double> %res
835 define <2 x double> @test_2xdouble_masked_shuff_mem_mask0(<2 x double> %vec1, <2 x double>* %vec2p, <2 x double> %vec3, <2 x double> %mask) {
836 ; CHECK-LABEL: test_2xdouble_masked_shuff_mem_mask0:
838 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
839 ; CHECK-NEXT: vcmpeqpd %xmm3, %xmm2, %k1
840 ; CHECK-NEXT: vshufpd {{.*#+}} xmm1 {%k1} = xmm0[1],mem[0]
841 ; CHECK-NEXT: vmovapd %xmm1, %xmm0
843 %vec2 = load <2 x double>, <2 x double>* %vec2p
844 %shuf = shufflevector <2 x double> %vec1, <2 x double> %vec2, <2 x i32> <i32 1, i32 2>
845 %cmp = fcmp oeq <2 x double> %mask, zeroinitializer
846 %res = select <2 x i1> %cmp, <2 x double> %shuf, <2 x double> %vec3
847 ret <2 x double> %res
850 define <2 x double> @test_2xdouble_zero_masked_shuff_mem_mask0(<2 x double> %vec1, <2 x double>* %vec2p, <2 x double> %mask) {
851 ; CHECK-LABEL: test_2xdouble_zero_masked_shuff_mem_mask0:
853 ; CHECK-NEXT: vxorpd %xmm2, %xmm2, %xmm2
854 ; CHECK-NEXT: vcmpeqpd %xmm2, %xmm1, %k1
855 ; CHECK-NEXT: vshufpd {{.*#+}} xmm0 {%k1} {z} = xmm0[1],mem[0]
857 %vec2 = load <2 x double>, <2 x double>* %vec2p
858 %shuf = shufflevector <2 x double> %vec1, <2 x double> %vec2, <2 x i32> <i32 1, i32 2>
859 %cmp = fcmp oeq <2 x double> %mask, zeroinitializer
860 %res = select <2 x i1> %cmp, <2 x double> %shuf, <2 x double> zeroinitializer
861 ret <2 x double> %res
864 define <2 x double> @test_2xdouble_masked_shuff_mem_mask1(<2 x double> %vec1, <2 x double>* %vec2p, <2 x double> %vec3, <2 x double> %mask) {
865 ; CHECK-LABEL: test_2xdouble_masked_shuff_mem_mask1:
867 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
868 ; CHECK-NEXT: vcmpeqpd %xmm3, %xmm2, %k1
869 ; CHECK-NEXT: vshufpd {{.*#+}} xmm1 {%k1} = xmm0[1],mem[0]
870 ; CHECK-NEXT: vmovapd %xmm1, %xmm0
872 %vec2 = load <2 x double>, <2 x double>* %vec2p
873 %shuf = shufflevector <2 x double> %vec1, <2 x double> %vec2, <2 x i32> <i32 1, i32 2>
874 %cmp = fcmp oeq <2 x double> %mask, zeroinitializer
875 %res = select <2 x i1> %cmp, <2 x double> %shuf, <2 x double> %vec3
876 ret <2 x double> %res
879 define <2 x double> @test_2xdouble_zero_masked_shuff_mem_mask1(<2 x double> %vec1, <2 x double>* %vec2p, <2 x double> %mask) {
880 ; CHECK-LABEL: test_2xdouble_zero_masked_shuff_mem_mask1:
882 ; CHECK-NEXT: vxorpd %xmm2, %xmm2, %xmm2
883 ; CHECK-NEXT: vcmpeqpd %xmm2, %xmm1, %k1
884 ; CHECK-NEXT: vshufpd {{.*#+}} xmm0 {%k1} {z} = xmm0[1],mem[0]
886 %vec2 = load <2 x double>, <2 x double>* %vec2p
887 %shuf = shufflevector <2 x double> %vec1, <2 x double> %vec2, <2 x i32> <i32 1, i32 2>
888 %cmp = fcmp oeq <2 x double> %mask, zeroinitializer
889 %res = select <2 x i1> %cmp, <2 x double> %shuf, <2 x double> zeroinitializer
890 ret <2 x double> %res
893 define <4 x double> @test_4xdouble_shuff_mask0(<4 x double> %vec1, <4 x double> %vec2) {
894 ; CHECK-LABEL: test_4xdouble_shuff_mask0:
896 ; CHECK-NEXT: vshufpd {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[3],ymm1[3]
898 %res = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 0, i32 4, i32 3, i32 7>
899 ret <4 x double> %res
901 define <4 x double> @test_4xdouble_masked_shuff_mask0(<4 x double> %vec1, <4 x double> %vec2, <4 x double> %vec3, <4 x double> %mask) {
902 ; CHECK-LABEL: test_4xdouble_masked_shuff_mask0:
904 ; CHECK-NEXT: vxorpd %xmm4, %xmm4, %xmm4
905 ; CHECK-NEXT: vcmpeqpd %ymm4, %ymm3, %k1
906 ; CHECK-NEXT: vshufpd {{.*#+}} ymm2 {%k1} = ymm0[0],ymm1[0],ymm0[3],ymm1[3]
907 ; CHECK-NEXT: vmovapd %ymm2, %ymm0
909 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 0, i32 4, i32 3, i32 7>
910 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
911 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> %vec3
912 ret <4 x double> %res
915 define <4 x double> @test_4xdouble_zero_masked_shuff_mask0(<4 x double> %vec1, <4 x double> %vec2, <4 x double> %mask) {
916 ; CHECK-LABEL: test_4xdouble_zero_masked_shuff_mask0:
918 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
919 ; CHECK-NEXT: vcmpeqpd %ymm3, %ymm2, %k1
920 ; CHECK-NEXT: vshufpd {{.*#+}} ymm0 {%k1} {z} = ymm0[0],ymm1[0],ymm0[3],ymm1[3]
922 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 0, i32 4, i32 3, i32 7>
923 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
924 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> zeroinitializer
925 ret <4 x double> %res
927 define <4 x double> @test_4xdouble_masked_shuff_mask1(<4 x double> %vec1, <4 x double> %vec2, <4 x double> %vec3, <4 x double> %mask) {
928 ; CHECK-LABEL: test_4xdouble_masked_shuff_mask1:
930 ; CHECK-NEXT: vxorpd %xmm4, %xmm4, %xmm4
931 ; CHECK-NEXT: vcmpeqpd %ymm4, %ymm3, %k1
932 ; CHECK-NEXT: vshufpd {{.*#+}} ymm2 {%k1} = ymm0[0],ymm1[0],ymm0[3],ymm1[2]
933 ; CHECK-NEXT: vmovapd %ymm2, %ymm0
935 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 0, i32 4, i32 3, i32 6>
936 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
937 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> %vec3
938 ret <4 x double> %res
941 define <4 x double> @test_4xdouble_zero_masked_shuff_mask1(<4 x double> %vec1, <4 x double> %vec2, <4 x double> %mask) {
942 ; CHECK-LABEL: test_4xdouble_zero_masked_shuff_mask1:
944 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
945 ; CHECK-NEXT: vcmpeqpd %ymm3, %ymm2, %k1
946 ; CHECK-NEXT: vshufpd {{.*#+}} ymm0 {%k1} {z} = ymm0[0],ymm1[0],ymm0[3],ymm1[2]
948 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 0, i32 4, i32 3, i32 6>
949 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
950 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> zeroinitializer
951 ret <4 x double> %res
953 define <4 x double> @test_4xdouble_masked_shuff_mask2(<4 x double> %vec1, <4 x double> %vec2, <4 x double> %vec3, <4 x double> %mask) {
954 ; CHECK-LABEL: test_4xdouble_masked_shuff_mask2:
956 ; CHECK-NEXT: vxorpd %xmm4, %xmm4, %xmm4
957 ; CHECK-NEXT: vcmpeqpd %ymm4, %ymm3, %k1
958 ; CHECK-NEXT: vshufpd {{.*#+}} ymm2 {%k1} = ymm0[1],ymm1[0],ymm0[3],ymm1[2]
959 ; CHECK-NEXT: vmovapd %ymm2, %ymm0
961 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 1, i32 4, i32 3, i32 6>
962 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
963 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> %vec3
964 ret <4 x double> %res
967 define <4 x double> @test_4xdouble_zero_masked_shuff_mask2(<4 x double> %vec1, <4 x double> %vec2, <4 x double> %mask) {
968 ; CHECK-LABEL: test_4xdouble_zero_masked_shuff_mask2:
970 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
971 ; CHECK-NEXT: vcmpeqpd %ymm3, %ymm2, %k1
972 ; CHECK-NEXT: vshufpd {{.*#+}} ymm0 {%k1} {z} = ymm0[1],ymm1[0],ymm0[3],ymm1[2]
974 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 1, i32 4, i32 3, i32 6>
975 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
976 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> zeroinitializer
977 ret <4 x double> %res
979 define <4 x double> @test_4xdouble_shuff_mask3(<4 x double> %vec1, <4 x double> %vec2) {
980 ; CHECK-LABEL: test_4xdouble_shuff_mask3:
982 ; CHECK-NEXT: vshufpd {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[2],ymm1[3]
984 %res = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 0, i32 4, i32 2, i32 7>
985 ret <4 x double> %res
987 define <4 x double> @test_4xdouble_masked_shuff_mask3(<4 x double> %vec1, <4 x double> %vec2, <4 x double> %vec3, <4 x double> %mask) {
988 ; CHECK-LABEL: test_4xdouble_masked_shuff_mask3:
990 ; CHECK-NEXT: vxorpd %xmm4, %xmm4, %xmm4
991 ; CHECK-NEXT: vcmpeqpd %ymm4, %ymm3, %k1
992 ; CHECK-NEXT: vshufpd {{.*#+}} ymm2 {%k1} = ymm0[0],ymm1[0],ymm0[2],ymm1[3]
993 ; CHECK-NEXT: vmovapd %ymm2, %ymm0
995 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 0, i32 4, i32 2, i32 7>
996 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
997 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> %vec3
998 ret <4 x double> %res
1001 define <4 x double> @test_4xdouble_zero_masked_shuff_mask3(<4 x double> %vec1, <4 x double> %vec2, <4 x double> %mask) {
1002 ; CHECK-LABEL: test_4xdouble_zero_masked_shuff_mask3:
1004 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
1005 ; CHECK-NEXT: vcmpeqpd %ymm3, %ymm2, %k1
1006 ; CHECK-NEXT: vshufpd {{.*#+}} ymm0 {%k1} {z} = ymm0[0],ymm1[0],ymm0[2],ymm1[3]
1008 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 0, i32 4, i32 2, i32 7>
1009 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
1010 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> zeroinitializer
1011 ret <4 x double> %res
1013 define <4 x double> @test_4xdouble_shuff_mem_mask0(<4 x double> %vec1, <4 x double>* %vec2p) {
1014 ; CHECK-LABEL: test_4xdouble_shuff_mem_mask0:
1016 ; CHECK-NEXT: vshufpd {{.*#+}} ymm0 = ymm0[1],mem[1],ymm0[3],mem[2]
1018 %vec2 = load <4 x double>, <4 x double>* %vec2p
1019 %res = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 1, i32 5, i32 3, i32 6>
1020 ret <4 x double> %res
1022 define <4 x double> @test_4xdouble_masked_shuff_mem_mask0(<4 x double> %vec1, <4 x double>* %vec2p, <4 x double> %vec3, <4 x double> %mask) {
1023 ; CHECK-LABEL: test_4xdouble_masked_shuff_mem_mask0:
1025 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
1026 ; CHECK-NEXT: vcmpeqpd %ymm3, %ymm2, %k1
1027 ; CHECK-NEXT: vshufpd {{.*#+}} ymm1 {%k1} = ymm0[1],mem[1],ymm0[3],mem[2]
1028 ; CHECK-NEXT: vmovapd %ymm1, %ymm0
1030 %vec2 = load <4 x double>, <4 x double>* %vec2p
1031 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 1, i32 5, i32 3, i32 6>
1032 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
1033 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> %vec3
1034 ret <4 x double> %res
1037 define <4 x double> @test_4xdouble_zero_masked_shuff_mem_mask0(<4 x double> %vec1, <4 x double>* %vec2p, <4 x double> %mask) {
1038 ; CHECK-LABEL: test_4xdouble_zero_masked_shuff_mem_mask0:
1040 ; CHECK-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1041 ; CHECK-NEXT: vcmpeqpd %ymm2, %ymm1, %k1
1042 ; CHECK-NEXT: vshufpd {{.*#+}} ymm0 {%k1} {z} = ymm0[1],mem[1],ymm0[3],mem[2]
1044 %vec2 = load <4 x double>, <4 x double>* %vec2p
1045 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 1, i32 5, i32 3, i32 6>
1046 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
1047 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> zeroinitializer
1048 ret <4 x double> %res
1051 define <4 x double> @test_4xdouble_masked_shuff_mem_mask1(<4 x double> %vec1, <4 x double>* %vec2p, <4 x double> %vec3, <4 x double> %mask) {
1052 ; CHECK-LABEL: test_4xdouble_masked_shuff_mem_mask1:
1054 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
1055 ; CHECK-NEXT: vcmpeqpd %ymm3, %ymm2, %k1
1056 ; CHECK-NEXT: vshufpd {{.*#+}} ymm1 {%k1} = ymm0[0],mem[1],ymm0[2],mem[2]
1057 ; CHECK-NEXT: vmovapd %ymm1, %ymm0
1059 %vec2 = load <4 x double>, <4 x double>* %vec2p
1060 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 0, i32 5, i32 2, i32 6>
1061 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
1062 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> %vec3
1063 ret <4 x double> %res
1066 define <4 x double> @test_4xdouble_zero_masked_shuff_mem_mask1(<4 x double> %vec1, <4 x double>* %vec2p, <4 x double> %mask) {
1067 ; CHECK-LABEL: test_4xdouble_zero_masked_shuff_mem_mask1:
1069 ; CHECK-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1070 ; CHECK-NEXT: vcmpeqpd %ymm2, %ymm1, %k1
1071 ; CHECK-NEXT: vshufpd {{.*#+}} ymm0 {%k1} {z} = ymm0[0],mem[1],ymm0[2],mem[2]
1073 %vec2 = load <4 x double>, <4 x double>* %vec2p
1074 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 0, i32 5, i32 2, i32 6>
1075 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
1076 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> zeroinitializer
1077 ret <4 x double> %res
1080 define <4 x double> @test_4xdouble_masked_shuff_mem_mask2(<4 x double> %vec1, <4 x double>* %vec2p, <4 x double> %vec3, <4 x double> %mask) {
1081 ; CHECK-LABEL: test_4xdouble_masked_shuff_mem_mask2:
1083 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
1084 ; CHECK-NEXT: vcmpeqpd %ymm3, %ymm2, %k1
1085 ; CHECK-NEXT: vshufpd {{.*#+}} ymm1 {%k1} = ymm0[0],mem[0],ymm0[3],mem[2]
1086 ; CHECK-NEXT: vmovapd %ymm1, %ymm0
1088 %vec2 = load <4 x double>, <4 x double>* %vec2p
1089 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 0, i32 4, i32 3, i32 6>
1090 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
1091 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> %vec3
1092 ret <4 x double> %res
1095 define <4 x double> @test_4xdouble_zero_masked_shuff_mem_mask2(<4 x double> %vec1, <4 x double>* %vec2p, <4 x double> %mask) {
1096 ; CHECK-LABEL: test_4xdouble_zero_masked_shuff_mem_mask2:
1098 ; CHECK-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1099 ; CHECK-NEXT: vcmpeqpd %ymm2, %ymm1, %k1
1100 ; CHECK-NEXT: vshufpd {{.*#+}} ymm0 {%k1} {z} = ymm0[0],mem[0],ymm0[3],mem[2]
1102 %vec2 = load <4 x double>, <4 x double>* %vec2p
1103 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 0, i32 4, i32 3, i32 6>
1104 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
1105 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> zeroinitializer
1106 ret <4 x double> %res
1109 define <4 x double> @test_4xdouble_shuff_mem_mask3(<4 x double> %vec1, <4 x double>* %vec2p) {
1110 ; CHECK-LABEL: test_4xdouble_shuff_mem_mask3:
1112 ; CHECK-NEXT: vshufpd {{.*#+}} ymm0 = ymm0[1],mem[1],ymm0[2],mem[2]
1114 %vec2 = load <4 x double>, <4 x double>* %vec2p
1115 %res = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 1, i32 5, i32 2, i32 6>
1116 ret <4 x double> %res
1118 define <4 x double> @test_4xdouble_masked_shuff_mem_mask3(<4 x double> %vec1, <4 x double>* %vec2p, <4 x double> %vec3, <4 x double> %mask) {
1119 ; CHECK-LABEL: test_4xdouble_masked_shuff_mem_mask3:
1121 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
1122 ; CHECK-NEXT: vcmpeqpd %ymm3, %ymm2, %k1
1123 ; CHECK-NEXT: vshufpd {{.*#+}} ymm1 {%k1} = ymm0[1],mem[1],ymm0[2],mem[2]
1124 ; CHECK-NEXT: vmovapd %ymm1, %ymm0
1126 %vec2 = load <4 x double>, <4 x double>* %vec2p
1127 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 1, i32 5, i32 2, i32 6>
1128 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
1129 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> %vec3
1130 ret <4 x double> %res
1133 define <4 x double> @test_4xdouble_zero_masked_shuff_mem_mask3(<4 x double> %vec1, <4 x double>* %vec2p, <4 x double> %mask) {
1134 ; CHECK-LABEL: test_4xdouble_zero_masked_shuff_mem_mask3:
1136 ; CHECK-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1137 ; CHECK-NEXT: vcmpeqpd %ymm2, %ymm1, %k1
1138 ; CHECK-NEXT: vshufpd {{.*#+}} ymm0 {%k1} {z} = ymm0[1],mem[1],ymm0[2],mem[2]
1140 %vec2 = load <4 x double>, <4 x double>* %vec2p
1141 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 1, i32 5, i32 2, i32 6>
1142 %cmp = fcmp oeq <4 x double> %mask, zeroinitializer
1143 %res = select <4 x i1> %cmp, <4 x double> %shuf, <4 x double> zeroinitializer
1144 ret <4 x double> %res
1147 define <8 x double> @test_8xdouble_shuff_mask0(<8 x double> %vec1, <8 x double> %vec2) {
1148 ; CHECK-LABEL: test_8xdouble_shuff_mask0:
1150 ; CHECK-NEXT: vshufpd {{.*#+}} zmm0 = zmm0[0],zmm1[0],zmm0[2],zmm1[3],zmm0[4],zmm1[5],zmm0[7],zmm1[7]
1152 %res = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 0, i32 8, i32 2, i32 11, i32 4, i32 13, i32 7, i32 15>
1153 ret <8 x double> %res
1155 define <8 x double> @test_8xdouble_masked_shuff_mask0(<8 x double> %vec1, <8 x double> %vec2, <8 x double> %vec3, <8 x double> %mask) {
1156 ; CHECK-LABEL: test_8xdouble_masked_shuff_mask0:
1158 ; CHECK-NEXT: vxorpd %xmm4, %xmm4, %xmm4
1159 ; CHECK-NEXT: vcmpeqpd %zmm4, %zmm3, %k1
1160 ; CHECK-NEXT: vshufpd {{.*#+}} zmm2 {%k1} = zmm0[0],zmm1[0],zmm0[2],zmm1[3],zmm0[4],zmm1[5],zmm0[7],zmm1[7]
1161 ; CHECK-NEXT: vmovapd %zmm2, %zmm0
1163 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 0, i32 8, i32 2, i32 11, i32 4, i32 13, i32 7, i32 15>
1164 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1165 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> %vec3
1166 ret <8 x double> %res
1169 define <8 x double> @test_8xdouble_zero_masked_shuff_mask0(<8 x double> %vec1, <8 x double> %vec2, <8 x double> %mask) {
1170 ; CHECK-LABEL: test_8xdouble_zero_masked_shuff_mask0:
1172 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
1173 ; CHECK-NEXT: vcmpeqpd %zmm3, %zmm2, %k1
1174 ; CHECK-NEXT: vshufpd {{.*#+}} zmm0 {%k1} {z} = zmm0[0],zmm1[0],zmm0[2],zmm1[3],zmm0[4],zmm1[5],zmm0[7],zmm1[7]
1176 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 0, i32 8, i32 2, i32 11, i32 4, i32 13, i32 7, i32 15>
1177 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1178 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> zeroinitializer
1179 ret <8 x double> %res
1181 define <8 x double> @test_8xdouble_masked_shuff_mask1(<8 x double> %vec1, <8 x double> %vec2, <8 x double> %vec3, <8 x double> %mask) {
1182 ; CHECK-LABEL: test_8xdouble_masked_shuff_mask1:
1184 ; CHECK-NEXT: vxorpd %xmm4, %xmm4, %xmm4
1185 ; CHECK-NEXT: vcmpeqpd %zmm4, %zmm3, %k1
1186 ; CHECK-NEXT: vshufpd {{.*#+}} zmm2 {%k1} = zmm0[0],zmm1[0],zmm0[2],zmm1[3],zmm0[5],zmm1[5],zmm0[6],zmm1[7]
1187 ; CHECK-NEXT: vmovapd %zmm2, %zmm0
1189 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 0, i32 8, i32 2, i32 11, i32 5, i32 13, i32 6, i32 15>
1190 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1191 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> %vec3
1192 ret <8 x double> %res
1195 define <8 x double> @test_8xdouble_zero_masked_shuff_mask1(<8 x double> %vec1, <8 x double> %vec2, <8 x double> %mask) {
1196 ; CHECK-LABEL: test_8xdouble_zero_masked_shuff_mask1:
1198 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
1199 ; CHECK-NEXT: vcmpeqpd %zmm3, %zmm2, %k1
1200 ; CHECK-NEXT: vshufpd {{.*#+}} zmm0 {%k1} {z} = zmm0[0],zmm1[0],zmm0[2],zmm1[3],zmm0[5],zmm1[5],zmm0[6],zmm1[7]
1202 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 0, i32 8, i32 2, i32 11, i32 5, i32 13, i32 6, i32 15>
1203 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1204 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> zeroinitializer
1205 ret <8 x double> %res
1207 define <8 x double> @test_8xdouble_masked_shuff_mask2(<8 x double> %vec1, <8 x double> %vec2, <8 x double> %vec3, <8 x double> %mask) {
1208 ; CHECK-LABEL: test_8xdouble_masked_shuff_mask2:
1210 ; CHECK-NEXT: vxorpd %xmm4, %xmm4, %xmm4
1211 ; CHECK-NEXT: vcmpeqpd %zmm4, %zmm3, %k1
1212 ; CHECK-NEXT: vshufpd {{.*#+}} zmm2 {%k1} = zmm0[1],zmm1[0],zmm0[3],zmm1[3],zmm0[4],zmm1[5],zmm0[6],zmm1[6]
1213 ; CHECK-NEXT: vmovapd %zmm2, %zmm0
1215 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 1, i32 8, i32 3, i32 11, i32 4, i32 13, i32 6, i32 14>
1216 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1217 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> %vec3
1218 ret <8 x double> %res
1221 define <8 x double> @test_8xdouble_zero_masked_shuff_mask2(<8 x double> %vec1, <8 x double> %vec2, <8 x double> %mask) {
1222 ; CHECK-LABEL: test_8xdouble_zero_masked_shuff_mask2:
1224 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
1225 ; CHECK-NEXT: vcmpeqpd %zmm3, %zmm2, %k1
1226 ; CHECK-NEXT: vshufpd {{.*#+}} zmm0 {%k1} {z} = zmm0[1],zmm1[0],zmm0[3],zmm1[3],zmm0[4],zmm1[5],zmm0[6],zmm1[6]
1228 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 1, i32 8, i32 3, i32 11, i32 4, i32 13, i32 6, i32 14>
1229 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1230 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> zeroinitializer
1231 ret <8 x double> %res
1233 define <8 x double> @test_8xdouble_shuff_mask3(<8 x double> %vec1, <8 x double> %vec2) {
1234 ; CHECK-LABEL: test_8xdouble_shuff_mask3:
1236 ; CHECK-NEXT: vshufpd {{.*#+}} zmm0 = zmm0[1],zmm1[0],zmm0[3],zmm1[3],zmm0[4],zmm1[4],zmm0[7],zmm1[7]
1238 %res = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 1, i32 8, i32 3, i32 11, i32 4, i32 12, i32 7, i32 15>
1239 ret <8 x double> %res
1241 define <8 x double> @test_8xdouble_masked_shuff_mask3(<8 x double> %vec1, <8 x double> %vec2, <8 x double> %vec3, <8 x double> %mask) {
1242 ; CHECK-LABEL: test_8xdouble_masked_shuff_mask3:
1244 ; CHECK-NEXT: vxorpd %xmm4, %xmm4, %xmm4
1245 ; CHECK-NEXT: vcmpeqpd %zmm4, %zmm3, %k1
1246 ; CHECK-NEXT: vshufpd {{.*#+}} zmm2 {%k1} = zmm0[1],zmm1[0],zmm0[3],zmm1[3],zmm0[4],zmm1[4],zmm0[7],zmm1[7]
1247 ; CHECK-NEXT: vmovapd %zmm2, %zmm0
1249 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 1, i32 8, i32 3, i32 11, i32 4, i32 12, i32 7, i32 15>
1250 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1251 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> %vec3
1252 ret <8 x double> %res
1255 define <8 x double> @test_8xdouble_zero_masked_shuff_mask3(<8 x double> %vec1, <8 x double> %vec2, <8 x double> %mask) {
1256 ; CHECK-LABEL: test_8xdouble_zero_masked_shuff_mask3:
1258 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
1259 ; CHECK-NEXT: vcmpeqpd %zmm3, %zmm2, %k1
1260 ; CHECK-NEXT: vshufpd {{.*#+}} zmm0 {%k1} {z} = zmm0[1],zmm1[0],zmm0[3],zmm1[3],zmm0[4],zmm1[4],zmm0[7],zmm1[7]
1262 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 1, i32 8, i32 3, i32 11, i32 4, i32 12, i32 7, i32 15>
1263 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1264 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> zeroinitializer
1265 ret <8 x double> %res
1267 define <8 x double> @test_8xdouble_shuff_mem_mask0(<8 x double> %vec1, <8 x double>* %vec2p) {
1268 ; CHECK-LABEL: test_8xdouble_shuff_mem_mask0:
1270 ; CHECK-NEXT: vshufpd {{.*#+}} zmm0 = zmm0[0],mem[0],zmm0[2],mem[2],zmm0[5],mem[5],zmm0[6],mem[7]
1272 %vec2 = load <8 x double>, <8 x double>* %vec2p
1273 %res = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 0, i32 8, i32 2, i32 10, i32 5, i32 13, i32 6, i32 15>
1274 ret <8 x double> %res
1276 define <8 x double> @test_8xdouble_masked_shuff_mem_mask0(<8 x double> %vec1, <8 x double>* %vec2p, <8 x double> %vec3, <8 x double> %mask) {
1277 ; CHECK-LABEL: test_8xdouble_masked_shuff_mem_mask0:
1279 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
1280 ; CHECK-NEXT: vcmpeqpd %zmm3, %zmm2, %k1
1281 ; CHECK-NEXT: vshufpd {{.*#+}} zmm1 {%k1} = zmm0[0],mem[0],zmm0[2],mem[2],zmm0[5],mem[5],zmm0[6],mem[7]
1282 ; CHECK-NEXT: vmovapd %zmm1, %zmm0
1284 %vec2 = load <8 x double>, <8 x double>* %vec2p
1285 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 0, i32 8, i32 2, i32 10, i32 5, i32 13, i32 6, i32 15>
1286 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1287 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> %vec3
1288 ret <8 x double> %res
1291 define <8 x double> @test_8xdouble_zero_masked_shuff_mem_mask0(<8 x double> %vec1, <8 x double>* %vec2p, <8 x double> %mask) {
1292 ; CHECK-LABEL: test_8xdouble_zero_masked_shuff_mem_mask0:
1294 ; CHECK-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1295 ; CHECK-NEXT: vcmpeqpd %zmm2, %zmm1, %k1
1296 ; CHECK-NEXT: vshufpd {{.*#+}} zmm0 {%k1} {z} = zmm0[0],mem[0],zmm0[2],mem[2],zmm0[5],mem[5],zmm0[6],mem[7]
1298 %vec2 = load <8 x double>, <8 x double>* %vec2p
1299 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 0, i32 8, i32 2, i32 10, i32 5, i32 13, i32 6, i32 15>
1300 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1301 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> zeroinitializer
1302 ret <8 x double> %res
1305 define <8 x double> @test_8xdouble_masked_shuff_mem_mask1(<8 x double> %vec1, <8 x double>* %vec2p, <8 x double> %vec3, <8 x double> %mask) {
1306 ; CHECK-LABEL: test_8xdouble_masked_shuff_mem_mask1:
1308 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
1309 ; CHECK-NEXT: vcmpeqpd %zmm3, %zmm2, %k1
1310 ; CHECK-NEXT: vshufpd {{.*#+}} zmm1 {%k1} = zmm0[1],mem[0],zmm0[3],mem[2],zmm0[4],mem[4],zmm0[7],mem[7]
1311 ; CHECK-NEXT: vmovapd %zmm1, %zmm0
1313 %vec2 = load <8 x double>, <8 x double>* %vec2p
1314 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 1, i32 8, i32 3, i32 10, i32 4, i32 12, i32 7, i32 15>
1315 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1316 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> %vec3
1317 ret <8 x double> %res
1320 define <8 x double> @test_8xdouble_zero_masked_shuff_mem_mask1(<8 x double> %vec1, <8 x double>* %vec2p, <8 x double> %mask) {
1321 ; CHECK-LABEL: test_8xdouble_zero_masked_shuff_mem_mask1:
1323 ; CHECK-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1324 ; CHECK-NEXT: vcmpeqpd %zmm2, %zmm1, %k1
1325 ; CHECK-NEXT: vshufpd {{.*#+}} zmm0 {%k1} {z} = zmm0[1],mem[0],zmm0[3],mem[2],zmm0[4],mem[4],zmm0[7],mem[7]
1327 %vec2 = load <8 x double>, <8 x double>* %vec2p
1328 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 1, i32 8, i32 3, i32 10, i32 4, i32 12, i32 7, i32 15>
1329 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1330 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> zeroinitializer
1331 ret <8 x double> %res
1334 define <8 x double> @test_8xdouble_masked_shuff_mem_mask2(<8 x double> %vec1, <8 x double>* %vec2p, <8 x double> %vec3, <8 x double> %mask) {
1335 ; CHECK-LABEL: test_8xdouble_masked_shuff_mem_mask2:
1337 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
1338 ; CHECK-NEXT: vcmpeqpd %zmm3, %zmm2, %k1
1339 ; CHECK-NEXT: vshufpd {{.*#+}} zmm1 {%k1} = zmm0[1],mem[1],zmm0[3],mem[2],zmm0[5],mem[5],zmm0[7],mem[7]
1340 ; CHECK-NEXT: vmovapd %zmm1, %zmm0
1342 %vec2 = load <8 x double>, <8 x double>* %vec2p
1343 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 1, i32 9, i32 3, i32 10, i32 5, i32 13, i32 7, i32 15>
1344 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1345 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> %vec3
1346 ret <8 x double> %res
1349 define <8 x double> @test_8xdouble_zero_masked_shuff_mem_mask2(<8 x double> %vec1, <8 x double>* %vec2p, <8 x double> %mask) {
1350 ; CHECK-LABEL: test_8xdouble_zero_masked_shuff_mem_mask2:
1352 ; CHECK-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1353 ; CHECK-NEXT: vcmpeqpd %zmm2, %zmm1, %k1
1354 ; CHECK-NEXT: vshufpd {{.*#+}} zmm0 {%k1} {z} = zmm0[1],mem[1],zmm0[3],mem[2],zmm0[5],mem[5],zmm0[7],mem[7]
1356 %vec2 = load <8 x double>, <8 x double>* %vec2p
1357 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 1, i32 9, i32 3, i32 10, i32 5, i32 13, i32 7, i32 15>
1358 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1359 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> zeroinitializer
1360 ret <8 x double> %res
1363 define <8 x double> @test_8xdouble_shuff_mem_mask3(<8 x double> %vec1, <8 x double>* %vec2p) {
1364 ; CHECK-LABEL: test_8xdouble_shuff_mem_mask3:
1366 ; CHECK-NEXT: vshufpd {{.*#+}} zmm0 = zmm0[1],mem[1],zmm0[2],mem[3],zmm0[4],mem[5],zmm0[6],mem[6]
1368 %vec2 = load <8 x double>, <8 x double>* %vec2p
1369 %res = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 1, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 14>
1370 ret <8 x double> %res
1372 define <8 x double> @test_8xdouble_masked_shuff_mem_mask3(<8 x double> %vec1, <8 x double>* %vec2p, <8 x double> %vec3, <8 x double> %mask) {
1373 ; CHECK-LABEL: test_8xdouble_masked_shuff_mem_mask3:
1375 ; CHECK-NEXT: vxorpd %xmm3, %xmm3, %xmm3
1376 ; CHECK-NEXT: vcmpeqpd %zmm3, %zmm2, %k1
1377 ; CHECK-NEXT: vshufpd {{.*#+}} zmm1 {%k1} = zmm0[1],mem[1],zmm0[2],mem[3],zmm0[4],mem[5],zmm0[6],mem[6]
1378 ; CHECK-NEXT: vmovapd %zmm1, %zmm0
1380 %vec2 = load <8 x double>, <8 x double>* %vec2p
1381 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 1, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 14>
1382 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1383 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> %vec3
1384 ret <8 x double> %res
1387 define <8 x double> @test_8xdouble_zero_masked_shuff_mem_mask3(<8 x double> %vec1, <8 x double>* %vec2p, <8 x double> %mask) {
1388 ; CHECK-LABEL: test_8xdouble_zero_masked_shuff_mem_mask3:
1390 ; CHECK-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1391 ; CHECK-NEXT: vcmpeqpd %zmm2, %zmm1, %k1
1392 ; CHECK-NEXT: vshufpd {{.*#+}} zmm0 {%k1} {z} = zmm0[1],mem[1],zmm0[2],mem[3],zmm0[4],mem[5],zmm0[6],mem[6]
1394 %vec2 = load <8 x double>, <8 x double>* %vec2p
1395 %shuf = shufflevector <8 x double> %vec1, <8 x double> %vec2, <8 x i32> <i32 1, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 14>
1396 %cmp = fcmp oeq <8 x double> %mask, zeroinitializer
1397 %res = select <8 x i1> %cmp, <8 x double> %shuf, <8 x double> zeroinitializer
1398 ret <8 x double> %res