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,+avx512bw %s -o - | FileCheck %s
4 define <16 x i8> @test_i8_to_16(i8 %s) {
5 ; CHECK-LABEL: test_i8_to_16:
7 ; CHECK-NEXT: vpbroadcastb %edi, %xmm0
9 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
10 %res = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
13 define <16 x i8> @test_masked_i8_to_16_mask0(i8 %s, <16 x i8> %default, <16 x i8> %mask) {
14 ; CHECK-LABEL: test_masked_i8_to_16_mask0:
16 ; CHECK-NEXT: vptestnmb %xmm1, %xmm1, %k1
17 ; CHECK-NEXT: vpbroadcastb %edi, %xmm0 {%k1}
19 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
20 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
21 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
22 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> %default
26 define <16 x i8> @test_masked_z_i8_to_16_mask0(i8 %s, <16 x i8> %mask) {
27 ; CHECK-LABEL: test_masked_z_i8_to_16_mask0:
29 ; CHECK-NEXT: vptestnmb %xmm0, %xmm0, %k1
30 ; CHECK-NEXT: vpbroadcastb %edi, %xmm0 {%k1} {z}
32 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
33 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
34 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
35 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> zeroinitializer
38 define <16 x i8> @test_masked_i8_to_16_mask1(i8 %s, <16 x i8> %default, <16 x i8> %mask) {
39 ; CHECK-LABEL: test_masked_i8_to_16_mask1:
41 ; CHECK-NEXT: vptestnmb %xmm1, %xmm1, %k1
42 ; CHECK-NEXT: vpbroadcastb %edi, %xmm0 {%k1}
44 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
45 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
46 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
47 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> %default
51 define <16 x i8> @test_masked_z_i8_to_16_mask1(i8 %s, <16 x i8> %mask) {
52 ; CHECK-LABEL: test_masked_z_i8_to_16_mask1:
54 ; CHECK-NEXT: vptestnmb %xmm0, %xmm0, %k1
55 ; CHECK-NEXT: vpbroadcastb %edi, %xmm0 {%k1} {z}
57 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
58 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
59 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
60 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> zeroinitializer
63 define <16 x i8> @test_masked_i8_to_16_mask2(i8 %s, <16 x i8> %default, <16 x i8> %mask) {
64 ; CHECK-LABEL: test_masked_i8_to_16_mask2:
66 ; CHECK-NEXT: vptestnmb %xmm1, %xmm1, %k1
67 ; CHECK-NEXT: vpbroadcastb %edi, %xmm0 {%k1}
69 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
70 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
71 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
72 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> %default
76 define <16 x i8> @test_masked_z_i8_to_16_mask2(i8 %s, <16 x i8> %mask) {
77 ; CHECK-LABEL: test_masked_z_i8_to_16_mask2:
79 ; CHECK-NEXT: vptestnmb %xmm0, %xmm0, %k1
80 ; CHECK-NEXT: vpbroadcastb %edi, %xmm0 {%k1} {z}
82 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
83 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
84 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
85 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> zeroinitializer
88 define <16 x i8> @test_masked_i8_to_16_mask3(i8 %s, <16 x i8> %default, <16 x i8> %mask) {
89 ; CHECK-LABEL: test_masked_i8_to_16_mask3:
91 ; CHECK-NEXT: vptestnmb %xmm1, %xmm1, %k1
92 ; CHECK-NEXT: vpbroadcastb %edi, %xmm0 {%k1}
94 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
95 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
96 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
97 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> %default
101 define <16 x i8> @test_masked_z_i8_to_16_mask3(i8 %s, <16 x i8> %mask) {
102 ; CHECK-LABEL: test_masked_z_i8_to_16_mask3:
104 ; CHECK-NEXT: vptestnmb %xmm0, %xmm0, %k1
105 ; CHECK-NEXT: vpbroadcastb %edi, %xmm0 {%k1} {z}
107 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
108 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
109 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
110 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> zeroinitializer
113 define <32 x i8> @test_i8_to_32(i8 %s) {
114 ; CHECK-LABEL: test_i8_to_32:
116 ; CHECK-NEXT: vpbroadcastb %edi, %ymm0
118 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
119 %res = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
122 define <32 x i8> @test_masked_i8_to_32_mask0(i8 %s, <32 x i8> %default, <32 x i8> %mask) {
123 ; CHECK-LABEL: test_masked_i8_to_32_mask0:
125 ; CHECK-NEXT: vptestnmb %ymm1, %ymm1, %k1
126 ; CHECK-NEXT: vpbroadcastb %edi, %ymm0 {%k1}
128 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
129 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
130 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
131 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> %default
135 define <32 x i8> @test_masked_z_i8_to_32_mask0(i8 %s, <32 x i8> %mask) {
136 ; CHECK-LABEL: test_masked_z_i8_to_32_mask0:
138 ; CHECK-NEXT: vptestnmb %ymm0, %ymm0, %k1
139 ; CHECK-NEXT: vpbroadcastb %edi, %ymm0 {%k1} {z}
141 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
142 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
143 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
144 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> zeroinitializer
147 define <32 x i8> @test_masked_i8_to_32_mask1(i8 %s, <32 x i8> %default, <32 x i8> %mask) {
148 ; CHECK-LABEL: test_masked_i8_to_32_mask1:
150 ; CHECK-NEXT: vptestnmb %ymm1, %ymm1, %k1
151 ; CHECK-NEXT: vpbroadcastb %edi, %ymm0 {%k1}
153 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
154 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
155 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
156 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> %default
160 define <32 x i8> @test_masked_z_i8_to_32_mask1(i8 %s, <32 x i8> %mask) {
161 ; CHECK-LABEL: test_masked_z_i8_to_32_mask1:
163 ; CHECK-NEXT: vptestnmb %ymm0, %ymm0, %k1
164 ; CHECK-NEXT: vpbroadcastb %edi, %ymm0 {%k1} {z}
166 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
167 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
168 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
169 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> zeroinitializer
172 define <32 x i8> @test_masked_i8_to_32_mask2(i8 %s, <32 x i8> %default, <32 x i8> %mask) {
173 ; CHECK-LABEL: test_masked_i8_to_32_mask2:
175 ; CHECK-NEXT: vptestnmb %ymm1, %ymm1, %k1
176 ; CHECK-NEXT: vpbroadcastb %edi, %ymm0 {%k1}
178 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
179 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
180 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
181 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> %default
185 define <32 x i8> @test_masked_z_i8_to_32_mask2(i8 %s, <32 x i8> %mask) {
186 ; CHECK-LABEL: test_masked_z_i8_to_32_mask2:
188 ; CHECK-NEXT: vptestnmb %ymm0, %ymm0, %k1
189 ; CHECK-NEXT: vpbroadcastb %edi, %ymm0 {%k1} {z}
191 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
192 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
193 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
194 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> zeroinitializer
197 define <32 x i8> @test_masked_i8_to_32_mask3(i8 %s, <32 x i8> %default, <32 x i8> %mask) {
198 ; CHECK-LABEL: test_masked_i8_to_32_mask3:
200 ; CHECK-NEXT: vptestnmb %ymm1, %ymm1, %k1
201 ; CHECK-NEXT: vpbroadcastb %edi, %ymm0 {%k1}
203 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
204 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
205 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
206 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> %default
210 define <32 x i8> @test_masked_z_i8_to_32_mask3(i8 %s, <32 x i8> %mask) {
211 ; CHECK-LABEL: test_masked_z_i8_to_32_mask3:
213 ; CHECK-NEXT: vptestnmb %ymm0, %ymm0, %k1
214 ; CHECK-NEXT: vpbroadcastb %edi, %ymm0 {%k1} {z}
216 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
217 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
218 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
219 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> zeroinitializer
222 define <64 x i8> @test_i8_to_64(i8 %s) {
223 ; CHECK-LABEL: test_i8_to_64:
225 ; CHECK-NEXT: vpbroadcastb %edi, %zmm0
227 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
228 %res = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
231 define <64 x i8> @test_masked_i8_to_64_mask0(i8 %s, <64 x i8> %default, <64 x i8> %mask) {
232 ; CHECK-LABEL: test_masked_i8_to_64_mask0:
234 ; CHECK-NEXT: vptestnmb %zmm1, %zmm1, %k1
235 ; CHECK-NEXT: vpbroadcastb %edi, %zmm0 {%k1}
237 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
238 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
239 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
240 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> %default
244 define <64 x i8> @test_masked_z_i8_to_64_mask0(i8 %s, <64 x i8> %mask) {
245 ; CHECK-LABEL: test_masked_z_i8_to_64_mask0:
247 ; CHECK-NEXT: vptestnmb %zmm0, %zmm0, %k1
248 ; CHECK-NEXT: vpbroadcastb %edi, %zmm0 {%k1} {z}
250 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
251 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
252 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
253 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> zeroinitializer
256 define <64 x i8> @test_masked_i8_to_64_mask1(i8 %s, <64 x i8> %default, <64 x i8> %mask) {
257 ; CHECK-LABEL: test_masked_i8_to_64_mask1:
259 ; CHECK-NEXT: vptestnmb %zmm1, %zmm1, %k1
260 ; CHECK-NEXT: vpbroadcastb %edi, %zmm0 {%k1}
262 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
263 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
264 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
265 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> %default
269 define <64 x i8> @test_masked_z_i8_to_64_mask1(i8 %s, <64 x i8> %mask) {
270 ; CHECK-LABEL: test_masked_z_i8_to_64_mask1:
272 ; CHECK-NEXT: vptestnmb %zmm0, %zmm0, %k1
273 ; CHECK-NEXT: vpbroadcastb %edi, %zmm0 {%k1} {z}
275 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
276 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
277 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
278 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> zeroinitializer
281 define <64 x i8> @test_masked_i8_to_64_mask2(i8 %s, <64 x i8> %default, <64 x i8> %mask) {
282 ; CHECK-LABEL: test_masked_i8_to_64_mask2:
284 ; CHECK-NEXT: vptestnmb %zmm1, %zmm1, %k1
285 ; CHECK-NEXT: vpbroadcastb %edi, %zmm0 {%k1}
287 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
288 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
289 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
290 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> %default
294 define <64 x i8> @test_masked_z_i8_to_64_mask2(i8 %s, <64 x i8> %mask) {
295 ; CHECK-LABEL: test_masked_z_i8_to_64_mask2:
297 ; CHECK-NEXT: vptestnmb %zmm0, %zmm0, %k1
298 ; CHECK-NEXT: vpbroadcastb %edi, %zmm0 {%k1} {z}
300 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
301 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
302 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
303 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> zeroinitializer
306 define <64 x i8> @test_masked_i8_to_64_mask3(i8 %s, <64 x i8> %default, <64 x i8> %mask) {
307 ; CHECK-LABEL: test_masked_i8_to_64_mask3:
309 ; CHECK-NEXT: vptestnmb %zmm1, %zmm1, %k1
310 ; CHECK-NEXT: vpbroadcastb %edi, %zmm0 {%k1}
312 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
313 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
314 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
315 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> %default
319 define <64 x i8> @test_masked_z_i8_to_64_mask3(i8 %s, <64 x i8> %mask) {
320 ; CHECK-LABEL: test_masked_z_i8_to_64_mask3:
322 ; CHECK-NEXT: vptestnmb %zmm0, %zmm0, %k1
323 ; CHECK-NEXT: vpbroadcastb %edi, %zmm0 {%k1} {z}
325 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
326 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
327 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
328 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> zeroinitializer
331 define <8 x i16> @test_i16_to_8(i16 %s) {
332 ; CHECK-LABEL: test_i16_to_8:
334 ; CHECK-NEXT: vpbroadcastw %edi, %xmm0
336 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
337 %res = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
340 define <8 x i16> @test_masked_i16_to_8_mask0(i16 %s, <8 x i16> %default, <8 x i16> %mask) {
341 ; CHECK-LABEL: test_masked_i16_to_8_mask0:
343 ; CHECK-NEXT: vptestnmw %xmm1, %xmm1, %k1
344 ; CHECK-NEXT: vpbroadcastw %edi, %xmm0 {%k1}
346 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
347 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
348 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
349 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> %default
353 define <8 x i16> @test_masked_z_i16_to_8_mask0(i16 %s, <8 x i16> %mask) {
354 ; CHECK-LABEL: test_masked_z_i16_to_8_mask0:
356 ; CHECK-NEXT: vptestnmw %xmm0, %xmm0, %k1
357 ; CHECK-NEXT: vpbroadcastw %edi, %xmm0 {%k1} {z}
359 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
360 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
361 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
362 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> zeroinitializer
365 define <8 x i16> @test_masked_i16_to_8_mask1(i16 %s, <8 x i16> %default, <8 x i16> %mask) {
366 ; CHECK-LABEL: test_masked_i16_to_8_mask1:
368 ; CHECK-NEXT: vptestnmw %xmm1, %xmm1, %k1
369 ; CHECK-NEXT: vpbroadcastw %edi, %xmm0 {%k1}
371 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
372 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
373 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
374 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> %default
378 define <8 x i16> @test_masked_z_i16_to_8_mask1(i16 %s, <8 x i16> %mask) {
379 ; CHECK-LABEL: test_masked_z_i16_to_8_mask1:
381 ; CHECK-NEXT: vptestnmw %xmm0, %xmm0, %k1
382 ; CHECK-NEXT: vpbroadcastw %edi, %xmm0 {%k1} {z}
384 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
385 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
386 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
387 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> zeroinitializer
390 define <8 x i16> @test_masked_i16_to_8_mask2(i16 %s, <8 x i16> %default, <8 x i16> %mask) {
391 ; CHECK-LABEL: test_masked_i16_to_8_mask2:
393 ; CHECK-NEXT: vptestnmw %xmm1, %xmm1, %k1
394 ; CHECK-NEXT: vpbroadcastw %edi, %xmm0 {%k1}
396 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
397 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
398 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
399 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> %default
403 define <8 x i16> @test_masked_z_i16_to_8_mask2(i16 %s, <8 x i16> %mask) {
404 ; CHECK-LABEL: test_masked_z_i16_to_8_mask2:
406 ; CHECK-NEXT: vptestnmw %xmm0, %xmm0, %k1
407 ; CHECK-NEXT: vpbroadcastw %edi, %xmm0 {%k1} {z}
409 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
410 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
411 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
412 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> zeroinitializer
415 define <8 x i16> @test_masked_i16_to_8_mask3(i16 %s, <8 x i16> %default, <8 x i16> %mask) {
416 ; CHECK-LABEL: test_masked_i16_to_8_mask3:
418 ; CHECK-NEXT: vptestnmw %xmm1, %xmm1, %k1
419 ; CHECK-NEXT: vpbroadcastw %edi, %xmm0 {%k1}
421 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
422 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
423 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
424 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> %default
428 define <8 x i16> @test_masked_z_i16_to_8_mask3(i16 %s, <8 x i16> %mask) {
429 ; CHECK-LABEL: test_masked_z_i16_to_8_mask3:
431 ; CHECK-NEXT: vptestnmw %xmm0, %xmm0, %k1
432 ; CHECK-NEXT: vpbroadcastw %edi, %xmm0 {%k1} {z}
434 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
435 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
436 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
437 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> zeroinitializer
440 define <16 x i16> @test_i16_to_16(i16 %s) {
441 ; CHECK-LABEL: test_i16_to_16:
443 ; CHECK-NEXT: vpbroadcastw %edi, %ymm0
445 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
446 %res = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
449 define <16 x i16> @test_masked_i16_to_16_mask0(i16 %s, <16 x i16> %default, <16 x i16> %mask) {
450 ; CHECK-LABEL: test_masked_i16_to_16_mask0:
452 ; CHECK-NEXT: vptestnmw %ymm1, %ymm1, %k1
453 ; CHECK-NEXT: vpbroadcastw %edi, %ymm0 {%k1}
455 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
456 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
457 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
458 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> %default
462 define <16 x i16> @test_masked_z_i16_to_16_mask0(i16 %s, <16 x i16> %mask) {
463 ; CHECK-LABEL: test_masked_z_i16_to_16_mask0:
465 ; CHECK-NEXT: vptestnmw %ymm0, %ymm0, %k1
466 ; CHECK-NEXT: vpbroadcastw %edi, %ymm0 {%k1} {z}
468 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
469 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
470 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
471 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> zeroinitializer
474 define <16 x i16> @test_masked_i16_to_16_mask1(i16 %s, <16 x i16> %default, <16 x i16> %mask) {
475 ; CHECK-LABEL: test_masked_i16_to_16_mask1:
477 ; CHECK-NEXT: vptestnmw %ymm1, %ymm1, %k1
478 ; CHECK-NEXT: vpbroadcastw %edi, %ymm0 {%k1}
480 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
481 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
482 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
483 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> %default
487 define <16 x i16> @test_masked_z_i16_to_16_mask1(i16 %s, <16 x i16> %mask) {
488 ; CHECK-LABEL: test_masked_z_i16_to_16_mask1:
490 ; CHECK-NEXT: vptestnmw %ymm0, %ymm0, %k1
491 ; CHECK-NEXT: vpbroadcastw %edi, %ymm0 {%k1} {z}
493 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
494 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
495 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
496 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> zeroinitializer
499 define <16 x i16> @test_masked_i16_to_16_mask2(i16 %s, <16 x i16> %default, <16 x i16> %mask) {
500 ; CHECK-LABEL: test_masked_i16_to_16_mask2:
502 ; CHECK-NEXT: vptestnmw %ymm1, %ymm1, %k1
503 ; CHECK-NEXT: vpbroadcastw %edi, %ymm0 {%k1}
505 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
506 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
507 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
508 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> %default
512 define <16 x i16> @test_masked_z_i16_to_16_mask2(i16 %s, <16 x i16> %mask) {
513 ; CHECK-LABEL: test_masked_z_i16_to_16_mask2:
515 ; CHECK-NEXT: vptestnmw %ymm0, %ymm0, %k1
516 ; CHECK-NEXT: vpbroadcastw %edi, %ymm0 {%k1} {z}
518 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
519 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
520 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
521 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> zeroinitializer
524 define <16 x i16> @test_masked_i16_to_16_mask3(i16 %s, <16 x i16> %default, <16 x i16> %mask) {
525 ; CHECK-LABEL: test_masked_i16_to_16_mask3:
527 ; CHECK-NEXT: vptestnmw %ymm1, %ymm1, %k1
528 ; CHECK-NEXT: vpbroadcastw %edi, %ymm0 {%k1}
530 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
531 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
532 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
533 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> %default
537 define <16 x i16> @test_masked_z_i16_to_16_mask3(i16 %s, <16 x i16> %mask) {
538 ; CHECK-LABEL: test_masked_z_i16_to_16_mask3:
540 ; CHECK-NEXT: vptestnmw %ymm0, %ymm0, %k1
541 ; CHECK-NEXT: vpbroadcastw %edi, %ymm0 {%k1} {z}
543 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
544 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
545 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
546 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> zeroinitializer
549 define <32 x i16> @test_i16_to_32(i16 %s) {
550 ; CHECK-LABEL: test_i16_to_32:
552 ; CHECK-NEXT: vpbroadcastw %edi, %zmm0
554 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
555 %res = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
558 define <32 x i16> @test_masked_i16_to_32_mask0(i16 %s, <32 x i16> %default, <32 x i16> %mask) {
559 ; CHECK-LABEL: test_masked_i16_to_32_mask0:
561 ; CHECK-NEXT: vptestnmw %zmm1, %zmm1, %k1
562 ; CHECK-NEXT: vpbroadcastw %edi, %zmm0 {%k1}
564 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
565 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
566 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
567 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> %default
571 define <32 x i16> @test_masked_z_i16_to_32_mask0(i16 %s, <32 x i16> %mask) {
572 ; CHECK-LABEL: test_masked_z_i16_to_32_mask0:
574 ; CHECK-NEXT: vptestnmw %zmm0, %zmm0, %k1
575 ; CHECK-NEXT: vpbroadcastw %edi, %zmm0 {%k1} {z}
577 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
578 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
579 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
580 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> zeroinitializer
583 define <32 x i16> @test_masked_i16_to_32_mask1(i16 %s, <32 x i16> %default, <32 x i16> %mask) {
584 ; CHECK-LABEL: test_masked_i16_to_32_mask1:
586 ; CHECK-NEXT: vptestnmw %zmm1, %zmm1, %k1
587 ; CHECK-NEXT: vpbroadcastw %edi, %zmm0 {%k1}
589 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
590 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
591 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
592 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> %default
596 define <32 x i16> @test_masked_z_i16_to_32_mask1(i16 %s, <32 x i16> %mask) {
597 ; CHECK-LABEL: test_masked_z_i16_to_32_mask1:
599 ; CHECK-NEXT: vptestnmw %zmm0, %zmm0, %k1
600 ; CHECK-NEXT: vpbroadcastw %edi, %zmm0 {%k1} {z}
602 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
603 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
604 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
605 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> zeroinitializer
608 define <32 x i16> @test_masked_i16_to_32_mask2(i16 %s, <32 x i16> %default, <32 x i16> %mask) {
609 ; CHECK-LABEL: test_masked_i16_to_32_mask2:
611 ; CHECK-NEXT: vptestnmw %zmm1, %zmm1, %k1
612 ; CHECK-NEXT: vpbroadcastw %edi, %zmm0 {%k1}
614 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
615 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
616 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
617 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> %default
621 define <32 x i16> @test_masked_z_i16_to_32_mask2(i16 %s, <32 x i16> %mask) {
622 ; CHECK-LABEL: test_masked_z_i16_to_32_mask2:
624 ; CHECK-NEXT: vptestnmw %zmm0, %zmm0, %k1
625 ; CHECK-NEXT: vpbroadcastw %edi, %zmm0 {%k1} {z}
627 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
628 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
629 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
630 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> zeroinitializer
633 define <32 x i16> @test_masked_i16_to_32_mask3(i16 %s, <32 x i16> %default, <32 x i16> %mask) {
634 ; CHECK-LABEL: test_masked_i16_to_32_mask3:
636 ; CHECK-NEXT: vptestnmw %zmm1, %zmm1, %k1
637 ; CHECK-NEXT: vpbroadcastw %edi, %zmm0 {%k1}
639 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
640 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
641 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
642 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> %default
646 define <32 x i16> @test_masked_z_i16_to_32_mask3(i16 %s, <32 x i16> %mask) {
647 ; CHECK-LABEL: test_masked_z_i16_to_32_mask3:
649 ; CHECK-NEXT: vptestnmw %zmm0, %zmm0, %k1
650 ; CHECK-NEXT: vpbroadcastw %edi, %zmm0 {%k1} {z}
652 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
653 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
654 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
655 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> zeroinitializer
658 define <4 x i32> @test_i32_to_4(i32 %s) {
659 ; CHECK-LABEL: test_i32_to_4:
661 ; CHECK-NEXT: vpbroadcastd %edi, %xmm0
663 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
664 %res = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
667 define <4 x i32> @test_masked_i32_to_4_mask0(i32 %s, <4 x i32> %default, <4 x i32> %mask) {
668 ; CHECK-LABEL: test_masked_i32_to_4_mask0:
670 ; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
671 ; CHECK-NEXT: vpbroadcastd %edi, %xmm0 {%k1}
673 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
674 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
675 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
676 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
680 define <4 x i32> @test_masked_z_i32_to_4_mask0(i32 %s, <4 x i32> %mask) {
681 ; CHECK-LABEL: test_masked_z_i32_to_4_mask0:
683 ; CHECK-NEXT: vptestnmd %xmm0, %xmm0, %k1
684 ; CHECK-NEXT: vpbroadcastd %edi, %xmm0 {%k1} {z}
686 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
687 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
688 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
689 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
692 define <4 x i32> @test_masked_i32_to_4_mask1(i32 %s, <4 x i32> %default, <4 x i32> %mask) {
693 ; CHECK-LABEL: test_masked_i32_to_4_mask1:
695 ; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
696 ; CHECK-NEXT: vpbroadcastd %edi, %xmm0 {%k1}
698 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
699 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
700 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
701 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
705 define <4 x i32> @test_masked_z_i32_to_4_mask1(i32 %s, <4 x i32> %mask) {
706 ; CHECK-LABEL: test_masked_z_i32_to_4_mask1:
708 ; CHECK-NEXT: vptestnmd %xmm0, %xmm0, %k1
709 ; CHECK-NEXT: vpbroadcastd %edi, %xmm0 {%k1} {z}
711 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
712 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
713 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
714 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
717 define <4 x i32> @test_masked_i32_to_4_mask2(i32 %s, <4 x i32> %default, <4 x i32> %mask) {
718 ; CHECK-LABEL: test_masked_i32_to_4_mask2:
720 ; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
721 ; CHECK-NEXT: vpbroadcastd %edi, %xmm0 {%k1}
723 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
724 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
725 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
726 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
730 define <4 x i32> @test_masked_z_i32_to_4_mask2(i32 %s, <4 x i32> %mask) {
731 ; CHECK-LABEL: test_masked_z_i32_to_4_mask2:
733 ; CHECK-NEXT: vptestnmd %xmm0, %xmm0, %k1
734 ; CHECK-NEXT: vpbroadcastd %edi, %xmm0 {%k1} {z}
736 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
737 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
738 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
739 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
742 define <4 x i32> @test_masked_i32_to_4_mask3(i32 %s, <4 x i32> %default, <4 x i32> %mask) {
743 ; CHECK-LABEL: test_masked_i32_to_4_mask3:
745 ; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
746 ; CHECK-NEXT: vpbroadcastd %edi, %xmm0 {%k1}
748 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
749 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
750 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
751 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
755 define <4 x i32> @test_masked_z_i32_to_4_mask3(i32 %s, <4 x i32> %mask) {
756 ; CHECK-LABEL: test_masked_z_i32_to_4_mask3:
758 ; CHECK-NEXT: vptestnmd %xmm0, %xmm0, %k1
759 ; CHECK-NEXT: vpbroadcastd %edi, %xmm0 {%k1} {z}
761 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
762 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
763 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
764 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
767 define <8 x i32> @test_i32_to_8(i32 %s) {
768 ; CHECK-LABEL: test_i32_to_8:
770 ; CHECK-NEXT: vpbroadcastd %edi, %ymm0
772 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
773 %res = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
776 define <8 x i32> @test_masked_i32_to_8_mask0(i32 %s, <8 x i32> %default, <8 x i32> %mask) {
777 ; CHECK-LABEL: test_masked_i32_to_8_mask0:
779 ; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
780 ; CHECK-NEXT: vpbroadcastd %edi, %ymm0 {%k1}
782 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
783 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
784 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
785 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
789 define <8 x i32> @test_masked_z_i32_to_8_mask0(i32 %s, <8 x i32> %mask) {
790 ; CHECK-LABEL: test_masked_z_i32_to_8_mask0:
792 ; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
793 ; CHECK-NEXT: vpbroadcastd %edi, %ymm0 {%k1} {z}
795 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
796 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
797 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
798 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
801 define <8 x i32> @test_masked_i32_to_8_mask1(i32 %s, <8 x i32> %default, <8 x i32> %mask) {
802 ; CHECK-LABEL: test_masked_i32_to_8_mask1:
804 ; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
805 ; CHECK-NEXT: vpbroadcastd %edi, %ymm0 {%k1}
807 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
808 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
809 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
810 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
814 define <8 x i32> @test_masked_z_i32_to_8_mask1(i32 %s, <8 x i32> %mask) {
815 ; CHECK-LABEL: test_masked_z_i32_to_8_mask1:
817 ; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
818 ; CHECK-NEXT: vpbroadcastd %edi, %ymm0 {%k1} {z}
820 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
821 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
822 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
823 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
826 define <8 x i32> @test_masked_i32_to_8_mask2(i32 %s, <8 x i32> %default, <8 x i32> %mask) {
827 ; CHECK-LABEL: test_masked_i32_to_8_mask2:
829 ; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
830 ; CHECK-NEXT: vpbroadcastd %edi, %ymm0 {%k1}
832 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
833 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
834 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
835 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
839 define <8 x i32> @test_masked_z_i32_to_8_mask2(i32 %s, <8 x i32> %mask) {
840 ; CHECK-LABEL: test_masked_z_i32_to_8_mask2:
842 ; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
843 ; CHECK-NEXT: vpbroadcastd %edi, %ymm0 {%k1} {z}
845 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
846 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
847 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
848 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
851 define <8 x i32> @test_masked_i32_to_8_mask3(i32 %s, <8 x i32> %default, <8 x i32> %mask) {
852 ; CHECK-LABEL: test_masked_i32_to_8_mask3:
854 ; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
855 ; CHECK-NEXT: vpbroadcastd %edi, %ymm0 {%k1}
857 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
858 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
859 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
860 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
864 define <8 x i32> @test_masked_z_i32_to_8_mask3(i32 %s, <8 x i32> %mask) {
865 ; CHECK-LABEL: test_masked_z_i32_to_8_mask3:
867 ; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
868 ; CHECK-NEXT: vpbroadcastd %edi, %ymm0 {%k1} {z}
870 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
871 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
872 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
873 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
876 define <16 x i32> @test_i32_to_16(i32 %s) {
877 ; CHECK-LABEL: test_i32_to_16:
879 ; CHECK-NEXT: vpbroadcastd %edi, %zmm0
881 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
882 %res = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
885 define <16 x i32> @test_masked_i32_to_16_mask0(i32 %s, <16 x i32> %default, <16 x i32> %mask) {
886 ; CHECK-LABEL: test_masked_i32_to_16_mask0:
888 ; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
889 ; CHECK-NEXT: vpbroadcastd %edi, %zmm0 {%k1}
891 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
892 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
893 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
894 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
898 define <16 x i32> @test_masked_z_i32_to_16_mask0(i32 %s, <16 x i32> %mask) {
899 ; CHECK-LABEL: test_masked_z_i32_to_16_mask0:
901 ; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
902 ; CHECK-NEXT: vpbroadcastd %edi, %zmm0 {%k1} {z}
904 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
905 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
906 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
907 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
910 define <16 x i32> @test_masked_i32_to_16_mask1(i32 %s, <16 x i32> %default, <16 x i32> %mask) {
911 ; CHECK-LABEL: test_masked_i32_to_16_mask1:
913 ; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
914 ; CHECK-NEXT: vpbroadcastd %edi, %zmm0 {%k1}
916 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
917 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
918 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
919 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
923 define <16 x i32> @test_masked_z_i32_to_16_mask1(i32 %s, <16 x i32> %mask) {
924 ; CHECK-LABEL: test_masked_z_i32_to_16_mask1:
926 ; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
927 ; CHECK-NEXT: vpbroadcastd %edi, %zmm0 {%k1} {z}
929 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
930 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
931 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
932 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
935 define <16 x i32> @test_masked_i32_to_16_mask2(i32 %s, <16 x i32> %default, <16 x i32> %mask) {
936 ; CHECK-LABEL: test_masked_i32_to_16_mask2:
938 ; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
939 ; CHECK-NEXT: vpbroadcastd %edi, %zmm0 {%k1}
941 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
942 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
943 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
944 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
948 define <16 x i32> @test_masked_z_i32_to_16_mask2(i32 %s, <16 x i32> %mask) {
949 ; CHECK-LABEL: test_masked_z_i32_to_16_mask2:
951 ; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
952 ; CHECK-NEXT: vpbroadcastd %edi, %zmm0 {%k1} {z}
954 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
955 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
956 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
957 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
960 define <16 x i32> @test_masked_i32_to_16_mask3(i32 %s, <16 x i32> %default, <16 x i32> %mask) {
961 ; CHECK-LABEL: test_masked_i32_to_16_mask3:
963 ; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
964 ; CHECK-NEXT: vpbroadcastd %edi, %zmm0 {%k1}
966 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
967 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
968 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
969 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
973 define <16 x i32> @test_masked_z_i32_to_16_mask3(i32 %s, <16 x i32> %mask) {
974 ; CHECK-LABEL: test_masked_z_i32_to_16_mask3:
976 ; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
977 ; CHECK-NEXT: vpbroadcastd %edi, %zmm0 {%k1} {z}
979 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
980 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
981 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
982 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
985 define <2 x i64> @test_i64_to_2(i64 %s) {
986 ; CHECK-LABEL: test_i64_to_2:
988 ; CHECK-NEXT: vpbroadcastq %rdi, %xmm0
990 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
991 %res = shufflevector <2 x i64> %vec, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
994 define <2 x i64> @test_masked_i64_to_2_mask0(i64 %s, <2 x i64> %default, <2 x i64> %mask) {
995 ; CHECK-LABEL: test_masked_i64_to_2_mask0:
997 ; CHECK-NEXT: vptestnmq %xmm1, %xmm1, %k1
998 ; CHECK-NEXT: vpbroadcastq %rdi, %xmm0 {%k1}
1000 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1001 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
1002 %cmp = icmp eq <2 x i64> %mask, zeroinitializer
1003 %res = select <2 x i1> %cmp, <2 x i64> %shuf, <2 x i64> %default
1007 define <2 x i64> @test_masked_z_i64_to_2_mask0(i64 %s, <2 x i64> %mask) {
1008 ; CHECK-LABEL: test_masked_z_i64_to_2_mask0:
1010 ; CHECK-NEXT: vptestnmq %xmm0, %xmm0, %k1
1011 ; CHECK-NEXT: vpbroadcastq %rdi, %xmm0 {%k1} {z}
1013 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1014 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
1015 %cmp = icmp eq <2 x i64> %mask, zeroinitializer
1016 %res = select <2 x i1> %cmp, <2 x i64> %shuf, <2 x i64> zeroinitializer
1019 define <2 x i64> @test_masked_i64_to_2_mask1(i64 %s, <2 x i64> %default, <2 x i64> %mask) {
1020 ; CHECK-LABEL: test_masked_i64_to_2_mask1:
1022 ; CHECK-NEXT: vptestnmq %xmm1, %xmm1, %k1
1023 ; CHECK-NEXT: vpbroadcastq %rdi, %xmm0 {%k1}
1025 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1026 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
1027 %cmp = icmp eq <2 x i64> %mask, zeroinitializer
1028 %res = select <2 x i1> %cmp, <2 x i64> %shuf, <2 x i64> %default
1032 define <2 x i64> @test_masked_z_i64_to_2_mask1(i64 %s, <2 x i64> %mask) {
1033 ; CHECK-LABEL: test_masked_z_i64_to_2_mask1:
1035 ; CHECK-NEXT: vptestnmq %xmm0, %xmm0, %k1
1036 ; CHECK-NEXT: vpbroadcastq %rdi, %xmm0 {%k1} {z}
1038 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1039 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
1040 %cmp = icmp eq <2 x i64> %mask, zeroinitializer
1041 %res = select <2 x i1> %cmp, <2 x i64> %shuf, <2 x i64> zeroinitializer
1044 define <4 x i64> @test_i64_to_4(i64 %s) {
1045 ; CHECK-LABEL: test_i64_to_4:
1047 ; CHECK-NEXT: vpbroadcastq %rdi, %ymm0
1049 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1050 %res = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
1053 define <4 x i64> @test_masked_i64_to_4_mask0(i64 %s, <4 x i64> %default, <4 x i64> %mask) {
1054 ; CHECK-LABEL: test_masked_i64_to_4_mask0:
1056 ; CHECK-NEXT: vptestnmq %ymm1, %ymm1, %k1
1057 ; CHECK-NEXT: vpbroadcastq %rdi, %ymm0 {%k1}
1059 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1060 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
1061 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
1062 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> %default
1066 define <4 x i64> @test_masked_z_i64_to_4_mask0(i64 %s, <4 x i64> %mask) {
1067 ; CHECK-LABEL: test_masked_z_i64_to_4_mask0:
1069 ; CHECK-NEXT: vptestnmq %ymm0, %ymm0, %k1
1070 ; CHECK-NEXT: vpbroadcastq %rdi, %ymm0 {%k1} {z}
1072 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1073 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
1074 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
1075 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> zeroinitializer
1078 define <4 x i64> @test_masked_i64_to_4_mask1(i64 %s, <4 x i64> %default, <4 x i64> %mask) {
1079 ; CHECK-LABEL: test_masked_i64_to_4_mask1:
1081 ; CHECK-NEXT: vptestnmq %ymm1, %ymm1, %k1
1082 ; CHECK-NEXT: vpbroadcastq %rdi, %ymm0 {%k1}
1084 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1085 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
1086 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
1087 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> %default
1091 define <4 x i64> @test_masked_z_i64_to_4_mask1(i64 %s, <4 x i64> %mask) {
1092 ; CHECK-LABEL: test_masked_z_i64_to_4_mask1:
1094 ; CHECK-NEXT: vptestnmq %ymm0, %ymm0, %k1
1095 ; CHECK-NEXT: vpbroadcastq %rdi, %ymm0 {%k1} {z}
1097 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1098 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
1099 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
1100 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> zeroinitializer
1103 define <4 x i64> @test_masked_i64_to_4_mask2(i64 %s, <4 x i64> %default, <4 x i64> %mask) {
1104 ; CHECK-LABEL: test_masked_i64_to_4_mask2:
1106 ; CHECK-NEXT: vptestnmq %ymm1, %ymm1, %k1
1107 ; CHECK-NEXT: vpbroadcastq %rdi, %ymm0 {%k1}
1109 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1110 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
1111 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
1112 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> %default
1116 define <4 x i64> @test_masked_z_i64_to_4_mask2(i64 %s, <4 x i64> %mask) {
1117 ; CHECK-LABEL: test_masked_z_i64_to_4_mask2:
1119 ; CHECK-NEXT: vptestnmq %ymm0, %ymm0, %k1
1120 ; CHECK-NEXT: vpbroadcastq %rdi, %ymm0 {%k1} {z}
1122 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1123 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
1124 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
1125 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> zeroinitializer
1128 define <4 x i64> @test_masked_i64_to_4_mask3(i64 %s, <4 x i64> %default, <4 x i64> %mask) {
1129 ; CHECK-LABEL: test_masked_i64_to_4_mask3:
1131 ; CHECK-NEXT: vptestnmq %ymm1, %ymm1, %k1
1132 ; CHECK-NEXT: vpbroadcastq %rdi, %ymm0 {%k1}
1134 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1135 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
1136 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
1137 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> %default
1141 define <4 x i64> @test_masked_z_i64_to_4_mask3(i64 %s, <4 x i64> %mask) {
1142 ; CHECK-LABEL: test_masked_z_i64_to_4_mask3:
1144 ; CHECK-NEXT: vptestnmq %ymm0, %ymm0, %k1
1145 ; CHECK-NEXT: vpbroadcastq %rdi, %ymm0 {%k1} {z}
1147 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1148 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
1149 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
1150 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> zeroinitializer
1153 define <8 x i64> @test_i64_to_8(i64 %s) {
1154 ; CHECK-LABEL: test_i64_to_8:
1156 ; CHECK-NEXT: vpbroadcastq %rdi, %zmm0
1158 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1159 %res = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1162 define <8 x i64> @test_masked_i64_to_8_mask0(i64 %s, <8 x i64> %default, <8 x i64> %mask) {
1163 ; CHECK-LABEL: test_masked_i64_to_8_mask0:
1165 ; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
1166 ; CHECK-NEXT: vpbroadcastq %rdi, %zmm0 {%k1}
1168 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1169 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1170 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
1171 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
1175 define <8 x i64> @test_masked_z_i64_to_8_mask0(i64 %s, <8 x i64> %mask) {
1176 ; CHECK-LABEL: test_masked_z_i64_to_8_mask0:
1178 ; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
1179 ; CHECK-NEXT: vpbroadcastq %rdi, %zmm0 {%k1} {z}
1181 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1182 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1183 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
1184 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer
1187 define <8 x i64> @test_masked_i64_to_8_mask1(i64 %s, <8 x i64> %default, <8 x i64> %mask) {
1188 ; CHECK-LABEL: test_masked_i64_to_8_mask1:
1190 ; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
1191 ; CHECK-NEXT: vpbroadcastq %rdi, %zmm0 {%k1}
1193 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1194 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1195 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
1196 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
1200 define <8 x i64> @test_masked_z_i64_to_8_mask1(i64 %s, <8 x i64> %mask) {
1201 ; CHECK-LABEL: test_masked_z_i64_to_8_mask1:
1203 ; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
1204 ; CHECK-NEXT: vpbroadcastq %rdi, %zmm0 {%k1} {z}
1206 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1207 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1208 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
1209 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer
1212 define <8 x i64> @test_masked_i64_to_8_mask2(i64 %s, <8 x i64> %default, <8 x i64> %mask) {
1213 ; CHECK-LABEL: test_masked_i64_to_8_mask2:
1215 ; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
1216 ; CHECK-NEXT: vpbroadcastq %rdi, %zmm0 {%k1}
1218 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1219 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1220 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
1221 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
1225 define <8 x i64> @test_masked_z_i64_to_8_mask2(i64 %s, <8 x i64> %mask) {
1226 ; CHECK-LABEL: test_masked_z_i64_to_8_mask2:
1228 ; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
1229 ; CHECK-NEXT: vpbroadcastq %rdi, %zmm0 {%k1} {z}
1231 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1232 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1233 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
1234 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer
1237 define <8 x i64> @test_masked_i64_to_8_mask3(i64 %s, <8 x i64> %default, <8 x i64> %mask) {
1238 ; CHECK-LABEL: test_masked_i64_to_8_mask3:
1240 ; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
1241 ; CHECK-NEXT: vpbroadcastq %rdi, %zmm0 {%k1}
1243 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1244 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1245 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
1246 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
1250 define <8 x i64> @test_masked_z_i64_to_8_mask3(i64 %s, <8 x i64> %mask) {
1251 ; CHECK-LABEL: test_masked_z_i64_to_8_mask3:
1253 ; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
1254 ; CHECK-NEXT: vpbroadcastq %rdi, %zmm0 {%k1} {z}
1256 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
1257 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1258 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
1259 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer
1262 define <16 x i8> @test_i8_to_16_mem(ptr %p) {
1263 ; CHECK-LABEL: test_i8_to_16_mem:
1265 ; CHECK-NEXT: vpbroadcastb (%rdi), %xmm0
1267 %s = load i8, ptr %p
1268 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1269 %res = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1272 define <16 x i8> @test_masked_i8_to_16_mem_mask0(ptr %p, <16 x i8> %default, <16 x i8> %mask) {
1273 ; CHECK-LABEL: test_masked_i8_to_16_mem_mask0:
1275 ; CHECK-NEXT: vptestnmb %xmm1, %xmm1, %k1
1276 ; CHECK-NEXT: vpbroadcastb (%rdi), %xmm0 {%k1}
1278 %s = load i8, ptr %p
1279 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1280 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1281 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
1282 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> %default
1286 define <16 x i8> @test_masked_z_i8_to_16_mem_mask0(ptr %p, <16 x i8> %mask) {
1287 ; CHECK-LABEL: test_masked_z_i8_to_16_mem_mask0:
1289 ; CHECK-NEXT: vptestnmb %xmm0, %xmm0, %k1
1290 ; CHECK-NEXT: vpbroadcastb (%rdi), %xmm0 {%k1} {z}
1292 %s = load i8, ptr %p
1293 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1294 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1295 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
1296 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> zeroinitializer
1299 define <16 x i8> @test_masked_i8_to_16_mem_mask1(ptr %p, <16 x i8> %default, <16 x i8> %mask) {
1300 ; CHECK-LABEL: test_masked_i8_to_16_mem_mask1:
1302 ; CHECK-NEXT: vptestnmb %xmm1, %xmm1, %k1
1303 ; CHECK-NEXT: vpbroadcastb (%rdi), %xmm0 {%k1}
1305 %s = load i8, ptr %p
1306 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1307 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1308 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
1309 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> %default
1313 define <16 x i8> @test_masked_z_i8_to_16_mem_mask1(ptr %p, <16 x i8> %mask) {
1314 ; CHECK-LABEL: test_masked_z_i8_to_16_mem_mask1:
1316 ; CHECK-NEXT: vptestnmb %xmm0, %xmm0, %k1
1317 ; CHECK-NEXT: vpbroadcastb (%rdi), %xmm0 {%k1} {z}
1319 %s = load i8, ptr %p
1320 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1321 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1322 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
1323 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> zeroinitializer
1326 define <16 x i8> @test_masked_i8_to_16_mem_mask2(ptr %p, <16 x i8> %default, <16 x i8> %mask) {
1327 ; CHECK-LABEL: test_masked_i8_to_16_mem_mask2:
1329 ; CHECK-NEXT: vptestnmb %xmm1, %xmm1, %k1
1330 ; CHECK-NEXT: vpbroadcastb (%rdi), %xmm0 {%k1}
1332 %s = load i8, ptr %p
1333 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1334 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1335 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
1336 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> %default
1340 define <16 x i8> @test_masked_z_i8_to_16_mem_mask2(ptr %p, <16 x i8> %mask) {
1341 ; CHECK-LABEL: test_masked_z_i8_to_16_mem_mask2:
1343 ; CHECK-NEXT: vptestnmb %xmm0, %xmm0, %k1
1344 ; CHECK-NEXT: vpbroadcastb (%rdi), %xmm0 {%k1} {z}
1346 %s = load i8, ptr %p
1347 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1348 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1349 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
1350 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> zeroinitializer
1353 define <16 x i8> @test_masked_i8_to_16_mem_mask3(ptr %p, <16 x i8> %default, <16 x i8> %mask) {
1354 ; CHECK-LABEL: test_masked_i8_to_16_mem_mask3:
1356 ; CHECK-NEXT: vptestnmb %xmm1, %xmm1, %k1
1357 ; CHECK-NEXT: vpbroadcastb (%rdi), %xmm0 {%k1}
1359 %s = load i8, ptr %p
1360 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1361 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1362 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
1363 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> %default
1367 define <16 x i8> @test_masked_z_i8_to_16_mem_mask3(ptr %p, <16 x i8> %mask) {
1368 ; CHECK-LABEL: test_masked_z_i8_to_16_mem_mask3:
1370 ; CHECK-NEXT: vptestnmb %xmm0, %xmm0, %k1
1371 ; CHECK-NEXT: vpbroadcastb (%rdi), %xmm0 {%k1} {z}
1373 %s = load i8, ptr %p
1374 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1375 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1376 %cmp = icmp eq <16 x i8> %mask, zeroinitializer
1377 %res = select <16 x i1> %cmp, <16 x i8> %shuf, <16 x i8> zeroinitializer
1380 define <32 x i8> @test_i8_to_32_mem(ptr %p) {
1381 ; CHECK-LABEL: test_i8_to_32_mem:
1383 ; CHECK-NEXT: vpbroadcastb (%rdi), %ymm0
1385 %s = load i8, ptr %p
1386 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1387 %res = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1390 define <32 x i8> @test_masked_i8_to_32_mem_mask0(ptr %p, <32 x i8> %default, <32 x i8> %mask) {
1391 ; CHECK-LABEL: test_masked_i8_to_32_mem_mask0:
1393 ; CHECK-NEXT: vptestnmb %ymm1, %ymm1, %k1
1394 ; CHECK-NEXT: vpbroadcastb (%rdi), %ymm0 {%k1}
1396 %s = load i8, ptr %p
1397 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1398 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1399 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
1400 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> %default
1404 define <32 x i8> @test_masked_z_i8_to_32_mem_mask0(ptr %p, <32 x i8> %mask) {
1405 ; CHECK-LABEL: test_masked_z_i8_to_32_mem_mask0:
1407 ; CHECK-NEXT: vptestnmb %ymm0, %ymm0, %k1
1408 ; CHECK-NEXT: vpbroadcastb (%rdi), %ymm0 {%k1} {z}
1410 %s = load i8, ptr %p
1411 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1412 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1413 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
1414 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> zeroinitializer
1417 define <32 x i8> @test_masked_i8_to_32_mem_mask1(ptr %p, <32 x i8> %default, <32 x i8> %mask) {
1418 ; CHECK-LABEL: test_masked_i8_to_32_mem_mask1:
1420 ; CHECK-NEXT: vptestnmb %ymm1, %ymm1, %k1
1421 ; CHECK-NEXT: vpbroadcastb (%rdi), %ymm0 {%k1}
1423 %s = load i8, ptr %p
1424 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1425 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1426 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
1427 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> %default
1431 define <32 x i8> @test_masked_z_i8_to_32_mem_mask1(ptr %p, <32 x i8> %mask) {
1432 ; CHECK-LABEL: test_masked_z_i8_to_32_mem_mask1:
1434 ; CHECK-NEXT: vptestnmb %ymm0, %ymm0, %k1
1435 ; CHECK-NEXT: vpbroadcastb (%rdi), %ymm0 {%k1} {z}
1437 %s = load i8, ptr %p
1438 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1439 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1440 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
1441 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> zeroinitializer
1444 define <32 x i8> @test_masked_i8_to_32_mem_mask2(ptr %p, <32 x i8> %default, <32 x i8> %mask) {
1445 ; CHECK-LABEL: test_masked_i8_to_32_mem_mask2:
1447 ; CHECK-NEXT: vptestnmb %ymm1, %ymm1, %k1
1448 ; CHECK-NEXT: vpbroadcastb (%rdi), %ymm0 {%k1}
1450 %s = load i8, ptr %p
1451 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1452 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1453 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
1454 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> %default
1458 define <32 x i8> @test_masked_z_i8_to_32_mem_mask2(ptr %p, <32 x i8> %mask) {
1459 ; CHECK-LABEL: test_masked_z_i8_to_32_mem_mask2:
1461 ; CHECK-NEXT: vptestnmb %ymm0, %ymm0, %k1
1462 ; CHECK-NEXT: vpbroadcastb (%rdi), %ymm0 {%k1} {z}
1464 %s = load i8, ptr %p
1465 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1466 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1467 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
1468 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> zeroinitializer
1471 define <32 x i8> @test_masked_i8_to_32_mem_mask3(ptr %p, <32 x i8> %default, <32 x i8> %mask) {
1472 ; CHECK-LABEL: test_masked_i8_to_32_mem_mask3:
1474 ; CHECK-NEXT: vptestnmb %ymm1, %ymm1, %k1
1475 ; CHECK-NEXT: vpbroadcastb (%rdi), %ymm0 {%k1}
1477 %s = load i8, ptr %p
1478 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1479 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1480 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
1481 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> %default
1485 define <32 x i8> @test_masked_z_i8_to_32_mem_mask3(ptr %p, <32 x i8> %mask) {
1486 ; CHECK-LABEL: test_masked_z_i8_to_32_mem_mask3:
1488 ; CHECK-NEXT: vptestnmb %ymm0, %ymm0, %k1
1489 ; CHECK-NEXT: vpbroadcastb (%rdi), %ymm0 {%k1} {z}
1491 %s = load i8, ptr %p
1492 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1493 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1494 %cmp = icmp eq <32 x i8> %mask, zeroinitializer
1495 %res = select <32 x i1> %cmp, <32 x i8> %shuf, <32 x i8> zeroinitializer
1498 define <64 x i8> @test_i8_to_64_mem(ptr %p) {
1499 ; CHECK-LABEL: test_i8_to_64_mem:
1501 ; CHECK-NEXT: vpbroadcastb (%rdi), %zmm0
1503 %s = load i8, ptr %p
1504 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1505 %res = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1508 define <64 x i8> @test_masked_i8_to_64_mem_mask0(ptr %p, <64 x i8> %default, <64 x i8> %mask) {
1509 ; CHECK-LABEL: test_masked_i8_to_64_mem_mask0:
1511 ; CHECK-NEXT: vptestnmb %zmm1, %zmm1, %k1
1512 ; CHECK-NEXT: vpbroadcastb (%rdi), %zmm0 {%k1}
1514 %s = load i8, ptr %p
1515 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1516 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1517 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
1518 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> %default
1522 define <64 x i8> @test_masked_z_i8_to_64_mem_mask0(ptr %p, <64 x i8> %mask) {
1523 ; CHECK-LABEL: test_masked_z_i8_to_64_mem_mask0:
1525 ; CHECK-NEXT: vptestnmb %zmm0, %zmm0, %k1
1526 ; CHECK-NEXT: vpbroadcastb (%rdi), %zmm0 {%k1} {z}
1528 %s = load i8, ptr %p
1529 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1530 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1531 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
1532 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> zeroinitializer
1535 define <64 x i8> @test_masked_i8_to_64_mem_mask1(ptr %p, <64 x i8> %default, <64 x i8> %mask) {
1536 ; CHECK-LABEL: test_masked_i8_to_64_mem_mask1:
1538 ; CHECK-NEXT: vptestnmb %zmm1, %zmm1, %k1
1539 ; CHECK-NEXT: vpbroadcastb (%rdi), %zmm0 {%k1}
1541 %s = load i8, ptr %p
1542 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1543 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1544 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
1545 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> %default
1549 define <64 x i8> @test_masked_z_i8_to_64_mem_mask1(ptr %p, <64 x i8> %mask) {
1550 ; CHECK-LABEL: test_masked_z_i8_to_64_mem_mask1:
1552 ; CHECK-NEXT: vptestnmb %zmm0, %zmm0, %k1
1553 ; CHECK-NEXT: vpbroadcastb (%rdi), %zmm0 {%k1} {z}
1555 %s = load i8, ptr %p
1556 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1557 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1558 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
1559 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> zeroinitializer
1562 define <64 x i8> @test_masked_i8_to_64_mem_mask2(ptr %p, <64 x i8> %default, <64 x i8> %mask) {
1563 ; CHECK-LABEL: test_masked_i8_to_64_mem_mask2:
1565 ; CHECK-NEXT: vptestnmb %zmm1, %zmm1, %k1
1566 ; CHECK-NEXT: vpbroadcastb (%rdi), %zmm0 {%k1}
1568 %s = load i8, ptr %p
1569 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1570 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1571 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
1572 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> %default
1576 define <64 x i8> @test_masked_z_i8_to_64_mem_mask2(ptr %p, <64 x i8> %mask) {
1577 ; CHECK-LABEL: test_masked_z_i8_to_64_mem_mask2:
1579 ; CHECK-NEXT: vptestnmb %zmm0, %zmm0, %k1
1580 ; CHECK-NEXT: vpbroadcastb (%rdi), %zmm0 {%k1} {z}
1582 %s = load i8, ptr %p
1583 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1584 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1585 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
1586 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> zeroinitializer
1589 define <64 x i8> @test_masked_i8_to_64_mem_mask3(ptr %p, <64 x i8> %default, <64 x i8> %mask) {
1590 ; CHECK-LABEL: test_masked_i8_to_64_mem_mask3:
1592 ; CHECK-NEXT: vptestnmb %zmm1, %zmm1, %k1
1593 ; CHECK-NEXT: vpbroadcastb (%rdi), %zmm0 {%k1}
1595 %s = load i8, ptr %p
1596 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1597 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1598 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
1599 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> %default
1603 define <64 x i8> @test_masked_z_i8_to_64_mem_mask3(ptr %p, <64 x i8> %mask) {
1604 ; CHECK-LABEL: test_masked_z_i8_to_64_mem_mask3:
1606 ; CHECK-NEXT: vptestnmb %zmm0, %zmm0, %k1
1607 ; CHECK-NEXT: vpbroadcastb (%rdi), %zmm0 {%k1} {z}
1609 %s = load i8, ptr %p
1610 %vec = insertelement <2 x i8> undef, i8 %s, i32 0
1611 %shuf = shufflevector <2 x i8> %vec, <2 x i8> undef, <64 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1612 %cmp = icmp eq <64 x i8> %mask, zeroinitializer
1613 %res = select <64 x i1> %cmp, <64 x i8> %shuf, <64 x i8> zeroinitializer
1616 define <8 x i16> @test_i16_to_8_mem(ptr %p) {
1617 ; CHECK-LABEL: test_i16_to_8_mem:
1619 ; CHECK-NEXT: vpbroadcastw (%rdi), %xmm0
1621 %s = load i16, ptr %p
1622 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1623 %res = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1626 define <8 x i16> @test_masked_i16_to_8_mem_mask0(ptr %p, <8 x i16> %default, <8 x i16> %mask) {
1627 ; CHECK-LABEL: test_masked_i16_to_8_mem_mask0:
1629 ; CHECK-NEXT: vptestnmw %xmm1, %xmm1, %k1
1630 ; CHECK-NEXT: vpbroadcastw (%rdi), %xmm0 {%k1}
1632 %s = load i16, ptr %p
1633 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1634 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1635 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
1636 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> %default
1640 define <8 x i16> @test_masked_z_i16_to_8_mem_mask0(ptr %p, <8 x i16> %mask) {
1641 ; CHECK-LABEL: test_masked_z_i16_to_8_mem_mask0:
1643 ; CHECK-NEXT: vptestnmw %xmm0, %xmm0, %k1
1644 ; CHECK-NEXT: vpbroadcastw (%rdi), %xmm0 {%k1} {z}
1646 %s = load i16, ptr %p
1647 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1648 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1649 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
1650 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> zeroinitializer
1653 define <8 x i16> @test_masked_i16_to_8_mem_mask1(ptr %p, <8 x i16> %default, <8 x i16> %mask) {
1654 ; CHECK-LABEL: test_masked_i16_to_8_mem_mask1:
1656 ; CHECK-NEXT: vptestnmw %xmm1, %xmm1, %k1
1657 ; CHECK-NEXT: vpbroadcastw (%rdi), %xmm0 {%k1}
1659 %s = load i16, ptr %p
1660 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1661 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1662 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
1663 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> %default
1667 define <8 x i16> @test_masked_z_i16_to_8_mem_mask1(ptr %p, <8 x i16> %mask) {
1668 ; CHECK-LABEL: test_masked_z_i16_to_8_mem_mask1:
1670 ; CHECK-NEXT: vptestnmw %xmm0, %xmm0, %k1
1671 ; CHECK-NEXT: vpbroadcastw (%rdi), %xmm0 {%k1} {z}
1673 %s = load i16, ptr %p
1674 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1675 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1676 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
1677 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> zeroinitializer
1680 define <8 x i16> @test_masked_i16_to_8_mem_mask2(ptr %p, <8 x i16> %default, <8 x i16> %mask) {
1681 ; CHECK-LABEL: test_masked_i16_to_8_mem_mask2:
1683 ; CHECK-NEXT: vptestnmw %xmm1, %xmm1, %k1
1684 ; CHECK-NEXT: vpbroadcastw (%rdi), %xmm0 {%k1}
1686 %s = load i16, ptr %p
1687 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1688 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1689 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
1690 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> %default
1694 define <8 x i16> @test_masked_z_i16_to_8_mem_mask2(ptr %p, <8 x i16> %mask) {
1695 ; CHECK-LABEL: test_masked_z_i16_to_8_mem_mask2:
1697 ; CHECK-NEXT: vptestnmw %xmm0, %xmm0, %k1
1698 ; CHECK-NEXT: vpbroadcastw (%rdi), %xmm0 {%k1} {z}
1700 %s = load i16, ptr %p
1701 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1702 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1703 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
1704 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> zeroinitializer
1707 define <8 x i16> @test_masked_i16_to_8_mem_mask3(ptr %p, <8 x i16> %default, <8 x i16> %mask) {
1708 ; CHECK-LABEL: test_masked_i16_to_8_mem_mask3:
1710 ; CHECK-NEXT: vptestnmw %xmm1, %xmm1, %k1
1711 ; CHECK-NEXT: vpbroadcastw (%rdi), %xmm0 {%k1}
1713 %s = load i16, ptr %p
1714 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1715 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1716 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
1717 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> %default
1721 define <8 x i16> @test_masked_z_i16_to_8_mem_mask3(ptr %p, <8 x i16> %mask) {
1722 ; CHECK-LABEL: test_masked_z_i16_to_8_mem_mask3:
1724 ; CHECK-NEXT: vptestnmw %xmm0, %xmm0, %k1
1725 ; CHECK-NEXT: vpbroadcastw (%rdi), %xmm0 {%k1} {z}
1727 %s = load i16, ptr %p
1728 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1729 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1730 %cmp = icmp eq <8 x i16> %mask, zeroinitializer
1731 %res = select <8 x i1> %cmp, <8 x i16> %shuf, <8 x i16> zeroinitializer
1734 define <16 x i16> @test_i16_to_16_mem(ptr %p) {
1735 ; CHECK-LABEL: test_i16_to_16_mem:
1737 ; CHECK-NEXT: vpbroadcastw (%rdi), %ymm0
1739 %s = load i16, ptr %p
1740 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1741 %res = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1744 define <16 x i16> @test_masked_i16_to_16_mem_mask0(ptr %p, <16 x i16> %default, <16 x i16> %mask) {
1745 ; CHECK-LABEL: test_masked_i16_to_16_mem_mask0:
1747 ; CHECK-NEXT: vptestnmw %ymm1, %ymm1, %k1
1748 ; CHECK-NEXT: vpbroadcastw (%rdi), %ymm0 {%k1}
1750 %s = load i16, ptr %p
1751 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1752 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1753 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
1754 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> %default
1758 define <16 x i16> @test_masked_z_i16_to_16_mem_mask0(ptr %p, <16 x i16> %mask) {
1759 ; CHECK-LABEL: test_masked_z_i16_to_16_mem_mask0:
1761 ; CHECK-NEXT: vptestnmw %ymm0, %ymm0, %k1
1762 ; CHECK-NEXT: vpbroadcastw (%rdi), %ymm0 {%k1} {z}
1764 %s = load i16, ptr %p
1765 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1766 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1767 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
1768 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> zeroinitializer
1771 define <16 x i16> @test_masked_i16_to_16_mem_mask1(ptr %p, <16 x i16> %default, <16 x i16> %mask) {
1772 ; CHECK-LABEL: test_masked_i16_to_16_mem_mask1:
1774 ; CHECK-NEXT: vptestnmw %ymm1, %ymm1, %k1
1775 ; CHECK-NEXT: vpbroadcastw (%rdi), %ymm0 {%k1}
1777 %s = load i16, ptr %p
1778 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1779 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1780 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
1781 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> %default
1785 define <16 x i16> @test_masked_z_i16_to_16_mem_mask1(ptr %p, <16 x i16> %mask) {
1786 ; CHECK-LABEL: test_masked_z_i16_to_16_mem_mask1:
1788 ; CHECK-NEXT: vptestnmw %ymm0, %ymm0, %k1
1789 ; CHECK-NEXT: vpbroadcastw (%rdi), %ymm0 {%k1} {z}
1791 %s = load i16, ptr %p
1792 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1793 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1794 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
1795 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> zeroinitializer
1798 define <16 x i16> @test_masked_i16_to_16_mem_mask2(ptr %p, <16 x i16> %default, <16 x i16> %mask) {
1799 ; CHECK-LABEL: test_masked_i16_to_16_mem_mask2:
1801 ; CHECK-NEXT: vptestnmw %ymm1, %ymm1, %k1
1802 ; CHECK-NEXT: vpbroadcastw (%rdi), %ymm0 {%k1}
1804 %s = load i16, ptr %p
1805 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1806 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1807 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
1808 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> %default
1812 define <16 x i16> @test_masked_z_i16_to_16_mem_mask2(ptr %p, <16 x i16> %mask) {
1813 ; CHECK-LABEL: test_masked_z_i16_to_16_mem_mask2:
1815 ; CHECK-NEXT: vptestnmw %ymm0, %ymm0, %k1
1816 ; CHECK-NEXT: vpbroadcastw (%rdi), %ymm0 {%k1} {z}
1818 %s = load i16, ptr %p
1819 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1820 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1821 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
1822 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> zeroinitializer
1825 define <16 x i16> @test_masked_i16_to_16_mem_mask3(ptr %p, <16 x i16> %default, <16 x i16> %mask) {
1826 ; CHECK-LABEL: test_masked_i16_to_16_mem_mask3:
1828 ; CHECK-NEXT: vptestnmw %ymm1, %ymm1, %k1
1829 ; CHECK-NEXT: vpbroadcastw (%rdi), %ymm0 {%k1}
1831 %s = load i16, ptr %p
1832 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1833 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1834 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
1835 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> %default
1839 define <16 x i16> @test_masked_z_i16_to_16_mem_mask3(ptr %p, <16 x i16> %mask) {
1840 ; CHECK-LABEL: test_masked_z_i16_to_16_mem_mask3:
1842 ; CHECK-NEXT: vptestnmw %ymm0, %ymm0, %k1
1843 ; CHECK-NEXT: vpbroadcastw (%rdi), %ymm0 {%k1} {z}
1845 %s = load i16, ptr %p
1846 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1847 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1848 %cmp = icmp eq <16 x i16> %mask, zeroinitializer
1849 %res = select <16 x i1> %cmp, <16 x i16> %shuf, <16 x i16> zeroinitializer
1852 define <32 x i16> @test_i16_to_32_mem(ptr %p) {
1853 ; CHECK-LABEL: test_i16_to_32_mem:
1855 ; CHECK-NEXT: vpbroadcastw (%rdi), %zmm0
1857 %s = load i16, ptr %p
1858 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1859 %res = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1862 define <32 x i16> @test_masked_i16_to_32_mem_mask0(ptr %p, <32 x i16> %default, <32 x i16> %mask) {
1863 ; CHECK-LABEL: test_masked_i16_to_32_mem_mask0:
1865 ; CHECK-NEXT: vptestnmw %zmm1, %zmm1, %k1
1866 ; CHECK-NEXT: vpbroadcastw (%rdi), %zmm0 {%k1}
1868 %s = load i16, ptr %p
1869 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1870 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1871 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
1872 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> %default
1876 define <32 x i16> @test_masked_z_i16_to_32_mem_mask0(ptr %p, <32 x i16> %mask) {
1877 ; CHECK-LABEL: test_masked_z_i16_to_32_mem_mask0:
1879 ; CHECK-NEXT: vptestnmw %zmm0, %zmm0, %k1
1880 ; CHECK-NEXT: vpbroadcastw (%rdi), %zmm0 {%k1} {z}
1882 %s = load i16, ptr %p
1883 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1884 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1885 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
1886 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> zeroinitializer
1889 define <32 x i16> @test_masked_i16_to_32_mem_mask1(ptr %p, <32 x i16> %default, <32 x i16> %mask) {
1890 ; CHECK-LABEL: test_masked_i16_to_32_mem_mask1:
1892 ; CHECK-NEXT: vptestnmw %zmm1, %zmm1, %k1
1893 ; CHECK-NEXT: vpbroadcastw (%rdi), %zmm0 {%k1}
1895 %s = load i16, ptr %p
1896 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1897 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1898 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
1899 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> %default
1903 define <32 x i16> @test_masked_z_i16_to_32_mem_mask1(ptr %p, <32 x i16> %mask) {
1904 ; CHECK-LABEL: test_masked_z_i16_to_32_mem_mask1:
1906 ; CHECK-NEXT: vptestnmw %zmm0, %zmm0, %k1
1907 ; CHECK-NEXT: vpbroadcastw (%rdi), %zmm0 {%k1} {z}
1909 %s = load i16, ptr %p
1910 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1911 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1912 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
1913 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> zeroinitializer
1916 define <32 x i16> @test_masked_i16_to_32_mem_mask2(ptr %p, <32 x i16> %default, <32 x i16> %mask) {
1917 ; CHECK-LABEL: test_masked_i16_to_32_mem_mask2:
1919 ; CHECK-NEXT: vptestnmw %zmm1, %zmm1, %k1
1920 ; CHECK-NEXT: vpbroadcastw (%rdi), %zmm0 {%k1}
1922 %s = load i16, ptr %p
1923 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1924 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1925 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
1926 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> %default
1930 define <32 x i16> @test_masked_z_i16_to_32_mem_mask2(ptr %p, <32 x i16> %mask) {
1931 ; CHECK-LABEL: test_masked_z_i16_to_32_mem_mask2:
1933 ; CHECK-NEXT: vptestnmw %zmm0, %zmm0, %k1
1934 ; CHECK-NEXT: vpbroadcastw (%rdi), %zmm0 {%k1} {z}
1936 %s = load i16, ptr %p
1937 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1938 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1939 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
1940 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> zeroinitializer
1943 define <32 x i16> @test_masked_i16_to_32_mem_mask3(ptr %p, <32 x i16> %default, <32 x i16> %mask) {
1944 ; CHECK-LABEL: test_masked_i16_to_32_mem_mask3:
1946 ; CHECK-NEXT: vptestnmw %zmm1, %zmm1, %k1
1947 ; CHECK-NEXT: vpbroadcastw (%rdi), %zmm0 {%k1}
1949 %s = load i16, ptr %p
1950 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1951 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1952 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
1953 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> %default
1957 define <32 x i16> @test_masked_z_i16_to_32_mem_mask3(ptr %p, <32 x i16> %mask) {
1958 ; CHECK-LABEL: test_masked_z_i16_to_32_mem_mask3:
1960 ; CHECK-NEXT: vptestnmw %zmm0, %zmm0, %k1
1961 ; CHECK-NEXT: vpbroadcastw (%rdi), %zmm0 {%k1} {z}
1963 %s = load i16, ptr %p
1964 %vec = insertelement <2 x i16> undef, i16 %s, i32 0
1965 %shuf = shufflevector <2 x i16> %vec, <2 x i16> undef, <32 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1966 %cmp = icmp eq <32 x i16> %mask, zeroinitializer
1967 %res = select <32 x i1> %cmp, <32 x i16> %shuf, <32 x i16> zeroinitializer
1970 define <4 x i32> @test_i32_to_4_mem(ptr %p) {
1971 ; CHECK-LABEL: test_i32_to_4_mem:
1973 ; CHECK-NEXT: vbroadcastss (%rdi), %xmm0
1975 %s = load i32, ptr %p
1976 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
1977 %res = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
1980 define <4 x i32> @test_masked_i32_to_4_mem_mask0(ptr %p, <4 x i32> %default, <4 x i32> %mask) {
1981 ; CHECK-LABEL: test_masked_i32_to_4_mem_mask0:
1983 ; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
1984 ; CHECK-NEXT: vpbroadcastd (%rdi), %xmm0 {%k1}
1986 %s = load i32, ptr %p
1987 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
1988 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
1989 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
1990 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
1994 define <4 x i32> @test_masked_z_i32_to_4_mem_mask0(ptr %p, <4 x i32> %mask) {
1995 ; CHECK-LABEL: test_masked_z_i32_to_4_mem_mask0:
1997 ; CHECK-NEXT: vptestnmd %xmm0, %xmm0, %k1
1998 ; CHECK-NEXT: vpbroadcastd (%rdi), %xmm0 {%k1} {z}
2000 %s = load i32, ptr %p
2001 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2002 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2003 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
2004 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
2007 define <4 x i32> @test_masked_i32_to_4_mem_mask1(ptr %p, <4 x i32> %default, <4 x i32> %mask) {
2008 ; CHECK-LABEL: test_masked_i32_to_4_mem_mask1:
2010 ; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
2011 ; CHECK-NEXT: vpbroadcastd (%rdi), %xmm0 {%k1}
2013 %s = load i32, ptr %p
2014 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2015 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2016 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
2017 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
2021 define <4 x i32> @test_masked_z_i32_to_4_mem_mask1(ptr %p, <4 x i32> %mask) {
2022 ; CHECK-LABEL: test_masked_z_i32_to_4_mem_mask1:
2024 ; CHECK-NEXT: vptestnmd %xmm0, %xmm0, %k1
2025 ; CHECK-NEXT: vpbroadcastd (%rdi), %xmm0 {%k1} {z}
2027 %s = load i32, ptr %p
2028 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2029 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2030 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
2031 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
2034 define <4 x i32> @test_masked_i32_to_4_mem_mask2(ptr %p, <4 x i32> %default, <4 x i32> %mask) {
2035 ; CHECK-LABEL: test_masked_i32_to_4_mem_mask2:
2037 ; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
2038 ; CHECK-NEXT: vpbroadcastd (%rdi), %xmm0 {%k1}
2040 %s = load i32, ptr %p
2041 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2042 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2043 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
2044 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
2048 define <4 x i32> @test_masked_z_i32_to_4_mem_mask2(ptr %p, <4 x i32> %mask) {
2049 ; CHECK-LABEL: test_masked_z_i32_to_4_mem_mask2:
2051 ; CHECK-NEXT: vptestnmd %xmm0, %xmm0, %k1
2052 ; CHECK-NEXT: vpbroadcastd (%rdi), %xmm0 {%k1} {z}
2054 %s = load i32, ptr %p
2055 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2056 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2057 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
2058 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
2061 define <4 x i32> @test_masked_i32_to_4_mem_mask3(ptr %p, <4 x i32> %default, <4 x i32> %mask) {
2062 ; CHECK-LABEL: test_masked_i32_to_4_mem_mask3:
2064 ; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
2065 ; CHECK-NEXT: vpbroadcastd (%rdi), %xmm0 {%k1}
2067 %s = load i32, ptr %p
2068 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2069 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2070 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
2071 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
2075 define <4 x i32> @test_masked_z_i32_to_4_mem_mask3(ptr %p, <4 x i32> %mask) {
2076 ; CHECK-LABEL: test_masked_z_i32_to_4_mem_mask3:
2078 ; CHECK-NEXT: vptestnmd %xmm0, %xmm0, %k1
2079 ; CHECK-NEXT: vpbroadcastd (%rdi), %xmm0 {%k1} {z}
2081 %s = load i32, ptr %p
2082 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2083 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2084 %cmp = icmp eq <4 x i32> %mask, zeroinitializer
2085 %res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
2088 define <8 x i32> @test_i32_to_8_mem(ptr %p) {
2089 ; CHECK-LABEL: test_i32_to_8_mem:
2091 ; CHECK-NEXT: vbroadcastss (%rdi), %ymm0
2093 %s = load i32, ptr %p
2094 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2095 %res = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2098 define <8 x i32> @test_masked_i32_to_8_mem_mask0(ptr %p, <8 x i32> %default, <8 x i32> %mask) {
2099 ; CHECK-LABEL: test_masked_i32_to_8_mem_mask0:
2101 ; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
2102 ; CHECK-NEXT: vpbroadcastd (%rdi), %ymm0 {%k1}
2104 %s = load i32, ptr %p
2105 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2106 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2107 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
2108 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
2112 define <8 x i32> @test_masked_z_i32_to_8_mem_mask0(ptr %p, <8 x i32> %mask) {
2113 ; CHECK-LABEL: test_masked_z_i32_to_8_mem_mask0:
2115 ; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
2116 ; CHECK-NEXT: vpbroadcastd (%rdi), %ymm0 {%k1} {z}
2118 %s = load i32, ptr %p
2119 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2120 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2121 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
2122 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
2125 define <8 x i32> @test_masked_i32_to_8_mem_mask1(ptr %p, <8 x i32> %default, <8 x i32> %mask) {
2126 ; CHECK-LABEL: test_masked_i32_to_8_mem_mask1:
2128 ; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
2129 ; CHECK-NEXT: vpbroadcastd (%rdi), %ymm0 {%k1}
2131 %s = load i32, ptr %p
2132 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2133 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2134 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
2135 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
2139 define <8 x i32> @test_masked_z_i32_to_8_mem_mask1(ptr %p, <8 x i32> %mask) {
2140 ; CHECK-LABEL: test_masked_z_i32_to_8_mem_mask1:
2142 ; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
2143 ; CHECK-NEXT: vpbroadcastd (%rdi), %ymm0 {%k1} {z}
2145 %s = load i32, ptr %p
2146 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2147 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2148 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
2149 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
2152 define <8 x i32> @test_masked_i32_to_8_mem_mask2(ptr %p, <8 x i32> %default, <8 x i32> %mask) {
2153 ; CHECK-LABEL: test_masked_i32_to_8_mem_mask2:
2155 ; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
2156 ; CHECK-NEXT: vpbroadcastd (%rdi), %ymm0 {%k1}
2158 %s = load i32, ptr %p
2159 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2160 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2161 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
2162 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
2166 define <8 x i32> @test_masked_z_i32_to_8_mem_mask2(ptr %p, <8 x i32> %mask) {
2167 ; CHECK-LABEL: test_masked_z_i32_to_8_mem_mask2:
2169 ; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
2170 ; CHECK-NEXT: vpbroadcastd (%rdi), %ymm0 {%k1} {z}
2172 %s = load i32, ptr %p
2173 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2174 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2175 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
2176 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
2179 define <8 x i32> @test_masked_i32_to_8_mem_mask3(ptr %p, <8 x i32> %default, <8 x i32> %mask) {
2180 ; CHECK-LABEL: test_masked_i32_to_8_mem_mask3:
2182 ; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
2183 ; CHECK-NEXT: vpbroadcastd (%rdi), %ymm0 {%k1}
2185 %s = load i32, ptr %p
2186 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2187 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2188 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
2189 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
2193 define <8 x i32> @test_masked_z_i32_to_8_mem_mask3(ptr %p, <8 x i32> %mask) {
2194 ; CHECK-LABEL: test_masked_z_i32_to_8_mem_mask3:
2196 ; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
2197 ; CHECK-NEXT: vpbroadcastd (%rdi), %ymm0 {%k1} {z}
2199 %s = load i32, ptr %p
2200 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2201 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2202 %cmp = icmp eq <8 x i32> %mask, zeroinitializer
2203 %res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
2206 define <16 x i32> @test_i32_to_16_mem(ptr %p) {
2207 ; CHECK-LABEL: test_i32_to_16_mem:
2209 ; CHECK-NEXT: vbroadcastss (%rdi), %zmm0
2211 %s = load i32, ptr %p
2212 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2213 %res = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2216 define <16 x i32> @test_masked_i32_to_16_mem_mask0(ptr %p, <16 x i32> %default, <16 x i32> %mask) {
2217 ; CHECK-LABEL: test_masked_i32_to_16_mem_mask0:
2219 ; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
2220 ; CHECK-NEXT: vpbroadcastd (%rdi), %zmm0 {%k1}
2222 %s = load i32, ptr %p
2223 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2224 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2225 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
2226 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
2230 define <16 x i32> @test_masked_z_i32_to_16_mem_mask0(ptr %p, <16 x i32> %mask) {
2231 ; CHECK-LABEL: test_masked_z_i32_to_16_mem_mask0:
2233 ; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
2234 ; CHECK-NEXT: vpbroadcastd (%rdi), %zmm0 {%k1} {z}
2236 %s = load i32, ptr %p
2237 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2238 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2239 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
2240 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
2243 define <16 x i32> @test_masked_i32_to_16_mem_mask1(ptr %p, <16 x i32> %default, <16 x i32> %mask) {
2244 ; CHECK-LABEL: test_masked_i32_to_16_mem_mask1:
2246 ; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
2247 ; CHECK-NEXT: vpbroadcastd (%rdi), %zmm0 {%k1}
2249 %s = load i32, ptr %p
2250 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2251 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2252 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
2253 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
2257 define <16 x i32> @test_masked_z_i32_to_16_mem_mask1(ptr %p, <16 x i32> %mask) {
2258 ; CHECK-LABEL: test_masked_z_i32_to_16_mem_mask1:
2260 ; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
2261 ; CHECK-NEXT: vpbroadcastd (%rdi), %zmm0 {%k1} {z}
2263 %s = load i32, ptr %p
2264 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2265 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2266 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
2267 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
2270 define <16 x i32> @test_masked_i32_to_16_mem_mask2(ptr %p, <16 x i32> %default, <16 x i32> %mask) {
2271 ; CHECK-LABEL: test_masked_i32_to_16_mem_mask2:
2273 ; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
2274 ; CHECK-NEXT: vpbroadcastd (%rdi), %zmm0 {%k1}
2276 %s = load i32, ptr %p
2277 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2278 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2279 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
2280 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
2284 define <16 x i32> @test_masked_z_i32_to_16_mem_mask2(ptr %p, <16 x i32> %mask) {
2285 ; CHECK-LABEL: test_masked_z_i32_to_16_mem_mask2:
2287 ; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
2288 ; CHECK-NEXT: vpbroadcastd (%rdi), %zmm0 {%k1} {z}
2290 %s = load i32, ptr %p
2291 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2292 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2293 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
2294 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
2297 define <16 x i32> @test_masked_i32_to_16_mem_mask3(ptr %p, <16 x i32> %default, <16 x i32> %mask) {
2298 ; CHECK-LABEL: test_masked_i32_to_16_mem_mask3:
2300 ; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
2301 ; CHECK-NEXT: vpbroadcastd (%rdi), %zmm0 {%k1}
2303 %s = load i32, ptr %p
2304 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2305 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2306 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
2307 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
2311 define <16 x i32> @test_masked_z_i32_to_16_mem_mask3(ptr %p, <16 x i32> %mask) {
2312 ; CHECK-LABEL: test_masked_z_i32_to_16_mem_mask3:
2314 ; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
2315 ; CHECK-NEXT: vpbroadcastd (%rdi), %zmm0 {%k1} {z}
2317 %s = load i32, ptr %p
2318 %vec = insertelement <2 x i32> undef, i32 %s, i32 0
2319 %shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2320 %cmp = icmp eq <16 x i32> %mask, zeroinitializer
2321 %res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
2324 define <2 x i64> @test_i64_to_2_mem(ptr %p) {
2325 ; CHECK-LABEL: test_i64_to_2_mem:
2327 ; CHECK-NEXT: vmovddup {{.*#+}} xmm0 = mem[0,0]
2329 %s = load i64, ptr %p
2330 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2331 %res = shufflevector <2 x i64> %vec, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
2334 define <2 x i64> @test_masked_i64_to_2_mem_mask0(ptr %p, <2 x i64> %default, <2 x i64> %mask) {
2335 ; CHECK-LABEL: test_masked_i64_to_2_mem_mask0:
2337 ; CHECK-NEXT: vptestnmq %xmm1, %xmm1, %k1
2338 ; CHECK-NEXT: vpbroadcastq (%rdi), %xmm0 {%k1}
2340 %s = load i64, ptr %p
2341 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2342 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
2343 %cmp = icmp eq <2 x i64> %mask, zeroinitializer
2344 %res = select <2 x i1> %cmp, <2 x i64> %shuf, <2 x i64> %default
2348 define <2 x i64> @test_masked_z_i64_to_2_mem_mask0(ptr %p, <2 x i64> %mask) {
2349 ; CHECK-LABEL: test_masked_z_i64_to_2_mem_mask0:
2351 ; CHECK-NEXT: vptestnmq %xmm0, %xmm0, %k1
2352 ; CHECK-NEXT: vpbroadcastq (%rdi), %xmm0 {%k1} {z}
2354 %s = load i64, ptr %p
2355 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2356 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
2357 %cmp = icmp eq <2 x i64> %mask, zeroinitializer
2358 %res = select <2 x i1> %cmp, <2 x i64> %shuf, <2 x i64> zeroinitializer
2361 define <2 x i64> @test_masked_i64_to_2_mem_mask1(ptr %p, <2 x i64> %default, <2 x i64> %mask) {
2362 ; CHECK-LABEL: test_masked_i64_to_2_mem_mask1:
2364 ; CHECK-NEXT: vptestnmq %xmm1, %xmm1, %k1
2365 ; CHECK-NEXT: vpbroadcastq (%rdi), %xmm0 {%k1}
2367 %s = load i64, ptr %p
2368 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2369 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
2370 %cmp = icmp eq <2 x i64> %mask, zeroinitializer
2371 %res = select <2 x i1> %cmp, <2 x i64> %shuf, <2 x i64> %default
2375 define <2 x i64> @test_masked_z_i64_to_2_mem_mask1(ptr %p, <2 x i64> %mask) {
2376 ; CHECK-LABEL: test_masked_z_i64_to_2_mem_mask1:
2378 ; CHECK-NEXT: vptestnmq %xmm0, %xmm0, %k1
2379 ; CHECK-NEXT: vpbroadcastq (%rdi), %xmm0 {%k1} {z}
2381 %s = load i64, ptr %p
2382 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2383 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
2384 %cmp = icmp eq <2 x i64> %mask, zeroinitializer
2385 %res = select <2 x i1> %cmp, <2 x i64> %shuf, <2 x i64> zeroinitializer
2388 define <4 x i64> @test_i64_to_4_mem(ptr %p) {
2389 ; CHECK-LABEL: test_i64_to_4_mem:
2391 ; CHECK-NEXT: vbroadcastsd (%rdi), %ymm0
2393 %s = load i64, ptr %p
2394 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2395 %res = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2398 define <4 x i64> @test_masked_i64_to_4_mem_mask0(ptr %p, <4 x i64> %default, <4 x i64> %mask) {
2399 ; CHECK-LABEL: test_masked_i64_to_4_mem_mask0:
2401 ; CHECK-NEXT: vptestnmq %ymm1, %ymm1, %k1
2402 ; CHECK-NEXT: vpbroadcastq (%rdi), %ymm0 {%k1}
2404 %s = load i64, ptr %p
2405 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2406 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2407 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
2408 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> %default
2412 define <4 x i64> @test_masked_z_i64_to_4_mem_mask0(ptr %p, <4 x i64> %mask) {
2413 ; CHECK-LABEL: test_masked_z_i64_to_4_mem_mask0:
2415 ; CHECK-NEXT: vptestnmq %ymm0, %ymm0, %k1
2416 ; CHECK-NEXT: vpbroadcastq (%rdi), %ymm0 {%k1} {z}
2418 %s = load i64, ptr %p
2419 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2420 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2421 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
2422 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> zeroinitializer
2425 define <4 x i64> @test_masked_i64_to_4_mem_mask1(ptr %p, <4 x i64> %default, <4 x i64> %mask) {
2426 ; CHECK-LABEL: test_masked_i64_to_4_mem_mask1:
2428 ; CHECK-NEXT: vptestnmq %ymm1, %ymm1, %k1
2429 ; CHECK-NEXT: vpbroadcastq (%rdi), %ymm0 {%k1}
2431 %s = load i64, ptr %p
2432 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2433 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2434 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
2435 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> %default
2439 define <4 x i64> @test_masked_z_i64_to_4_mem_mask1(ptr %p, <4 x i64> %mask) {
2440 ; CHECK-LABEL: test_masked_z_i64_to_4_mem_mask1:
2442 ; CHECK-NEXT: vptestnmq %ymm0, %ymm0, %k1
2443 ; CHECK-NEXT: vpbroadcastq (%rdi), %ymm0 {%k1} {z}
2445 %s = load i64, ptr %p
2446 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2447 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2448 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
2449 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> zeroinitializer
2452 define <4 x i64> @test_masked_i64_to_4_mem_mask2(ptr %p, <4 x i64> %default, <4 x i64> %mask) {
2453 ; CHECK-LABEL: test_masked_i64_to_4_mem_mask2:
2455 ; CHECK-NEXT: vptestnmq %ymm1, %ymm1, %k1
2456 ; CHECK-NEXT: vpbroadcastq (%rdi), %ymm0 {%k1}
2458 %s = load i64, ptr %p
2459 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2460 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2461 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
2462 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> %default
2466 define <4 x i64> @test_masked_z_i64_to_4_mem_mask2(ptr %p, <4 x i64> %mask) {
2467 ; CHECK-LABEL: test_masked_z_i64_to_4_mem_mask2:
2469 ; CHECK-NEXT: vptestnmq %ymm0, %ymm0, %k1
2470 ; CHECK-NEXT: vpbroadcastq (%rdi), %ymm0 {%k1} {z}
2472 %s = load i64, ptr %p
2473 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2474 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2475 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
2476 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> zeroinitializer
2479 define <4 x i64> @test_masked_i64_to_4_mem_mask3(ptr %p, <4 x i64> %default, <4 x i64> %mask) {
2480 ; CHECK-LABEL: test_masked_i64_to_4_mem_mask3:
2482 ; CHECK-NEXT: vptestnmq %ymm1, %ymm1, %k1
2483 ; CHECK-NEXT: vpbroadcastq (%rdi), %ymm0 {%k1}
2485 %s = load i64, ptr %p
2486 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2487 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2488 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
2489 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> %default
2493 define <4 x i64> @test_masked_z_i64_to_4_mem_mask3(ptr %p, <4 x i64> %mask) {
2494 ; CHECK-LABEL: test_masked_z_i64_to_4_mem_mask3:
2496 ; CHECK-NEXT: vptestnmq %ymm0, %ymm0, %k1
2497 ; CHECK-NEXT: vpbroadcastq (%rdi), %ymm0 {%k1} {z}
2499 %s = load i64, ptr %p
2500 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2501 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
2502 %cmp = icmp eq <4 x i64> %mask, zeroinitializer
2503 %res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> zeroinitializer
2506 define <8 x i64> @test_i64_to_8_mem(ptr %p) {
2507 ; CHECK-LABEL: test_i64_to_8_mem:
2509 ; CHECK-NEXT: vbroadcastsd (%rdi), %zmm0
2511 %s = load i64, ptr %p
2512 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2513 %res = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2516 define <8 x i64> @test_masked_i64_to_8_mem_mask0(ptr %p, <8 x i64> %default, <8 x i64> %mask) {
2517 ; CHECK-LABEL: test_masked_i64_to_8_mem_mask0:
2519 ; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
2520 ; CHECK-NEXT: vpbroadcastq (%rdi), %zmm0 {%k1}
2522 %s = load i64, ptr %p
2523 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2524 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2525 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
2526 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
2530 define <8 x i64> @test_masked_z_i64_to_8_mem_mask0(ptr %p, <8 x i64> %mask) {
2531 ; CHECK-LABEL: test_masked_z_i64_to_8_mem_mask0:
2533 ; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
2534 ; CHECK-NEXT: vpbroadcastq (%rdi), %zmm0 {%k1} {z}
2536 %s = load i64, ptr %p
2537 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2538 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2539 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
2540 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer
2543 define <8 x i64> @test_masked_i64_to_8_mem_mask1(ptr %p, <8 x i64> %default, <8 x i64> %mask) {
2544 ; CHECK-LABEL: test_masked_i64_to_8_mem_mask1:
2546 ; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
2547 ; CHECK-NEXT: vpbroadcastq (%rdi), %zmm0 {%k1}
2549 %s = load i64, ptr %p
2550 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2551 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2552 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
2553 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
2557 define <8 x i64> @test_masked_z_i64_to_8_mem_mask1(ptr %p, <8 x i64> %mask) {
2558 ; CHECK-LABEL: test_masked_z_i64_to_8_mem_mask1:
2560 ; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
2561 ; CHECK-NEXT: vpbroadcastq (%rdi), %zmm0 {%k1} {z}
2563 %s = load i64, ptr %p
2564 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2565 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2566 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
2567 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer
2570 define <8 x i64> @test_masked_i64_to_8_mem_mask2(ptr %p, <8 x i64> %default, <8 x i64> %mask) {
2571 ; CHECK-LABEL: test_masked_i64_to_8_mem_mask2:
2573 ; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
2574 ; CHECK-NEXT: vpbroadcastq (%rdi), %zmm0 {%k1}
2576 %s = load i64, ptr %p
2577 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2578 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2579 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
2580 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
2584 define <8 x i64> @test_masked_z_i64_to_8_mem_mask2(ptr %p, <8 x i64> %mask) {
2585 ; CHECK-LABEL: test_masked_z_i64_to_8_mem_mask2:
2587 ; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
2588 ; CHECK-NEXT: vpbroadcastq (%rdi), %zmm0 {%k1} {z}
2590 %s = load i64, ptr %p
2591 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2592 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2593 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
2594 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer
2597 define <8 x i64> @test_masked_i64_to_8_mem_mask3(ptr %p, <8 x i64> %default, <8 x i64> %mask) {
2598 ; CHECK-LABEL: test_masked_i64_to_8_mem_mask3:
2600 ; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
2601 ; CHECK-NEXT: vpbroadcastq (%rdi), %zmm0 {%k1}
2603 %s = load i64, ptr %p
2604 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2605 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2606 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
2607 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
2611 define <8 x i64> @test_masked_z_i64_to_8_mem_mask3(ptr %p, <8 x i64> %mask) {
2612 ; CHECK-LABEL: test_masked_z_i64_to_8_mem_mask3:
2614 ; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
2615 ; CHECK-NEXT: vpbroadcastq (%rdi), %zmm0 {%k1} {z}
2617 %s = load i64, ptr %p
2618 %vec = insertelement <2 x i64> undef, i64 %s, i32 0
2619 %shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
2620 %cmp = icmp eq <8 x i64> %mask, zeroinitializer
2621 %res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer