1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512dq,+avx512cd,-avx512bw | FileCheck %s --check-prefix=ALL --check-prefix=AVX512CD
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512dq,+avx512cd,+avx512bw | FileCheck %s --check-prefix=ALL --check-prefix=AVX512CDBW
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512dq,-avx512cd,+avx512bw | FileCheck %s --check-prefix=ALL --check-prefix=AVX512BW
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512dq,-avx512cd,-avx512bw | FileCheck %s --check-prefix=ALL --check-prefix=AVX512DQ
7 define <8 x i64> @testv8i64(<8 x i64> %in) nounwind {
8 ; AVX512CD-LABEL: testv8i64:
10 ; AVX512CD-NEXT: vplzcntq %zmm0, %zmm0
13 ; AVX512CDBW-LABEL: testv8i64:
14 ; AVX512CDBW: # %bb.0:
15 ; AVX512CDBW-NEXT: vplzcntq %zmm0, %zmm0
16 ; AVX512CDBW-NEXT: retq
18 ; AVX512BW-LABEL: testv8i64:
20 ; AVX512BW-NEXT: vpsrlq $1, %zmm0, %zmm1
21 ; AVX512BW-NEXT: vporq %zmm1, %zmm0, %zmm0
22 ; AVX512BW-NEXT: vpsrlq $2, %zmm0, %zmm1
23 ; AVX512BW-NEXT: vporq %zmm1, %zmm0, %zmm0
24 ; AVX512BW-NEXT: vpsrlq $4, %zmm0, %zmm1
25 ; AVX512BW-NEXT: vporq %zmm1, %zmm0, %zmm0
26 ; AVX512BW-NEXT: vpsrlq $8, %zmm0, %zmm1
27 ; AVX512BW-NEXT: vporq %zmm1, %zmm0, %zmm0
28 ; AVX512BW-NEXT: vpsrlq $16, %zmm0, %zmm1
29 ; AVX512BW-NEXT: vporq %zmm1, %zmm0, %zmm0
30 ; AVX512BW-NEXT: vpsrlq $32, %zmm0, %zmm1
31 ; AVX512BW-NEXT: vporq %zmm1, %zmm0, %zmm0
32 ; AVX512BW-NEXT: vmovdqa64 {{.*#+}} zmm1 = [15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]
33 ; AVX512BW-NEXT: vpandnq %zmm1, %zmm0, %zmm2
34 ; AVX512BW-NEXT: vmovdqa64 {{.*#+}} zmm3 = [0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4]
35 ; AVX512BW-NEXT: vpshufb %zmm2, %zmm3, %zmm2
36 ; AVX512BW-NEXT: vpternlogq $15, %zmm0, %zmm0, %zmm0
37 ; AVX512BW-NEXT: vpsrlw $4, %zmm0, %zmm0
38 ; AVX512BW-NEXT: vpandq %zmm1, %zmm0, %zmm0
39 ; AVX512BW-NEXT: vpshufb %zmm0, %zmm3, %zmm0
40 ; AVX512BW-NEXT: vpaddb %zmm2, %zmm0, %zmm0
41 ; AVX512BW-NEXT: vpxor %xmm1, %xmm1, %xmm1
42 ; AVX512BW-NEXT: vpsadbw %zmm1, %zmm0, %zmm0
45 ; AVX512DQ-LABEL: testv8i64:
47 ; AVX512DQ-NEXT: vpsrlq $1, %zmm0, %zmm1
48 ; AVX512DQ-NEXT: vporq %zmm1, %zmm0, %zmm0
49 ; AVX512DQ-NEXT: vpsrlq $2, %zmm0, %zmm1
50 ; AVX512DQ-NEXT: vporq %zmm1, %zmm0, %zmm0
51 ; AVX512DQ-NEXT: vpsrlq $4, %zmm0, %zmm1
52 ; AVX512DQ-NEXT: vporq %zmm1, %zmm0, %zmm0
53 ; AVX512DQ-NEXT: vpsrlq $8, %zmm0, %zmm1
54 ; AVX512DQ-NEXT: vporq %zmm1, %zmm0, %zmm0
55 ; AVX512DQ-NEXT: vpsrlq $16, %zmm0, %zmm1
56 ; AVX512DQ-NEXT: vporq %zmm1, %zmm0, %zmm0
57 ; AVX512DQ-NEXT: vpsrlq $32, %zmm0, %zmm1
58 ; AVX512DQ-NEXT: vporq %zmm1, %zmm0, %zmm0
59 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm1 = [15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]
60 ; AVX512DQ-NEXT: vpandn %ymm1, %ymm0, %ymm2
61 ; AVX512DQ-NEXT: vpternlogq $15, %zmm0, %zmm0, %zmm0
62 ; AVX512DQ-NEXT: vextracti64x4 $1, %zmm0, %ymm3
63 ; AVX512DQ-NEXT: vpand %ymm1, %ymm3, %ymm4
64 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm5 = [0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4]
65 ; AVX512DQ-NEXT: vpshufb %ymm4, %ymm5, %ymm4
66 ; AVX512DQ-NEXT: vpsrlw $4, %ymm3, %ymm3
67 ; AVX512DQ-NEXT: vpand %ymm1, %ymm3, %ymm3
68 ; AVX512DQ-NEXT: vpshufb %ymm3, %ymm5, %ymm3
69 ; AVX512DQ-NEXT: vpaddb %ymm4, %ymm3, %ymm3
70 ; AVX512DQ-NEXT: vpxor %xmm4, %xmm4, %xmm4
71 ; AVX512DQ-NEXT: vpsadbw %ymm4, %ymm3, %ymm3
72 ; AVX512DQ-NEXT: vpshufb %ymm2, %ymm5, %ymm2
73 ; AVX512DQ-NEXT: vpsrlw $4, %ymm0, %ymm0
74 ; AVX512DQ-NEXT: vpand %ymm1, %ymm0, %ymm0
75 ; AVX512DQ-NEXT: vpshufb %ymm0, %ymm5, %ymm0
76 ; AVX512DQ-NEXT: vpaddb %ymm2, %ymm0, %ymm0
77 ; AVX512DQ-NEXT: vpsadbw %ymm4, %ymm0, %ymm0
78 ; AVX512DQ-NEXT: vinserti64x4 $1, %ymm3, %zmm0, %zmm0
80 %out = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %in, i1 0)
84 define <8 x i64> @testv8i64u(<8 x i64> %in) nounwind {
85 ; AVX512CD-LABEL: testv8i64u:
87 ; AVX512CD-NEXT: vplzcntq %zmm0, %zmm0
90 ; AVX512CDBW-LABEL: testv8i64u:
91 ; AVX512CDBW: # %bb.0:
92 ; AVX512CDBW-NEXT: vplzcntq %zmm0, %zmm0
93 ; AVX512CDBW-NEXT: retq
95 ; AVX512BW-LABEL: testv8i64u:
97 ; AVX512BW-NEXT: vpsrlq $1, %zmm0, %zmm1
98 ; AVX512BW-NEXT: vporq %zmm1, %zmm0, %zmm0
99 ; AVX512BW-NEXT: vpsrlq $2, %zmm0, %zmm1
100 ; AVX512BW-NEXT: vporq %zmm1, %zmm0, %zmm0
101 ; AVX512BW-NEXT: vpsrlq $4, %zmm0, %zmm1
102 ; AVX512BW-NEXT: vporq %zmm1, %zmm0, %zmm0
103 ; AVX512BW-NEXT: vpsrlq $8, %zmm0, %zmm1
104 ; AVX512BW-NEXT: vporq %zmm1, %zmm0, %zmm0
105 ; AVX512BW-NEXT: vpsrlq $16, %zmm0, %zmm1
106 ; AVX512BW-NEXT: vporq %zmm1, %zmm0, %zmm0
107 ; AVX512BW-NEXT: vpsrlq $32, %zmm0, %zmm1
108 ; AVX512BW-NEXT: vporq %zmm1, %zmm0, %zmm0
109 ; AVX512BW-NEXT: vmovdqa64 {{.*#+}} zmm1 = [15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]
110 ; AVX512BW-NEXT: vpandnq %zmm1, %zmm0, %zmm2
111 ; AVX512BW-NEXT: vmovdqa64 {{.*#+}} zmm3 = [0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4]
112 ; AVX512BW-NEXT: vpshufb %zmm2, %zmm3, %zmm2
113 ; AVX512BW-NEXT: vpternlogq $15, %zmm0, %zmm0, %zmm0
114 ; AVX512BW-NEXT: vpsrlw $4, %zmm0, %zmm0
115 ; AVX512BW-NEXT: vpandq %zmm1, %zmm0, %zmm0
116 ; AVX512BW-NEXT: vpshufb %zmm0, %zmm3, %zmm0
117 ; AVX512BW-NEXT: vpaddb %zmm2, %zmm0, %zmm0
118 ; AVX512BW-NEXT: vpxor %xmm1, %xmm1, %xmm1
119 ; AVX512BW-NEXT: vpsadbw %zmm1, %zmm0, %zmm0
120 ; AVX512BW-NEXT: retq
122 ; AVX512DQ-LABEL: testv8i64u:
124 ; AVX512DQ-NEXT: vpsrlq $1, %zmm0, %zmm1
125 ; AVX512DQ-NEXT: vporq %zmm1, %zmm0, %zmm0
126 ; AVX512DQ-NEXT: vpsrlq $2, %zmm0, %zmm1
127 ; AVX512DQ-NEXT: vporq %zmm1, %zmm0, %zmm0
128 ; AVX512DQ-NEXT: vpsrlq $4, %zmm0, %zmm1
129 ; AVX512DQ-NEXT: vporq %zmm1, %zmm0, %zmm0
130 ; AVX512DQ-NEXT: vpsrlq $8, %zmm0, %zmm1
131 ; AVX512DQ-NEXT: vporq %zmm1, %zmm0, %zmm0
132 ; AVX512DQ-NEXT: vpsrlq $16, %zmm0, %zmm1
133 ; AVX512DQ-NEXT: vporq %zmm1, %zmm0, %zmm0
134 ; AVX512DQ-NEXT: vpsrlq $32, %zmm0, %zmm1
135 ; AVX512DQ-NEXT: vporq %zmm1, %zmm0, %zmm0
136 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm1 = [15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]
137 ; AVX512DQ-NEXT: vpandn %ymm1, %ymm0, %ymm2
138 ; AVX512DQ-NEXT: vpternlogq $15, %zmm0, %zmm0, %zmm0
139 ; AVX512DQ-NEXT: vextracti64x4 $1, %zmm0, %ymm3
140 ; AVX512DQ-NEXT: vpand %ymm1, %ymm3, %ymm4
141 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm5 = [0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4]
142 ; AVX512DQ-NEXT: vpshufb %ymm4, %ymm5, %ymm4
143 ; AVX512DQ-NEXT: vpsrlw $4, %ymm3, %ymm3
144 ; AVX512DQ-NEXT: vpand %ymm1, %ymm3, %ymm3
145 ; AVX512DQ-NEXT: vpshufb %ymm3, %ymm5, %ymm3
146 ; AVX512DQ-NEXT: vpaddb %ymm4, %ymm3, %ymm3
147 ; AVX512DQ-NEXT: vpxor %xmm4, %xmm4, %xmm4
148 ; AVX512DQ-NEXT: vpsadbw %ymm4, %ymm3, %ymm3
149 ; AVX512DQ-NEXT: vpshufb %ymm2, %ymm5, %ymm2
150 ; AVX512DQ-NEXT: vpsrlw $4, %ymm0, %ymm0
151 ; AVX512DQ-NEXT: vpand %ymm1, %ymm0, %ymm0
152 ; AVX512DQ-NEXT: vpshufb %ymm0, %ymm5, %ymm0
153 ; AVX512DQ-NEXT: vpaddb %ymm2, %ymm0, %ymm0
154 ; AVX512DQ-NEXT: vpsadbw %ymm4, %ymm0, %ymm0
155 ; AVX512DQ-NEXT: vinserti64x4 $1, %ymm3, %zmm0, %zmm0
156 ; AVX512DQ-NEXT: retq
157 %out = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %in, i1 -1)
161 define <16 x i32> @testv16i32(<16 x i32> %in) nounwind {
162 ; AVX512CD-LABEL: testv16i32:
164 ; AVX512CD-NEXT: vplzcntd %zmm0, %zmm0
165 ; AVX512CD-NEXT: retq
167 ; AVX512CDBW-LABEL: testv16i32:
168 ; AVX512CDBW: # %bb.0:
169 ; AVX512CDBW-NEXT: vplzcntd %zmm0, %zmm0
170 ; AVX512CDBW-NEXT: retq
172 ; AVX512BW-LABEL: testv16i32:
174 ; AVX512BW-NEXT: vpsrld $1, %zmm0, %zmm1
175 ; AVX512BW-NEXT: vpord %zmm1, %zmm0, %zmm0
176 ; AVX512BW-NEXT: vpsrld $2, %zmm0, %zmm1
177 ; AVX512BW-NEXT: vpord %zmm1, %zmm0, %zmm0
178 ; AVX512BW-NEXT: vpsrld $4, %zmm0, %zmm1
179 ; AVX512BW-NEXT: vpord %zmm1, %zmm0, %zmm0
180 ; AVX512BW-NEXT: vpsrld $8, %zmm0, %zmm1
181 ; AVX512BW-NEXT: vpord %zmm1, %zmm0, %zmm0
182 ; AVX512BW-NEXT: vpsrld $16, %zmm0, %zmm1
183 ; AVX512BW-NEXT: vpord %zmm1, %zmm0, %zmm0
184 ; AVX512BW-NEXT: vmovdqa64 {{.*#+}} zmm1 = [15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]
185 ; AVX512BW-NEXT: vpandnq %zmm1, %zmm0, %zmm2
186 ; AVX512BW-NEXT: vmovdqa64 {{.*#+}} zmm3 = [0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4]
187 ; AVX512BW-NEXT: vpshufb %zmm2, %zmm3, %zmm2
188 ; AVX512BW-NEXT: vpternlogq $15, %zmm0, %zmm0, %zmm0
189 ; AVX512BW-NEXT: vpsrlw $4, %zmm0, %zmm0
190 ; AVX512BW-NEXT: vpandq %zmm1, %zmm0, %zmm0
191 ; AVX512BW-NEXT: vpshufb %zmm0, %zmm3, %zmm0
192 ; AVX512BW-NEXT: vpaddb %zmm2, %zmm0, %zmm0
193 ; AVX512BW-NEXT: vpxor %xmm1, %xmm1, %xmm1
194 ; AVX512BW-NEXT: vpunpckhdq {{.*#+}} zmm2 = zmm0[2],zmm1[2],zmm0[3],zmm1[3],zmm0[6],zmm1[6],zmm0[7],zmm1[7],zmm0[10],zmm1[10],zmm0[11],zmm1[11],zmm0[14],zmm1[14],zmm0[15],zmm1[15]
195 ; AVX512BW-NEXT: vpsadbw %zmm1, %zmm2, %zmm2
196 ; AVX512BW-NEXT: vpunpckldq {{.*#+}} zmm0 = zmm0[0],zmm1[0],zmm0[1],zmm1[1],zmm0[4],zmm1[4],zmm0[5],zmm1[5],zmm0[8],zmm1[8],zmm0[9],zmm1[9],zmm0[12],zmm1[12],zmm0[13],zmm1[13]
197 ; AVX512BW-NEXT: vpsadbw %zmm1, %zmm0, %zmm0
198 ; AVX512BW-NEXT: vpackuswb %zmm2, %zmm0, %zmm0
199 ; AVX512BW-NEXT: retq
201 ; AVX512DQ-LABEL: testv16i32:
203 ; AVX512DQ-NEXT: vpsrld $1, %zmm0, %zmm1
204 ; AVX512DQ-NEXT: vpord %zmm1, %zmm0, %zmm0
205 ; AVX512DQ-NEXT: vpsrld $2, %zmm0, %zmm1
206 ; AVX512DQ-NEXT: vpord %zmm1, %zmm0, %zmm0
207 ; AVX512DQ-NEXT: vpsrld $4, %zmm0, %zmm1
208 ; AVX512DQ-NEXT: vpord %zmm1, %zmm0, %zmm0
209 ; AVX512DQ-NEXT: vpsrld $8, %zmm0, %zmm1
210 ; AVX512DQ-NEXT: vpord %zmm1, %zmm0, %zmm0
211 ; AVX512DQ-NEXT: vpsrld $16, %zmm0, %zmm1
212 ; AVX512DQ-NEXT: vpord %zmm1, %zmm0, %zmm0
213 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm1 = [15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]
214 ; AVX512DQ-NEXT: vpandn %ymm1, %ymm0, %ymm2
215 ; AVX512DQ-NEXT: vpternlogq $15, %zmm0, %zmm0, %zmm0
216 ; AVX512DQ-NEXT: vextracti64x4 $1, %zmm0, %ymm3
217 ; AVX512DQ-NEXT: vpand %ymm1, %ymm3, %ymm4
218 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm5 = [0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4]
219 ; AVX512DQ-NEXT: vpshufb %ymm4, %ymm5, %ymm4
220 ; AVX512DQ-NEXT: vpsrlw $4, %ymm3, %ymm3
221 ; AVX512DQ-NEXT: vpand %ymm1, %ymm3, %ymm3
222 ; AVX512DQ-NEXT: vpshufb %ymm3, %ymm5, %ymm3
223 ; AVX512DQ-NEXT: vpaddb %ymm4, %ymm3, %ymm3
224 ; AVX512DQ-NEXT: vpxor %xmm4, %xmm4, %xmm4
225 ; AVX512DQ-NEXT: vpunpckhdq {{.*#+}} ymm6 = ymm3[2],ymm4[2],ymm3[3],ymm4[3],ymm3[6],ymm4[6],ymm3[7],ymm4[7]
226 ; AVX512DQ-NEXT: vpsadbw %ymm4, %ymm6, %ymm6
227 ; AVX512DQ-NEXT: vpunpckldq {{.*#+}} ymm3 = ymm3[0],ymm4[0],ymm3[1],ymm4[1],ymm3[4],ymm4[4],ymm3[5],ymm4[5]
228 ; AVX512DQ-NEXT: vpsadbw %ymm4, %ymm3, %ymm3
229 ; AVX512DQ-NEXT: vpackuswb %ymm6, %ymm3, %ymm3
230 ; AVX512DQ-NEXT: vpshufb %ymm2, %ymm5, %ymm2
231 ; AVX512DQ-NEXT: vpsrlw $4, %ymm0, %ymm0
232 ; AVX512DQ-NEXT: vpand %ymm1, %ymm0, %ymm0
233 ; AVX512DQ-NEXT: vpshufb %ymm0, %ymm5, %ymm0
234 ; AVX512DQ-NEXT: vpaddb %ymm2, %ymm0, %ymm0
235 ; AVX512DQ-NEXT: vpunpckhdq {{.*#+}} ymm1 = ymm0[2],ymm4[2],ymm0[3],ymm4[3],ymm0[6],ymm4[6],ymm0[7],ymm4[7]
236 ; AVX512DQ-NEXT: vpsadbw %ymm4, %ymm1, %ymm1
237 ; AVX512DQ-NEXT: vpunpckldq {{.*#+}} ymm0 = ymm0[0],ymm4[0],ymm0[1],ymm4[1],ymm0[4],ymm4[4],ymm0[5],ymm4[5]
238 ; AVX512DQ-NEXT: vpsadbw %ymm4, %ymm0, %ymm0
239 ; AVX512DQ-NEXT: vpackuswb %ymm1, %ymm0, %ymm0
240 ; AVX512DQ-NEXT: vinserti64x4 $1, %ymm3, %zmm0, %zmm0
241 ; AVX512DQ-NEXT: retq
242 %out = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %in, i1 0)
246 define <16 x i32> @testv16i32u(<16 x i32> %in) nounwind {
247 ; AVX512CD-LABEL: testv16i32u:
249 ; AVX512CD-NEXT: vplzcntd %zmm0, %zmm0
250 ; AVX512CD-NEXT: retq
252 ; AVX512CDBW-LABEL: testv16i32u:
253 ; AVX512CDBW: # %bb.0:
254 ; AVX512CDBW-NEXT: vplzcntd %zmm0, %zmm0
255 ; AVX512CDBW-NEXT: retq
257 ; AVX512BW-LABEL: testv16i32u:
259 ; AVX512BW-NEXT: vpsrld $1, %zmm0, %zmm1
260 ; AVX512BW-NEXT: vpord %zmm1, %zmm0, %zmm0
261 ; AVX512BW-NEXT: vpsrld $2, %zmm0, %zmm1
262 ; AVX512BW-NEXT: vpord %zmm1, %zmm0, %zmm0
263 ; AVX512BW-NEXT: vpsrld $4, %zmm0, %zmm1
264 ; AVX512BW-NEXT: vpord %zmm1, %zmm0, %zmm0
265 ; AVX512BW-NEXT: vpsrld $8, %zmm0, %zmm1
266 ; AVX512BW-NEXT: vpord %zmm1, %zmm0, %zmm0
267 ; AVX512BW-NEXT: vpsrld $16, %zmm0, %zmm1
268 ; AVX512BW-NEXT: vpord %zmm1, %zmm0, %zmm0
269 ; AVX512BW-NEXT: vmovdqa64 {{.*#+}} zmm1 = [15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]
270 ; AVX512BW-NEXT: vpandnq %zmm1, %zmm0, %zmm2
271 ; AVX512BW-NEXT: vmovdqa64 {{.*#+}} zmm3 = [0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4]
272 ; AVX512BW-NEXT: vpshufb %zmm2, %zmm3, %zmm2
273 ; AVX512BW-NEXT: vpternlogq $15, %zmm0, %zmm0, %zmm0
274 ; AVX512BW-NEXT: vpsrlw $4, %zmm0, %zmm0
275 ; AVX512BW-NEXT: vpandq %zmm1, %zmm0, %zmm0
276 ; AVX512BW-NEXT: vpshufb %zmm0, %zmm3, %zmm0
277 ; AVX512BW-NEXT: vpaddb %zmm2, %zmm0, %zmm0
278 ; AVX512BW-NEXT: vpxor %xmm1, %xmm1, %xmm1
279 ; AVX512BW-NEXT: vpunpckhdq {{.*#+}} zmm2 = zmm0[2],zmm1[2],zmm0[3],zmm1[3],zmm0[6],zmm1[6],zmm0[7],zmm1[7],zmm0[10],zmm1[10],zmm0[11],zmm1[11],zmm0[14],zmm1[14],zmm0[15],zmm1[15]
280 ; AVX512BW-NEXT: vpsadbw %zmm1, %zmm2, %zmm2
281 ; AVX512BW-NEXT: vpunpckldq {{.*#+}} zmm0 = zmm0[0],zmm1[0],zmm0[1],zmm1[1],zmm0[4],zmm1[4],zmm0[5],zmm1[5],zmm0[8],zmm1[8],zmm0[9],zmm1[9],zmm0[12],zmm1[12],zmm0[13],zmm1[13]
282 ; AVX512BW-NEXT: vpsadbw %zmm1, %zmm0, %zmm0
283 ; AVX512BW-NEXT: vpackuswb %zmm2, %zmm0, %zmm0
284 ; AVX512BW-NEXT: retq
286 ; AVX512DQ-LABEL: testv16i32u:
288 ; AVX512DQ-NEXT: vpsrld $1, %zmm0, %zmm1
289 ; AVX512DQ-NEXT: vpord %zmm1, %zmm0, %zmm0
290 ; AVX512DQ-NEXT: vpsrld $2, %zmm0, %zmm1
291 ; AVX512DQ-NEXT: vpord %zmm1, %zmm0, %zmm0
292 ; AVX512DQ-NEXT: vpsrld $4, %zmm0, %zmm1
293 ; AVX512DQ-NEXT: vpord %zmm1, %zmm0, %zmm0
294 ; AVX512DQ-NEXT: vpsrld $8, %zmm0, %zmm1
295 ; AVX512DQ-NEXT: vpord %zmm1, %zmm0, %zmm0
296 ; AVX512DQ-NEXT: vpsrld $16, %zmm0, %zmm1
297 ; AVX512DQ-NEXT: vpord %zmm1, %zmm0, %zmm0
298 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm1 = [15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]
299 ; AVX512DQ-NEXT: vpandn %ymm1, %ymm0, %ymm2
300 ; AVX512DQ-NEXT: vpternlogq $15, %zmm0, %zmm0, %zmm0
301 ; AVX512DQ-NEXT: vextracti64x4 $1, %zmm0, %ymm3
302 ; AVX512DQ-NEXT: vpand %ymm1, %ymm3, %ymm4
303 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm5 = [0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4]
304 ; AVX512DQ-NEXT: vpshufb %ymm4, %ymm5, %ymm4
305 ; AVX512DQ-NEXT: vpsrlw $4, %ymm3, %ymm3
306 ; AVX512DQ-NEXT: vpand %ymm1, %ymm3, %ymm3
307 ; AVX512DQ-NEXT: vpshufb %ymm3, %ymm5, %ymm3
308 ; AVX512DQ-NEXT: vpaddb %ymm4, %ymm3, %ymm3
309 ; AVX512DQ-NEXT: vpxor %xmm4, %xmm4, %xmm4
310 ; AVX512DQ-NEXT: vpunpckhdq {{.*#+}} ymm6 = ymm3[2],ymm4[2],ymm3[3],ymm4[3],ymm3[6],ymm4[6],ymm3[7],ymm4[7]
311 ; AVX512DQ-NEXT: vpsadbw %ymm4, %ymm6, %ymm6
312 ; AVX512DQ-NEXT: vpunpckldq {{.*#+}} ymm3 = ymm3[0],ymm4[0],ymm3[1],ymm4[1],ymm3[4],ymm4[4],ymm3[5],ymm4[5]
313 ; AVX512DQ-NEXT: vpsadbw %ymm4, %ymm3, %ymm3
314 ; AVX512DQ-NEXT: vpackuswb %ymm6, %ymm3, %ymm3
315 ; AVX512DQ-NEXT: vpshufb %ymm2, %ymm5, %ymm2
316 ; AVX512DQ-NEXT: vpsrlw $4, %ymm0, %ymm0
317 ; AVX512DQ-NEXT: vpand %ymm1, %ymm0, %ymm0
318 ; AVX512DQ-NEXT: vpshufb %ymm0, %ymm5, %ymm0
319 ; AVX512DQ-NEXT: vpaddb %ymm2, %ymm0, %ymm0
320 ; AVX512DQ-NEXT: vpunpckhdq {{.*#+}} ymm1 = ymm0[2],ymm4[2],ymm0[3],ymm4[3],ymm0[6],ymm4[6],ymm0[7],ymm4[7]
321 ; AVX512DQ-NEXT: vpsadbw %ymm4, %ymm1, %ymm1
322 ; AVX512DQ-NEXT: vpunpckldq {{.*#+}} ymm0 = ymm0[0],ymm4[0],ymm0[1],ymm4[1],ymm0[4],ymm4[4],ymm0[5],ymm4[5]
323 ; AVX512DQ-NEXT: vpsadbw %ymm4, %ymm0, %ymm0
324 ; AVX512DQ-NEXT: vpackuswb %ymm1, %ymm0, %ymm0
325 ; AVX512DQ-NEXT: vinserti64x4 $1, %ymm3, %zmm0, %zmm0
326 ; AVX512DQ-NEXT: retq
327 %out = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %in, i1 -1)
331 define <32 x i16> @testv32i16(<32 x i16> %in) nounwind {
332 ; AVX512CD-LABEL: testv32i16:
334 ; AVX512CD-NEXT: vpmovzxwd {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
335 ; AVX512CD-NEXT: vplzcntd %zmm0, %zmm0
336 ; AVX512CD-NEXT: vpmovdw %zmm0, %ymm0
337 ; AVX512CD-NEXT: vmovdqa {{.*#+}} ymm2 = [16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16]
338 ; AVX512CD-NEXT: vpsubw %ymm2, %ymm0, %ymm0
339 ; AVX512CD-NEXT: vpmovzxwd {{.*#+}} zmm1 = ymm1[0],zero,ymm1[1],zero,ymm1[2],zero,ymm1[3],zero,ymm1[4],zero,ymm1[5],zero,ymm1[6],zero,ymm1[7],zero,ymm1[8],zero,ymm1[9],zero,ymm1[10],zero,ymm1[11],zero,ymm1[12],zero,ymm1[13],zero,ymm1[14],zero,ymm1[15],zero
340 ; AVX512CD-NEXT: vplzcntd %zmm1, %zmm1
341 ; AVX512CD-NEXT: vpmovdw %zmm1, %ymm1
342 ; AVX512CD-NEXT: vpsubw %ymm2, %ymm1, %ymm1
343 ; AVX512CD-NEXT: retq
345 ; AVX512CDBW-LABEL: testv32i16:
346 ; AVX512CDBW: # %bb.0:
347 ; AVX512CDBW-NEXT: vextracti64x4 $1, %zmm0, %ymm1
348 ; AVX512CDBW-NEXT: vpmovzxwd {{.*#+}} zmm1 = ymm1[0],zero,ymm1[1],zero,ymm1[2],zero,ymm1[3],zero,ymm1[4],zero,ymm1[5],zero,ymm1[6],zero,ymm1[7],zero,ymm1[8],zero,ymm1[9],zero,ymm1[10],zero,ymm1[11],zero,ymm1[12],zero,ymm1[13],zero,ymm1[14],zero,ymm1[15],zero
349 ; AVX512CDBW-NEXT: vplzcntd %zmm1, %zmm1
350 ; AVX512CDBW-NEXT: vpmovdw %zmm1, %ymm1
351 ; AVX512CDBW-NEXT: vmovdqa {{.*#+}} ymm2 = [16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16]
352 ; AVX512CDBW-NEXT: vpsubw %ymm2, %ymm1, %ymm1
353 ; AVX512CDBW-NEXT: vpmovzxwd {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
354 ; AVX512CDBW-NEXT: vplzcntd %zmm0, %zmm0
355 ; AVX512CDBW-NEXT: vpmovdw %zmm0, %ymm0
356 ; AVX512CDBW-NEXT: vpsubw %ymm2, %ymm0, %ymm0
357 ; AVX512CDBW-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
358 ; AVX512CDBW-NEXT: retq
360 ; AVX512BW-LABEL: testv32i16:
362 ; AVX512BW-NEXT: vpsrlw $4, %zmm0, %zmm1
363 ; AVX512BW-NEXT: vpandq {{.*}}(%rip), %zmm1, %zmm1
364 ; AVX512BW-NEXT: vmovdqa64 {{.*#+}} zmm2 = [4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0]
365 ; AVX512BW-NEXT: vpshufb %zmm1, %zmm2, %zmm3
366 ; AVX512BW-NEXT: vpshufb %zmm0, %zmm2, %zmm2
367 ; AVX512BW-NEXT: vptestnmb %zmm1, %zmm1, %k0
368 ; AVX512BW-NEXT: vpmovm2b %k0, %zmm1
369 ; AVX512BW-NEXT: vpandq %zmm1, %zmm2, %zmm1
370 ; AVX512BW-NEXT: vpaddb %zmm3, %zmm1, %zmm1
371 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
372 ; AVX512BW-NEXT: vpmovm2b %k0, %zmm0
373 ; AVX512BW-NEXT: vpsrlw $8, %zmm0, %zmm0
374 ; AVX512BW-NEXT: vpandq %zmm0, %zmm1, %zmm0
375 ; AVX512BW-NEXT: vpsrlw $8, %zmm1, %zmm1
376 ; AVX512BW-NEXT: vpaddw %zmm0, %zmm1, %zmm0
377 ; AVX512BW-NEXT: retq
379 ; AVX512DQ-LABEL: testv32i16:
381 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm2 = [4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0]
382 ; AVX512DQ-NEXT: vpshufb %ymm0, %ymm2, %ymm3
383 ; AVX512DQ-NEXT: vpsrlw $4, %ymm0, %ymm4
384 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm5 = [15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]
385 ; AVX512DQ-NEXT: vpand %ymm5, %ymm4, %ymm4
386 ; AVX512DQ-NEXT: vpxor %xmm6, %xmm6, %xmm6
387 ; AVX512DQ-NEXT: vpcmpeqb %ymm6, %ymm4, %ymm7
388 ; AVX512DQ-NEXT: vpand %ymm7, %ymm3, %ymm3
389 ; AVX512DQ-NEXT: vpshufb %ymm4, %ymm2, %ymm4
390 ; AVX512DQ-NEXT: vpaddb %ymm4, %ymm3, %ymm3
391 ; AVX512DQ-NEXT: vpcmpeqb %ymm6, %ymm0, %ymm0
392 ; AVX512DQ-NEXT: vpsrlw $8, %ymm0, %ymm0
393 ; AVX512DQ-NEXT: vpand %ymm0, %ymm3, %ymm0
394 ; AVX512DQ-NEXT: vpsrlw $8, %ymm3, %ymm3
395 ; AVX512DQ-NEXT: vpaddw %ymm0, %ymm3, %ymm0
396 ; AVX512DQ-NEXT: vpshufb %ymm1, %ymm2, %ymm3
397 ; AVX512DQ-NEXT: vpsrlw $4, %ymm1, %ymm4
398 ; AVX512DQ-NEXT: vpand %ymm5, %ymm4, %ymm4
399 ; AVX512DQ-NEXT: vpcmpeqb %ymm6, %ymm4, %ymm5
400 ; AVX512DQ-NEXT: vpand %ymm5, %ymm3, %ymm3
401 ; AVX512DQ-NEXT: vpshufb %ymm4, %ymm2, %ymm2
402 ; AVX512DQ-NEXT: vpaddb %ymm2, %ymm3, %ymm2
403 ; AVX512DQ-NEXT: vpcmpeqb %ymm6, %ymm1, %ymm1
404 ; AVX512DQ-NEXT: vpsrlw $8, %ymm1, %ymm1
405 ; AVX512DQ-NEXT: vpand %ymm1, %ymm2, %ymm1
406 ; AVX512DQ-NEXT: vpsrlw $8, %ymm2, %ymm2
407 ; AVX512DQ-NEXT: vpaddw %ymm1, %ymm2, %ymm1
408 ; AVX512DQ-NEXT: retq
409 %out = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %in, i1 0)
413 define <32 x i16> @testv32i16u(<32 x i16> %in) nounwind {
414 ; AVX512CD-LABEL: testv32i16u:
416 ; AVX512CD-NEXT: vpmovzxwd {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
417 ; AVX512CD-NEXT: vplzcntd %zmm0, %zmm0
418 ; AVX512CD-NEXT: vpmovdw %zmm0, %ymm0
419 ; AVX512CD-NEXT: vmovdqa {{.*#+}} ymm2 = [16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16]
420 ; AVX512CD-NEXT: vpsubw %ymm2, %ymm0, %ymm0
421 ; AVX512CD-NEXT: vpmovzxwd {{.*#+}} zmm1 = ymm1[0],zero,ymm1[1],zero,ymm1[2],zero,ymm1[3],zero,ymm1[4],zero,ymm1[5],zero,ymm1[6],zero,ymm1[7],zero,ymm1[8],zero,ymm1[9],zero,ymm1[10],zero,ymm1[11],zero,ymm1[12],zero,ymm1[13],zero,ymm1[14],zero,ymm1[15],zero
422 ; AVX512CD-NEXT: vplzcntd %zmm1, %zmm1
423 ; AVX512CD-NEXT: vpmovdw %zmm1, %ymm1
424 ; AVX512CD-NEXT: vpsubw %ymm2, %ymm1, %ymm1
425 ; AVX512CD-NEXT: retq
427 ; AVX512CDBW-LABEL: testv32i16u:
428 ; AVX512CDBW: # %bb.0:
429 ; AVX512CDBW-NEXT: vextracti64x4 $1, %zmm0, %ymm1
430 ; AVX512CDBW-NEXT: vpmovzxwd {{.*#+}} zmm1 = ymm1[0],zero,ymm1[1],zero,ymm1[2],zero,ymm1[3],zero,ymm1[4],zero,ymm1[5],zero,ymm1[6],zero,ymm1[7],zero,ymm1[8],zero,ymm1[9],zero,ymm1[10],zero,ymm1[11],zero,ymm1[12],zero,ymm1[13],zero,ymm1[14],zero,ymm1[15],zero
431 ; AVX512CDBW-NEXT: vplzcntd %zmm1, %zmm1
432 ; AVX512CDBW-NEXT: vpmovdw %zmm1, %ymm1
433 ; AVX512CDBW-NEXT: vmovdqa {{.*#+}} ymm2 = [16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16]
434 ; AVX512CDBW-NEXT: vpsubw %ymm2, %ymm1, %ymm1
435 ; AVX512CDBW-NEXT: vpmovzxwd {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
436 ; AVX512CDBW-NEXT: vplzcntd %zmm0, %zmm0
437 ; AVX512CDBW-NEXT: vpmovdw %zmm0, %ymm0
438 ; AVX512CDBW-NEXT: vpsubw %ymm2, %ymm0, %ymm0
439 ; AVX512CDBW-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
440 ; AVX512CDBW-NEXT: retq
442 ; AVX512BW-LABEL: testv32i16u:
444 ; AVX512BW-NEXT: vpsrlw $4, %zmm0, %zmm1
445 ; AVX512BW-NEXT: vpandq {{.*}}(%rip), %zmm1, %zmm1
446 ; AVX512BW-NEXT: vmovdqa64 {{.*#+}} zmm2 = [4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0]
447 ; AVX512BW-NEXT: vpshufb %zmm1, %zmm2, %zmm3
448 ; AVX512BW-NEXT: vpshufb %zmm0, %zmm2, %zmm2
449 ; AVX512BW-NEXT: vptestnmb %zmm1, %zmm1, %k0
450 ; AVX512BW-NEXT: vpmovm2b %k0, %zmm1
451 ; AVX512BW-NEXT: vpandq %zmm1, %zmm2, %zmm1
452 ; AVX512BW-NEXT: vpaddb %zmm3, %zmm1, %zmm1
453 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
454 ; AVX512BW-NEXT: vpmovm2b %k0, %zmm0
455 ; AVX512BW-NEXT: vpsrlw $8, %zmm0, %zmm0
456 ; AVX512BW-NEXT: vpandq %zmm0, %zmm1, %zmm0
457 ; AVX512BW-NEXT: vpsrlw $8, %zmm1, %zmm1
458 ; AVX512BW-NEXT: vpaddw %zmm0, %zmm1, %zmm0
459 ; AVX512BW-NEXT: retq
461 ; AVX512DQ-LABEL: testv32i16u:
463 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm2 = [4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0]
464 ; AVX512DQ-NEXT: vpshufb %ymm0, %ymm2, %ymm3
465 ; AVX512DQ-NEXT: vpsrlw $4, %ymm0, %ymm4
466 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm5 = [15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]
467 ; AVX512DQ-NEXT: vpand %ymm5, %ymm4, %ymm4
468 ; AVX512DQ-NEXT: vpxor %xmm6, %xmm6, %xmm6
469 ; AVX512DQ-NEXT: vpcmpeqb %ymm6, %ymm4, %ymm7
470 ; AVX512DQ-NEXT: vpand %ymm7, %ymm3, %ymm3
471 ; AVX512DQ-NEXT: vpshufb %ymm4, %ymm2, %ymm4
472 ; AVX512DQ-NEXT: vpaddb %ymm4, %ymm3, %ymm3
473 ; AVX512DQ-NEXT: vpcmpeqb %ymm6, %ymm0, %ymm0
474 ; AVX512DQ-NEXT: vpsrlw $8, %ymm0, %ymm0
475 ; AVX512DQ-NEXT: vpand %ymm0, %ymm3, %ymm0
476 ; AVX512DQ-NEXT: vpsrlw $8, %ymm3, %ymm3
477 ; AVX512DQ-NEXT: vpaddw %ymm0, %ymm3, %ymm0
478 ; AVX512DQ-NEXT: vpshufb %ymm1, %ymm2, %ymm3
479 ; AVX512DQ-NEXT: vpsrlw $4, %ymm1, %ymm4
480 ; AVX512DQ-NEXT: vpand %ymm5, %ymm4, %ymm4
481 ; AVX512DQ-NEXT: vpcmpeqb %ymm6, %ymm4, %ymm5
482 ; AVX512DQ-NEXT: vpand %ymm5, %ymm3, %ymm3
483 ; AVX512DQ-NEXT: vpshufb %ymm4, %ymm2, %ymm2
484 ; AVX512DQ-NEXT: vpaddb %ymm2, %ymm3, %ymm2
485 ; AVX512DQ-NEXT: vpcmpeqb %ymm6, %ymm1, %ymm1
486 ; AVX512DQ-NEXT: vpsrlw $8, %ymm1, %ymm1
487 ; AVX512DQ-NEXT: vpand %ymm1, %ymm2, %ymm1
488 ; AVX512DQ-NEXT: vpsrlw $8, %ymm2, %ymm2
489 ; AVX512DQ-NEXT: vpaddw %ymm1, %ymm2, %ymm1
490 ; AVX512DQ-NEXT: retq
491 %out = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %in, i1 -1)
495 define <64 x i8> @testv64i8(<64 x i8> %in) nounwind {
496 ; AVX512CD-LABEL: testv64i8:
498 ; AVX512CD-NEXT: vextracti128 $1, %ymm0, %xmm2
499 ; AVX512CD-NEXT: vpmovzxbd {{.*#+}} zmm2 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero,xmm2[2],zero,zero,zero,xmm2[3],zero,zero,zero,xmm2[4],zero,zero,zero,xmm2[5],zero,zero,zero,xmm2[6],zero,zero,zero,xmm2[7],zero,zero,zero,xmm2[8],zero,zero,zero,xmm2[9],zero,zero,zero,xmm2[10],zero,zero,zero,xmm2[11],zero,zero,zero,xmm2[12],zero,zero,zero,xmm2[13],zero,zero,zero,xmm2[14],zero,zero,zero,xmm2[15],zero,zero,zero
500 ; AVX512CD-NEXT: vplzcntd %zmm2, %zmm2
501 ; AVX512CD-NEXT: vpmovdb %zmm2, %xmm2
502 ; AVX512CD-NEXT: vmovdqa {{.*#+}} xmm3 = [24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24]
503 ; AVX512CD-NEXT: vpsubb %xmm3, %xmm2, %xmm2
504 ; AVX512CD-NEXT: vpmovzxbd {{.*#+}} zmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero
505 ; AVX512CD-NEXT: vplzcntd %zmm0, %zmm0
506 ; AVX512CD-NEXT: vpmovdb %zmm0, %xmm0
507 ; AVX512CD-NEXT: vpsubb %xmm3, %xmm0, %xmm0
508 ; AVX512CD-NEXT: vinserti128 $1, %xmm2, %ymm0, %ymm0
509 ; AVX512CD-NEXT: vextracti128 $1, %ymm1, %xmm2
510 ; AVX512CD-NEXT: vpmovzxbd {{.*#+}} zmm2 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero,xmm2[2],zero,zero,zero,xmm2[3],zero,zero,zero,xmm2[4],zero,zero,zero,xmm2[5],zero,zero,zero,xmm2[6],zero,zero,zero,xmm2[7],zero,zero,zero,xmm2[8],zero,zero,zero,xmm2[9],zero,zero,zero,xmm2[10],zero,zero,zero,xmm2[11],zero,zero,zero,xmm2[12],zero,zero,zero,xmm2[13],zero,zero,zero,xmm2[14],zero,zero,zero,xmm2[15],zero,zero,zero
511 ; AVX512CD-NEXT: vplzcntd %zmm2, %zmm2
512 ; AVX512CD-NEXT: vpmovdb %zmm2, %xmm2
513 ; AVX512CD-NEXT: vpsubb %xmm3, %xmm2, %xmm2
514 ; AVX512CD-NEXT: vpmovzxbd {{.*#+}} zmm1 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero,xmm1[2],zero,zero,zero,xmm1[3],zero,zero,zero,xmm1[4],zero,zero,zero,xmm1[5],zero,zero,zero,xmm1[6],zero,zero,zero,xmm1[7],zero,zero,zero,xmm1[8],zero,zero,zero,xmm1[9],zero,zero,zero,xmm1[10],zero,zero,zero,xmm1[11],zero,zero,zero,xmm1[12],zero,zero,zero,xmm1[13],zero,zero,zero,xmm1[14],zero,zero,zero,xmm1[15],zero,zero,zero
515 ; AVX512CD-NEXT: vplzcntd %zmm1, %zmm1
516 ; AVX512CD-NEXT: vpmovdb %zmm1, %xmm1
517 ; AVX512CD-NEXT: vpsubb %xmm3, %xmm1, %xmm1
518 ; AVX512CD-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1
519 ; AVX512CD-NEXT: retq
521 ; AVX512CDBW-LABEL: testv64i8:
522 ; AVX512CDBW: # %bb.0:
523 ; AVX512CDBW-NEXT: vextracti64x4 $1, %zmm0, %ymm1
524 ; AVX512CDBW-NEXT: vextracti128 $1, %ymm1, %xmm2
525 ; AVX512CDBW-NEXT: vpmovzxbd {{.*#+}} zmm2 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero,xmm2[2],zero,zero,zero,xmm2[3],zero,zero,zero,xmm2[4],zero,zero,zero,xmm2[5],zero,zero,zero,xmm2[6],zero,zero,zero,xmm2[7],zero,zero,zero,xmm2[8],zero,zero,zero,xmm2[9],zero,zero,zero,xmm2[10],zero,zero,zero,xmm2[11],zero,zero,zero,xmm2[12],zero,zero,zero,xmm2[13],zero,zero,zero,xmm2[14],zero,zero,zero,xmm2[15],zero,zero,zero
526 ; AVX512CDBW-NEXT: vplzcntd %zmm2, %zmm2
527 ; AVX512CDBW-NEXT: vpmovdb %zmm2, %xmm2
528 ; AVX512CDBW-NEXT: vmovdqa {{.*#+}} xmm3 = [24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24]
529 ; AVX512CDBW-NEXT: vpsubb %xmm3, %xmm2, %xmm2
530 ; AVX512CDBW-NEXT: vpmovzxbd {{.*#+}} zmm1 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero,xmm1[2],zero,zero,zero,xmm1[3],zero,zero,zero,xmm1[4],zero,zero,zero,xmm1[5],zero,zero,zero,xmm1[6],zero,zero,zero,xmm1[7],zero,zero,zero,xmm1[8],zero,zero,zero,xmm1[9],zero,zero,zero,xmm1[10],zero,zero,zero,xmm1[11],zero,zero,zero,xmm1[12],zero,zero,zero,xmm1[13],zero,zero,zero,xmm1[14],zero,zero,zero,xmm1[15],zero,zero,zero
531 ; AVX512CDBW-NEXT: vplzcntd %zmm1, %zmm1
532 ; AVX512CDBW-NEXT: vpmovdb %zmm1, %xmm1
533 ; AVX512CDBW-NEXT: vpsubb %xmm3, %xmm1, %xmm1
534 ; AVX512CDBW-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1
535 ; AVX512CDBW-NEXT: vextracti128 $1, %ymm0, %xmm2
536 ; AVX512CDBW-NEXT: vpmovzxbd {{.*#+}} zmm2 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero,xmm2[2],zero,zero,zero,xmm2[3],zero,zero,zero,xmm2[4],zero,zero,zero,xmm2[5],zero,zero,zero,xmm2[6],zero,zero,zero,xmm2[7],zero,zero,zero,xmm2[8],zero,zero,zero,xmm2[9],zero,zero,zero,xmm2[10],zero,zero,zero,xmm2[11],zero,zero,zero,xmm2[12],zero,zero,zero,xmm2[13],zero,zero,zero,xmm2[14],zero,zero,zero,xmm2[15],zero,zero,zero
537 ; AVX512CDBW-NEXT: vplzcntd %zmm2, %zmm2
538 ; AVX512CDBW-NEXT: vpmovdb %zmm2, %xmm2
539 ; AVX512CDBW-NEXT: vpsubb %xmm3, %xmm2, %xmm2
540 ; AVX512CDBW-NEXT: vpmovzxbd {{.*#+}} zmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero
541 ; AVX512CDBW-NEXT: vplzcntd %zmm0, %zmm0
542 ; AVX512CDBW-NEXT: vpmovdb %zmm0, %xmm0
543 ; AVX512CDBW-NEXT: vpsubb %xmm3, %xmm0, %xmm0
544 ; AVX512CDBW-NEXT: vinserti128 $1, %xmm2, %ymm0, %ymm0
545 ; AVX512CDBW-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
546 ; AVX512CDBW-NEXT: retq
548 ; AVX512BW-LABEL: testv64i8:
550 ; AVX512BW-NEXT: vpsrlw $4, %zmm0, %zmm1
551 ; AVX512BW-NEXT: vpandq {{.*}}(%rip), %zmm1, %zmm1
552 ; AVX512BW-NEXT: vmovdqa64 {{.*#+}} zmm2 = [4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0]
553 ; AVX512BW-NEXT: vpshufb %zmm1, %zmm2, %zmm3
554 ; AVX512BW-NEXT: vpshufb %zmm0, %zmm2, %zmm0
555 ; AVX512BW-NEXT: vptestnmb %zmm1, %zmm1, %k0
556 ; AVX512BW-NEXT: vpmovm2b %k0, %zmm1
557 ; AVX512BW-NEXT: vpandq %zmm1, %zmm0, %zmm0
558 ; AVX512BW-NEXT: vpaddb %zmm3, %zmm0, %zmm0
559 ; AVX512BW-NEXT: retq
561 ; AVX512DQ-LABEL: testv64i8:
563 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm2 = [4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0]
564 ; AVX512DQ-NEXT: vpshufb %ymm0, %ymm2, %ymm3
565 ; AVX512DQ-NEXT: vpsrlw $4, %ymm0, %ymm0
566 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm4 = [15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]
567 ; AVX512DQ-NEXT: vpand %ymm4, %ymm0, %ymm0
568 ; AVX512DQ-NEXT: vpxor %xmm5, %xmm5, %xmm5
569 ; AVX512DQ-NEXT: vpcmpeqb %ymm5, %ymm0, %ymm6
570 ; AVX512DQ-NEXT: vpand %ymm6, %ymm3, %ymm3
571 ; AVX512DQ-NEXT: vpshufb %ymm0, %ymm2, %ymm0
572 ; AVX512DQ-NEXT: vpaddb %ymm0, %ymm3, %ymm0
573 ; AVX512DQ-NEXT: vpshufb %ymm1, %ymm2, %ymm3
574 ; AVX512DQ-NEXT: vpsrlw $4, %ymm1, %ymm1
575 ; AVX512DQ-NEXT: vpand %ymm4, %ymm1, %ymm1
576 ; AVX512DQ-NEXT: vpcmpeqb %ymm5, %ymm1, %ymm4
577 ; AVX512DQ-NEXT: vpand %ymm4, %ymm3, %ymm3
578 ; AVX512DQ-NEXT: vpshufb %ymm1, %ymm2, %ymm1
579 ; AVX512DQ-NEXT: vpaddb %ymm1, %ymm3, %ymm1
580 ; AVX512DQ-NEXT: retq
581 %out = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %in, i1 0)
585 define <64 x i8> @testv64i8u(<64 x i8> %in) nounwind {
586 ; AVX512CD-LABEL: testv64i8u:
588 ; AVX512CD-NEXT: vextracti128 $1, %ymm0, %xmm2
589 ; AVX512CD-NEXT: vpmovzxbd {{.*#+}} zmm2 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero,xmm2[2],zero,zero,zero,xmm2[3],zero,zero,zero,xmm2[4],zero,zero,zero,xmm2[5],zero,zero,zero,xmm2[6],zero,zero,zero,xmm2[7],zero,zero,zero,xmm2[8],zero,zero,zero,xmm2[9],zero,zero,zero,xmm2[10],zero,zero,zero,xmm2[11],zero,zero,zero,xmm2[12],zero,zero,zero,xmm2[13],zero,zero,zero,xmm2[14],zero,zero,zero,xmm2[15],zero,zero,zero
590 ; AVX512CD-NEXT: vplzcntd %zmm2, %zmm2
591 ; AVX512CD-NEXT: vpmovdb %zmm2, %xmm2
592 ; AVX512CD-NEXT: vmovdqa {{.*#+}} xmm3 = [24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24]
593 ; AVX512CD-NEXT: vpsubb %xmm3, %xmm2, %xmm2
594 ; AVX512CD-NEXT: vpmovzxbd {{.*#+}} zmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero
595 ; AVX512CD-NEXT: vplzcntd %zmm0, %zmm0
596 ; AVX512CD-NEXT: vpmovdb %zmm0, %xmm0
597 ; AVX512CD-NEXT: vpsubb %xmm3, %xmm0, %xmm0
598 ; AVX512CD-NEXT: vinserti128 $1, %xmm2, %ymm0, %ymm0
599 ; AVX512CD-NEXT: vextracti128 $1, %ymm1, %xmm2
600 ; AVX512CD-NEXT: vpmovzxbd {{.*#+}} zmm2 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero,xmm2[2],zero,zero,zero,xmm2[3],zero,zero,zero,xmm2[4],zero,zero,zero,xmm2[5],zero,zero,zero,xmm2[6],zero,zero,zero,xmm2[7],zero,zero,zero,xmm2[8],zero,zero,zero,xmm2[9],zero,zero,zero,xmm2[10],zero,zero,zero,xmm2[11],zero,zero,zero,xmm2[12],zero,zero,zero,xmm2[13],zero,zero,zero,xmm2[14],zero,zero,zero,xmm2[15],zero,zero,zero
601 ; AVX512CD-NEXT: vplzcntd %zmm2, %zmm2
602 ; AVX512CD-NEXT: vpmovdb %zmm2, %xmm2
603 ; AVX512CD-NEXT: vpsubb %xmm3, %xmm2, %xmm2
604 ; AVX512CD-NEXT: vpmovzxbd {{.*#+}} zmm1 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero,xmm1[2],zero,zero,zero,xmm1[3],zero,zero,zero,xmm1[4],zero,zero,zero,xmm1[5],zero,zero,zero,xmm1[6],zero,zero,zero,xmm1[7],zero,zero,zero,xmm1[8],zero,zero,zero,xmm1[9],zero,zero,zero,xmm1[10],zero,zero,zero,xmm1[11],zero,zero,zero,xmm1[12],zero,zero,zero,xmm1[13],zero,zero,zero,xmm1[14],zero,zero,zero,xmm1[15],zero,zero,zero
605 ; AVX512CD-NEXT: vplzcntd %zmm1, %zmm1
606 ; AVX512CD-NEXT: vpmovdb %zmm1, %xmm1
607 ; AVX512CD-NEXT: vpsubb %xmm3, %xmm1, %xmm1
608 ; AVX512CD-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1
609 ; AVX512CD-NEXT: retq
611 ; AVX512CDBW-LABEL: testv64i8u:
612 ; AVX512CDBW: # %bb.0:
613 ; AVX512CDBW-NEXT: vextracti64x4 $1, %zmm0, %ymm1
614 ; AVX512CDBW-NEXT: vextracti128 $1, %ymm1, %xmm2
615 ; AVX512CDBW-NEXT: vpmovzxbd {{.*#+}} zmm2 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero,xmm2[2],zero,zero,zero,xmm2[3],zero,zero,zero,xmm2[4],zero,zero,zero,xmm2[5],zero,zero,zero,xmm2[6],zero,zero,zero,xmm2[7],zero,zero,zero,xmm2[8],zero,zero,zero,xmm2[9],zero,zero,zero,xmm2[10],zero,zero,zero,xmm2[11],zero,zero,zero,xmm2[12],zero,zero,zero,xmm2[13],zero,zero,zero,xmm2[14],zero,zero,zero,xmm2[15],zero,zero,zero
616 ; AVX512CDBW-NEXT: vplzcntd %zmm2, %zmm2
617 ; AVX512CDBW-NEXT: vpmovdb %zmm2, %xmm2
618 ; AVX512CDBW-NEXT: vmovdqa {{.*#+}} xmm3 = [24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24]
619 ; AVX512CDBW-NEXT: vpsubb %xmm3, %xmm2, %xmm2
620 ; AVX512CDBW-NEXT: vpmovzxbd {{.*#+}} zmm1 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero,xmm1[2],zero,zero,zero,xmm1[3],zero,zero,zero,xmm1[4],zero,zero,zero,xmm1[5],zero,zero,zero,xmm1[6],zero,zero,zero,xmm1[7],zero,zero,zero,xmm1[8],zero,zero,zero,xmm1[9],zero,zero,zero,xmm1[10],zero,zero,zero,xmm1[11],zero,zero,zero,xmm1[12],zero,zero,zero,xmm1[13],zero,zero,zero,xmm1[14],zero,zero,zero,xmm1[15],zero,zero,zero
621 ; AVX512CDBW-NEXT: vplzcntd %zmm1, %zmm1
622 ; AVX512CDBW-NEXT: vpmovdb %zmm1, %xmm1
623 ; AVX512CDBW-NEXT: vpsubb %xmm3, %xmm1, %xmm1
624 ; AVX512CDBW-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1
625 ; AVX512CDBW-NEXT: vextracti128 $1, %ymm0, %xmm2
626 ; AVX512CDBW-NEXT: vpmovzxbd {{.*#+}} zmm2 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero,xmm2[2],zero,zero,zero,xmm2[3],zero,zero,zero,xmm2[4],zero,zero,zero,xmm2[5],zero,zero,zero,xmm2[6],zero,zero,zero,xmm2[7],zero,zero,zero,xmm2[8],zero,zero,zero,xmm2[9],zero,zero,zero,xmm2[10],zero,zero,zero,xmm2[11],zero,zero,zero,xmm2[12],zero,zero,zero,xmm2[13],zero,zero,zero,xmm2[14],zero,zero,zero,xmm2[15],zero,zero,zero
627 ; AVX512CDBW-NEXT: vplzcntd %zmm2, %zmm2
628 ; AVX512CDBW-NEXT: vpmovdb %zmm2, %xmm2
629 ; AVX512CDBW-NEXT: vpsubb %xmm3, %xmm2, %xmm2
630 ; AVX512CDBW-NEXT: vpmovzxbd {{.*#+}} zmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero
631 ; AVX512CDBW-NEXT: vplzcntd %zmm0, %zmm0
632 ; AVX512CDBW-NEXT: vpmovdb %zmm0, %xmm0
633 ; AVX512CDBW-NEXT: vpsubb %xmm3, %xmm0, %xmm0
634 ; AVX512CDBW-NEXT: vinserti128 $1, %xmm2, %ymm0, %ymm0
635 ; AVX512CDBW-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
636 ; AVX512CDBW-NEXT: retq
638 ; AVX512BW-LABEL: testv64i8u:
640 ; AVX512BW-NEXT: vpsrlw $4, %zmm0, %zmm1
641 ; AVX512BW-NEXT: vpandq {{.*}}(%rip), %zmm1, %zmm1
642 ; AVX512BW-NEXT: vmovdqa64 {{.*#+}} zmm2 = [4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0]
643 ; AVX512BW-NEXT: vpshufb %zmm1, %zmm2, %zmm3
644 ; AVX512BW-NEXT: vpshufb %zmm0, %zmm2, %zmm0
645 ; AVX512BW-NEXT: vptestnmb %zmm1, %zmm1, %k0
646 ; AVX512BW-NEXT: vpmovm2b %k0, %zmm1
647 ; AVX512BW-NEXT: vpandq %zmm1, %zmm0, %zmm0
648 ; AVX512BW-NEXT: vpaddb %zmm3, %zmm0, %zmm0
649 ; AVX512BW-NEXT: retq
651 ; AVX512DQ-LABEL: testv64i8u:
653 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm2 = [4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0,4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0]
654 ; AVX512DQ-NEXT: vpshufb %ymm0, %ymm2, %ymm3
655 ; AVX512DQ-NEXT: vpsrlw $4, %ymm0, %ymm0
656 ; AVX512DQ-NEXT: vmovdqa {{.*#+}} ymm4 = [15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]
657 ; AVX512DQ-NEXT: vpand %ymm4, %ymm0, %ymm0
658 ; AVX512DQ-NEXT: vpxor %xmm5, %xmm5, %xmm5
659 ; AVX512DQ-NEXT: vpcmpeqb %ymm5, %ymm0, %ymm6
660 ; AVX512DQ-NEXT: vpand %ymm6, %ymm3, %ymm3
661 ; AVX512DQ-NEXT: vpshufb %ymm0, %ymm2, %ymm0
662 ; AVX512DQ-NEXT: vpaddb %ymm0, %ymm3, %ymm0
663 ; AVX512DQ-NEXT: vpshufb %ymm1, %ymm2, %ymm3
664 ; AVX512DQ-NEXT: vpsrlw $4, %ymm1, %ymm1
665 ; AVX512DQ-NEXT: vpand %ymm4, %ymm1, %ymm1
666 ; AVX512DQ-NEXT: vpcmpeqb %ymm5, %ymm1, %ymm4
667 ; AVX512DQ-NEXT: vpand %ymm4, %ymm3, %ymm3
668 ; AVX512DQ-NEXT: vpshufb %ymm1, %ymm2, %ymm1
669 ; AVX512DQ-NEXT: vpaddb %ymm1, %ymm3, %ymm1
670 ; AVX512DQ-NEXT: retq
671 %out = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %in, i1 -1)
675 declare <8 x i64> @llvm.ctlz.v8i64(<8 x i64>, i1)
676 declare <16 x i32> @llvm.ctlz.v16i32(<16 x i32>, i1)
677 declare <32 x i16> @llvm.ctlz.v32i16(<32 x i16>, i1)
678 declare <64 x i8> @llvm.ctlz.v64i8(<64 x i8>, i1)