1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefix=AVX512 --check-prefix=AVX512F
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw | FileCheck %s --check-prefix=AVX512 --check-prefix=AVX512BW
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512vpopcntdq | FileCheck %s --check-prefix=AVX512 --check-prefix=AVX512VPOPCNTDQ --check-prefix=AVX512VPOPCNTDQ-NOBW
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512vpopcntdq,+avx512bw | FileCheck %s --check-prefix=AVX512 --check-prefix=AVX512VPOPCNTDQ --check-prefix=AVX512VPOPCNTDQ-BW
6 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bitalg | FileCheck %s --check-prefix=AVX512 --check-prefix=BITALG
8 define <8 x i64> @testv8i64(<8 x i64> %in) nounwind {
9 ; AVX512F-LABEL: testv8i64:
11 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
12 ; AVX512F-NEXT: vmovdqa {{.*#+}} ymm2 = [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]
13 ; AVX512F-NEXT: vpand %ymm2, %ymm1, %ymm3
14 ; AVX512F-NEXT: vmovdqa {{.*#+}} ymm4 = [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]
15 ; AVX512F-NEXT: vpshufb %ymm3, %ymm4, %ymm3
16 ; AVX512F-NEXT: vpsrlw $4, %ymm1, %ymm1
17 ; AVX512F-NEXT: vpand %ymm2, %ymm1, %ymm1
18 ; AVX512F-NEXT: vpshufb %ymm1, %ymm4, %ymm1
19 ; AVX512F-NEXT: vpaddb %ymm3, %ymm1, %ymm1
20 ; AVX512F-NEXT: vpxor %xmm3, %xmm3, %xmm3
21 ; AVX512F-NEXT: vpsadbw %ymm3, %ymm1, %ymm1
22 ; AVX512F-NEXT: vpand %ymm2, %ymm0, %ymm5
23 ; AVX512F-NEXT: vpshufb %ymm5, %ymm4, %ymm5
24 ; AVX512F-NEXT: vpsrlw $4, %ymm0, %ymm0
25 ; AVX512F-NEXT: vpand %ymm2, %ymm0, %ymm0
26 ; AVX512F-NEXT: vpshufb %ymm0, %ymm4, %ymm0
27 ; AVX512F-NEXT: vpaddb %ymm5, %ymm0, %ymm0
28 ; AVX512F-NEXT: vpsadbw %ymm3, %ymm0, %ymm0
29 ; AVX512F-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
32 ; AVX512BW-LABEL: testv8i64:
34 ; 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]
35 ; AVX512BW-NEXT: vpandq %zmm1, %zmm0, %zmm2
36 ; 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]
37 ; AVX512BW-NEXT: vpshufb %zmm2, %zmm3, %zmm2
38 ; AVX512BW-NEXT: vpsrlw $4, %zmm0, %zmm0
39 ; AVX512BW-NEXT: vpandq %zmm1, %zmm0, %zmm0
40 ; AVX512BW-NEXT: vpshufb %zmm0, %zmm3, %zmm0
41 ; AVX512BW-NEXT: vpaddb %zmm2, %zmm0, %zmm0
42 ; AVX512BW-NEXT: vpxor %xmm1, %xmm1, %xmm1
43 ; AVX512BW-NEXT: vpsadbw %zmm1, %zmm0, %zmm0
46 ; AVX512VPOPCNTDQ-LABEL: testv8i64:
47 ; AVX512VPOPCNTDQ: # %bb.0:
48 ; AVX512VPOPCNTDQ-NEXT: vpopcntq %zmm0, %zmm0
49 ; AVX512VPOPCNTDQ-NEXT: retq
51 ; BITALG-LABEL: testv8i64:
53 ; BITALG-NEXT: vpopcntb %zmm0, %zmm0
54 ; BITALG-NEXT: vpxor %xmm1, %xmm1, %xmm1
55 ; BITALG-NEXT: vpsadbw %zmm1, %zmm0, %zmm0
57 %out = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %in)
61 define <16 x i32> @testv16i32(<16 x i32> %in) nounwind {
62 ; AVX512F-LABEL: testv16i32:
64 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
65 ; AVX512F-NEXT: vmovdqa {{.*#+}} ymm2 = [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]
66 ; AVX512F-NEXT: vpand %ymm2, %ymm1, %ymm3
67 ; AVX512F-NEXT: vmovdqa {{.*#+}} ymm4 = [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]
68 ; AVX512F-NEXT: vpshufb %ymm3, %ymm4, %ymm3
69 ; AVX512F-NEXT: vpsrlw $4, %ymm1, %ymm1
70 ; AVX512F-NEXT: vpand %ymm2, %ymm1, %ymm1
71 ; AVX512F-NEXT: vpshufb %ymm1, %ymm4, %ymm1
72 ; AVX512F-NEXT: vpaddb %ymm3, %ymm1, %ymm1
73 ; AVX512F-NEXT: vpxor %xmm3, %xmm3, %xmm3
74 ; AVX512F-NEXT: vpunpckhdq {{.*#+}} ymm5 = ymm1[2],ymm3[2],ymm1[3],ymm3[3],ymm1[6],ymm3[6],ymm1[7],ymm3[7]
75 ; AVX512F-NEXT: vpsadbw %ymm3, %ymm5, %ymm5
76 ; AVX512F-NEXT: vpunpckldq {{.*#+}} ymm1 = ymm1[0],ymm3[0],ymm1[1],ymm3[1],ymm1[4],ymm3[4],ymm1[5],ymm3[5]
77 ; AVX512F-NEXT: vpsadbw %ymm3, %ymm1, %ymm1
78 ; AVX512F-NEXT: vpackuswb %ymm5, %ymm1, %ymm1
79 ; AVX512F-NEXT: vpand %ymm2, %ymm0, %ymm5
80 ; AVX512F-NEXT: vpshufb %ymm5, %ymm4, %ymm5
81 ; AVX512F-NEXT: vpsrlw $4, %ymm0, %ymm0
82 ; AVX512F-NEXT: vpand %ymm2, %ymm0, %ymm0
83 ; AVX512F-NEXT: vpshufb %ymm0, %ymm4, %ymm0
84 ; AVX512F-NEXT: vpaddb %ymm5, %ymm0, %ymm0
85 ; AVX512F-NEXT: vpunpckhdq {{.*#+}} ymm2 = ymm0[2],ymm3[2],ymm0[3],ymm3[3],ymm0[6],ymm3[6],ymm0[7],ymm3[7]
86 ; AVX512F-NEXT: vpsadbw %ymm3, %ymm2, %ymm2
87 ; AVX512F-NEXT: vpunpckldq {{.*#+}} ymm0 = ymm0[0],ymm3[0],ymm0[1],ymm3[1],ymm0[4],ymm3[4],ymm0[5],ymm3[5]
88 ; AVX512F-NEXT: vpsadbw %ymm3, %ymm0, %ymm0
89 ; AVX512F-NEXT: vpackuswb %ymm2, %ymm0, %ymm0
90 ; AVX512F-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
93 ; AVX512BW-LABEL: testv16i32:
95 ; 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]
96 ; AVX512BW-NEXT: vpandq %zmm1, %zmm0, %zmm2
97 ; 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]
98 ; AVX512BW-NEXT: vpshufb %zmm2, %zmm3, %zmm2
99 ; AVX512BW-NEXT: vpsrlw $4, %zmm0, %zmm0
100 ; AVX512BW-NEXT: vpandq %zmm1, %zmm0, %zmm0
101 ; AVX512BW-NEXT: vpshufb %zmm0, %zmm3, %zmm0
102 ; AVX512BW-NEXT: vpaddb %zmm2, %zmm0, %zmm0
103 ; AVX512BW-NEXT: vpxor %xmm1, %xmm1, %xmm1
104 ; 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]
105 ; AVX512BW-NEXT: vpsadbw %zmm1, %zmm2, %zmm2
106 ; 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]
107 ; AVX512BW-NEXT: vpsadbw %zmm1, %zmm0, %zmm0
108 ; AVX512BW-NEXT: vpackuswb %zmm2, %zmm0, %zmm0
109 ; AVX512BW-NEXT: retq
111 ; AVX512VPOPCNTDQ-LABEL: testv16i32:
112 ; AVX512VPOPCNTDQ: # %bb.0:
113 ; AVX512VPOPCNTDQ-NEXT: vpopcntd %zmm0, %zmm0
114 ; AVX512VPOPCNTDQ-NEXT: retq
116 ; BITALG-LABEL: testv16i32:
118 ; BITALG-NEXT: vpopcntb %zmm0, %zmm0
119 ; BITALG-NEXT: vpxor %xmm1, %xmm1, %xmm1
120 ; BITALG-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]
121 ; BITALG-NEXT: vpsadbw %zmm1, %zmm2, %zmm2
122 ; BITALG-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]
123 ; BITALG-NEXT: vpsadbw %zmm1, %zmm0, %zmm0
124 ; BITALG-NEXT: vpackuswb %zmm2, %zmm0, %zmm0
126 %out = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %in)
130 define <32 x i16> @testv32i16(<32 x i16> %in) nounwind {
131 ; AVX512F-LABEL: testv32i16:
133 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
134 ; AVX512F-NEXT: vmovdqa {{.*#+}} ymm2 = [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]
135 ; AVX512F-NEXT: vpand %ymm2, %ymm1, %ymm3
136 ; AVX512F-NEXT: vmovdqa {{.*#+}} ymm4 = [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]
137 ; AVX512F-NEXT: vpshufb %ymm3, %ymm4, %ymm3
138 ; AVX512F-NEXT: vpsrlw $4, %ymm1, %ymm1
139 ; AVX512F-NEXT: vpand %ymm2, %ymm1, %ymm1
140 ; AVX512F-NEXT: vpshufb %ymm1, %ymm4, %ymm1
141 ; AVX512F-NEXT: vpaddb %ymm3, %ymm1, %ymm1
142 ; AVX512F-NEXT: vpsllw $8, %ymm1, %ymm3
143 ; AVX512F-NEXT: vpaddb %ymm1, %ymm3, %ymm1
144 ; AVX512F-NEXT: vpsrlw $8, %ymm1, %ymm1
145 ; AVX512F-NEXT: vpand %ymm2, %ymm0, %ymm3
146 ; AVX512F-NEXT: vpshufb %ymm3, %ymm4, %ymm3
147 ; AVX512F-NEXT: vpsrlw $4, %ymm0, %ymm0
148 ; AVX512F-NEXT: vpand %ymm2, %ymm0, %ymm0
149 ; AVX512F-NEXT: vpshufb %ymm0, %ymm4, %ymm0
150 ; AVX512F-NEXT: vpaddb %ymm3, %ymm0, %ymm0
151 ; AVX512F-NEXT: vpsllw $8, %ymm0, %ymm2
152 ; AVX512F-NEXT: vpaddb %ymm0, %ymm2, %ymm0
153 ; AVX512F-NEXT: vpsrlw $8, %ymm0, %ymm0
154 ; AVX512F-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
157 ; AVX512BW-LABEL: testv32i16:
159 ; 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]
160 ; AVX512BW-NEXT: vpandq %zmm1, %zmm0, %zmm2
161 ; 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]
162 ; AVX512BW-NEXT: vpshufb %zmm2, %zmm3, %zmm2
163 ; AVX512BW-NEXT: vpsrlw $4, %zmm0, %zmm0
164 ; AVX512BW-NEXT: vpandq %zmm1, %zmm0, %zmm0
165 ; AVX512BW-NEXT: vpshufb %zmm0, %zmm3, %zmm0
166 ; AVX512BW-NEXT: vpaddb %zmm2, %zmm0, %zmm0
167 ; AVX512BW-NEXT: vpsllw $8, %zmm0, %zmm1
168 ; AVX512BW-NEXT: vpaddb %zmm0, %zmm1, %zmm0
169 ; AVX512BW-NEXT: vpsrlw $8, %zmm0, %zmm0
170 ; AVX512BW-NEXT: retq
172 ; AVX512VPOPCNTDQ-NOBW-LABEL: testv32i16:
173 ; AVX512VPOPCNTDQ-NOBW: # %bb.0:
174 ; AVX512VPOPCNTDQ-NOBW-NEXT: vextracti64x4 $1, %zmm0, %ymm1
175 ; AVX512VPOPCNTDQ-NOBW-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
176 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpopcntd %zmm1, %zmm1
177 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpmovdw %zmm1, %ymm1
178 ; AVX512VPOPCNTDQ-NOBW-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
179 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpopcntd %zmm0, %zmm0
180 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpmovdw %zmm0, %ymm0
181 ; AVX512VPOPCNTDQ-NOBW-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
182 ; AVX512VPOPCNTDQ-NOBW-NEXT: retq
184 ; AVX512VPOPCNTDQ-BW-LABEL: testv32i16:
185 ; AVX512VPOPCNTDQ-BW: # %bb.0:
186 ; AVX512VPOPCNTDQ-BW-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]
187 ; AVX512VPOPCNTDQ-BW-NEXT: vpandq %zmm1, %zmm0, %zmm2
188 ; AVX512VPOPCNTDQ-BW-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]
189 ; AVX512VPOPCNTDQ-BW-NEXT: vpshufb %zmm2, %zmm3, %zmm2
190 ; AVX512VPOPCNTDQ-BW-NEXT: vpsrlw $4, %zmm0, %zmm0
191 ; AVX512VPOPCNTDQ-BW-NEXT: vpandq %zmm1, %zmm0, %zmm0
192 ; AVX512VPOPCNTDQ-BW-NEXT: vpshufb %zmm0, %zmm3, %zmm0
193 ; AVX512VPOPCNTDQ-BW-NEXT: vpaddb %zmm2, %zmm0, %zmm0
194 ; AVX512VPOPCNTDQ-BW-NEXT: vpsllw $8, %zmm0, %zmm1
195 ; AVX512VPOPCNTDQ-BW-NEXT: vpaddb %zmm0, %zmm1, %zmm0
196 ; AVX512VPOPCNTDQ-BW-NEXT: vpsrlw $8, %zmm0, %zmm0
197 ; AVX512VPOPCNTDQ-BW-NEXT: retq
199 ; BITALG-LABEL: testv32i16:
201 ; BITALG-NEXT: vpopcntw %zmm0, %zmm0
203 %out = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %in)
207 define <64 x i8> @testv64i8(<64 x i8> %in) nounwind {
208 ; AVX512F-LABEL: testv64i8:
210 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
211 ; AVX512F-NEXT: vmovdqa {{.*#+}} ymm2 = [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]
212 ; AVX512F-NEXT: vpand %ymm2, %ymm1, %ymm3
213 ; AVX512F-NEXT: vmovdqa {{.*#+}} ymm4 = [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]
214 ; AVX512F-NEXT: vpshufb %ymm3, %ymm4, %ymm3
215 ; AVX512F-NEXT: vpsrlw $4, %ymm1, %ymm1
216 ; AVX512F-NEXT: vpand %ymm2, %ymm1, %ymm1
217 ; AVX512F-NEXT: vpshufb %ymm1, %ymm4, %ymm1
218 ; AVX512F-NEXT: vpaddb %ymm3, %ymm1, %ymm1
219 ; AVX512F-NEXT: vpand %ymm2, %ymm0, %ymm3
220 ; AVX512F-NEXT: vpshufb %ymm3, %ymm4, %ymm3
221 ; AVX512F-NEXT: vpsrlw $4, %ymm0, %ymm0
222 ; AVX512F-NEXT: vpand %ymm2, %ymm0, %ymm0
223 ; AVX512F-NEXT: vpshufb %ymm0, %ymm4, %ymm0
224 ; AVX512F-NEXT: vpaddb %ymm3, %ymm0, %ymm0
225 ; AVX512F-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
228 ; AVX512BW-LABEL: testv64i8:
230 ; 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]
231 ; AVX512BW-NEXT: vpandq %zmm1, %zmm0, %zmm2
232 ; 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]
233 ; AVX512BW-NEXT: vpshufb %zmm2, %zmm3, %zmm2
234 ; AVX512BW-NEXT: vpsrlw $4, %zmm0, %zmm0
235 ; AVX512BW-NEXT: vpandq %zmm1, %zmm0, %zmm0
236 ; AVX512BW-NEXT: vpshufb %zmm0, %zmm3, %zmm0
237 ; AVX512BW-NEXT: vpaddb %zmm2, %zmm0, %zmm0
238 ; AVX512BW-NEXT: retq
240 ; AVX512VPOPCNTDQ-NOBW-LABEL: testv64i8:
241 ; AVX512VPOPCNTDQ-NOBW: # %bb.0:
242 ; AVX512VPOPCNTDQ-NOBW-NEXT: vextracti64x4 $1, %zmm0, %ymm1
243 ; AVX512VPOPCNTDQ-NOBW-NEXT: vmovdqa {{.*#+}} ymm2 = [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]
244 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpand %ymm2, %ymm1, %ymm3
245 ; AVX512VPOPCNTDQ-NOBW-NEXT: vmovdqa {{.*#+}} ymm4 = [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]
246 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpshufb %ymm3, %ymm4, %ymm3
247 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpsrlw $4, %ymm1, %ymm1
248 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpand %ymm2, %ymm1, %ymm1
249 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpshufb %ymm1, %ymm4, %ymm1
250 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpaddb %ymm3, %ymm1, %ymm1
251 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpand %ymm2, %ymm0, %ymm3
252 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpshufb %ymm3, %ymm4, %ymm3
253 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpsrlw $4, %ymm0, %ymm0
254 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpand %ymm2, %ymm0, %ymm0
255 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpshufb %ymm0, %ymm4, %ymm0
256 ; AVX512VPOPCNTDQ-NOBW-NEXT: vpaddb %ymm3, %ymm0, %ymm0
257 ; AVX512VPOPCNTDQ-NOBW-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
258 ; AVX512VPOPCNTDQ-NOBW-NEXT: retq
260 ; AVX512VPOPCNTDQ-BW-LABEL: testv64i8:
261 ; AVX512VPOPCNTDQ-BW: # %bb.0:
262 ; AVX512VPOPCNTDQ-BW-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]
263 ; AVX512VPOPCNTDQ-BW-NEXT: vpandq %zmm1, %zmm0, %zmm2
264 ; AVX512VPOPCNTDQ-BW-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]
265 ; AVX512VPOPCNTDQ-BW-NEXT: vpshufb %zmm2, %zmm3, %zmm2
266 ; AVX512VPOPCNTDQ-BW-NEXT: vpsrlw $4, %zmm0, %zmm0
267 ; AVX512VPOPCNTDQ-BW-NEXT: vpandq %zmm1, %zmm0, %zmm0
268 ; AVX512VPOPCNTDQ-BW-NEXT: vpshufb %zmm0, %zmm3, %zmm0
269 ; AVX512VPOPCNTDQ-BW-NEXT: vpaddb %zmm2, %zmm0, %zmm0
270 ; AVX512VPOPCNTDQ-BW-NEXT: retq
272 ; BITALG-LABEL: testv64i8:
274 ; BITALG-NEXT: vpopcntb %zmm0, %zmm0
276 %out = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %in)
280 declare <8 x i64> @llvm.ctpop.v8i64(<8 x i64>)
281 declare <16 x i32> @llvm.ctpop.v16i32(<16 x i32>)
282 declare <32 x i16> @llvm.ctpop.v32i16(<32 x i16>)
283 declare <64 x i8> @llvm.ctpop.v64i8(<64 x i8>)