[llvm] r266859 - [AVX512] Update vector-tzcnt-512 test to show how bad v32i16 and v64i8 is with avx512bw enabled.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 22:18:59 PDT 2016


Author: ctopper
Date: Wed Apr 20 00:18:58 2016
New Revision: 266859

URL: http://llvm.org/viewvc/llvm-project?rev=266859&view=rev
Log:
[AVX512] Update vector-tzcnt-512 test to show how bad v32i16 and v64i8 is with avx512bw enabled.

Modified:
    llvm/trunk/test/CodeGen/X86/vector-tzcnt-512.ll

Modified: llvm/trunk/test/CodeGen/X86/vector-tzcnt-512.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vector-tzcnt-512.ll?rev=266859&r1=266858&r2=266859&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/vector-tzcnt-512.ll (original)
+++ llvm/trunk/test/CodeGen/X86/vector-tzcnt-512.ll Wed Apr 20 00:18:58 2016
@@ -1,5 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl -mattr=+avx512cd | FileCheck %s --check-prefix=ALL --check-prefix=AVX512 --check-prefix=AVX512CD
+; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl -mattr=+avx512cd,-avx512bw | FileCheck %s --check-prefix=ALL --check-prefix=AVX512CD
+; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl -mattr=+avx512cd,+avx512bw | FileCheck %s --check-prefix=ALL --check-prefix=AVX512CDBW
 
 define <8 x i64> @testv8i64(<8 x i64> %in) nounwind {
 ; ALL-LABEL: testv8i64:
@@ -134,133 +135,878 @@ define <16 x i32> @testv16i32u(<16 x i32
 }
 
 define <32 x i16> @testv32i16(<32 x i16> %in) nounwind {
-; ALL-LABEL: testv32i16:
-; ALL:       ## BB#0:
-; ALL-NEXT:    vpxor %ymm2, %ymm2, %ymm2
-; ALL-NEXT:    vpsubw %ymm0, %ymm2, %ymm3
-; ALL-NEXT:    vpand %ymm3, %ymm0, %ymm0
-; ALL-NEXT:    vmovdqa {{.*#+}} ymm3 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
-; ALL-NEXT:    vpsubw %ymm3, %ymm0, %ymm0
-; ALL-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]
-; ALL-NEXT:    vpand %ymm4, %ymm0, %ymm5
-; ALL-NEXT:    vmovdqa {{.*#+}} ymm6 = [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]
-; ALL-NEXT:    vpshufb %ymm5, %ymm6, %ymm5
-; ALL-NEXT:    vpsrlw $4, %ymm0, %ymm0
-; ALL-NEXT:    vpand %ymm4, %ymm0, %ymm0
-; ALL-NEXT:    vpshufb %ymm0, %ymm6, %ymm0
-; ALL-NEXT:    vpaddb %ymm5, %ymm0, %ymm0
-; ALL-NEXT:    vpsllw $8, %ymm0, %ymm5
-; ALL-NEXT:    vpaddb %ymm0, %ymm5, %ymm0
-; ALL-NEXT:    vpsrlw $8, %ymm0, %ymm0
-; ALL-NEXT:    vpsubw %ymm1, %ymm2, %ymm2
-; ALL-NEXT:    vpand %ymm2, %ymm1, %ymm1
-; ALL-NEXT:    vpsubw %ymm3, %ymm1, %ymm1
-; ALL-NEXT:    vpand %ymm4, %ymm1, %ymm2
-; ALL-NEXT:    vpshufb %ymm2, %ymm6, %ymm2
-; ALL-NEXT:    vpsrlw $4, %ymm1, %ymm1
-; ALL-NEXT:    vpand %ymm4, %ymm1, %ymm1
-; ALL-NEXT:    vpshufb %ymm1, %ymm6, %ymm1
-; ALL-NEXT:    vpaddb %ymm2, %ymm1, %ymm1
-; ALL-NEXT:    vpsllw $8, %ymm1, %ymm2
-; ALL-NEXT:    vpaddb %ymm1, %ymm2, %ymm1
-; ALL-NEXT:    vpsrlw $8, %ymm1, %ymm1
-; ALL-NEXT:    retq
+; AVX512CD-LABEL: testv32i16:
+; AVX512CD:       ## BB#0:
+; AVX512CD-NEXT:    vpxor %ymm2, %ymm2, %ymm2
+; AVX512CD-NEXT:    vpsubw %ymm0, %ymm2, %ymm3
+; AVX512CD-NEXT:    vpand %ymm3, %ymm0, %ymm0
+; AVX512CD-NEXT:    vmovdqa {{.*#+}} ymm3 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
+; AVX512CD-NEXT:    vpsubw %ymm3, %ymm0, %ymm0
+; AVX512CD-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]
+; AVX512CD-NEXT:    vpand %ymm4, %ymm0, %ymm5
+; AVX512CD-NEXT:    vmovdqa {{.*#+}} ymm6 = [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]
+; AVX512CD-NEXT:    vpshufb %ymm5, %ymm6, %ymm5
+; AVX512CD-NEXT:    vpsrlw $4, %ymm0, %ymm0
+; AVX512CD-NEXT:    vpand %ymm4, %ymm0, %ymm0
+; AVX512CD-NEXT:    vpshufb %ymm0, %ymm6, %ymm0
+; AVX512CD-NEXT:    vpaddb %ymm5, %ymm0, %ymm0
+; AVX512CD-NEXT:    vpsllw $8, %ymm0, %ymm5
+; AVX512CD-NEXT:    vpaddb %ymm0, %ymm5, %ymm0
+; AVX512CD-NEXT:    vpsrlw $8, %ymm0, %ymm0
+; AVX512CD-NEXT:    vpsubw %ymm1, %ymm2, %ymm2
+; AVX512CD-NEXT:    vpand %ymm2, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpsubw %ymm3, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpand %ymm4, %ymm1, %ymm2
+; AVX512CD-NEXT:    vpshufb %ymm2, %ymm6, %ymm2
+; AVX512CD-NEXT:    vpsrlw $4, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpand %ymm4, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpshufb %ymm1, %ymm6, %ymm1
+; AVX512CD-NEXT:    vpaddb %ymm2, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpsllw $8, %ymm1, %ymm2
+; AVX512CD-NEXT:    vpaddb %ymm1, %ymm2, %ymm1
+; AVX512CD-NEXT:    vpsrlw $8, %ymm1, %ymm1
+; AVX512CD-NEXT:    retq
+;
+; AVX512CDBW-LABEL: testv32i16:
+; AVX512CDBW:       ## BB#0:
+; AVX512CDBW-NEXT:    vextracti32x4 $3, %zmm0, %xmm1
+; AVX512CDBW-NEXT:    vpextrw $1, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vmovd %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntw %cx, %cx
+; AVX512CDBW-NEXT:    vmovd %ecx, %xmm2
+; AVX512CDBW-NEXT:    vpinsrw $1, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $2, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $2, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $3, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $3, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $4, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $4, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $5, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $5, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $6, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $6, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $7, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $7, %eax, %xmm2, %xmm1
+; AVX512CDBW-NEXT:    vextracti32x4 $2, %zmm0, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $1, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vmovd %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntw %cx, %cx
+; AVX512CDBW-NEXT:    vmovd %ecx, %xmm3
+; AVX512CDBW-NEXT:    vpinsrw $1, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $2, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $2, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $3, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $3, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $4, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $4, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $5, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $5, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $6, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $6, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $7, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $7, %eax, %xmm3, %xmm2
+; AVX512CDBW-NEXT:    vinserti128 $1, %xmm1, %ymm2, %ymm1
+; AVX512CDBW-NEXT:    vextracti32x4 $1, %zmm0, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $1, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vmovd %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntw %cx, %cx
+; AVX512CDBW-NEXT:    vmovd %ecx, %xmm3
+; AVX512CDBW-NEXT:    vpinsrw $1, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $2, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $2, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $3, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $3, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $4, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $4, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $5, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $5, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $6, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $6, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $7, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $7, %eax, %xmm3, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $1, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vmovd %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntw %cx, %cx
+; AVX512CDBW-NEXT:    vmovd %ecx, %xmm3
+; AVX512CDBW-NEXT:    vpinsrw $1, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $2, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $2, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $3, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $3, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $4, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $4, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $5, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $5, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $6, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $6, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $7, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $7, %eax, %xmm3, %xmm0
+; AVX512CDBW-NEXT:    vinserti128 $1, %xmm2, %ymm0, %ymm0
+; AVX512CDBW-NEXT:    vinserti64x4 $1, %ymm1, %zmm0, %zmm0
+; AVX512CDBW-NEXT:    retq
   %out = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %in, i1 0)
   ret <32 x i16> %out
 }
 
 define <32 x i16> @testv32i16u(<32 x i16> %in) nounwind {
-; ALL-LABEL: testv32i16u:
-; ALL:       ## BB#0:
-; ALL-NEXT:    vpxor %ymm2, %ymm2, %ymm2
-; ALL-NEXT:    vpsubw %ymm0, %ymm2, %ymm3
-; ALL-NEXT:    vpand %ymm3, %ymm0, %ymm0
-; ALL-NEXT:    vmovdqa {{.*#+}} ymm3 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
-; ALL-NEXT:    vpsubw %ymm3, %ymm0, %ymm0
-; ALL-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]
-; ALL-NEXT:    vpand %ymm4, %ymm0, %ymm5
-; ALL-NEXT:    vmovdqa {{.*#+}} ymm6 = [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]
-; ALL-NEXT:    vpshufb %ymm5, %ymm6, %ymm5
-; ALL-NEXT:    vpsrlw $4, %ymm0, %ymm0
-; ALL-NEXT:    vpand %ymm4, %ymm0, %ymm0
-; ALL-NEXT:    vpshufb %ymm0, %ymm6, %ymm0
-; ALL-NEXT:    vpaddb %ymm5, %ymm0, %ymm0
-; ALL-NEXT:    vpsllw $8, %ymm0, %ymm5
-; ALL-NEXT:    vpaddb %ymm0, %ymm5, %ymm0
-; ALL-NEXT:    vpsrlw $8, %ymm0, %ymm0
-; ALL-NEXT:    vpsubw %ymm1, %ymm2, %ymm2
-; ALL-NEXT:    vpand %ymm2, %ymm1, %ymm1
-; ALL-NEXT:    vpsubw %ymm3, %ymm1, %ymm1
-; ALL-NEXT:    vpand %ymm4, %ymm1, %ymm2
-; ALL-NEXT:    vpshufb %ymm2, %ymm6, %ymm2
-; ALL-NEXT:    vpsrlw $4, %ymm1, %ymm1
-; ALL-NEXT:    vpand %ymm4, %ymm1, %ymm1
-; ALL-NEXT:    vpshufb %ymm1, %ymm6, %ymm1
-; ALL-NEXT:    vpaddb %ymm2, %ymm1, %ymm1
-; ALL-NEXT:    vpsllw $8, %ymm1, %ymm2
-; ALL-NEXT:    vpaddb %ymm1, %ymm2, %ymm1
-; ALL-NEXT:    vpsrlw $8, %ymm1, %ymm1
-; ALL-NEXT:    retq
+; AVX512CD-LABEL: testv32i16u:
+; AVX512CD:       ## BB#0:
+; AVX512CD-NEXT:    vpxor %ymm2, %ymm2, %ymm2
+; AVX512CD-NEXT:    vpsubw %ymm0, %ymm2, %ymm3
+; AVX512CD-NEXT:    vpand %ymm3, %ymm0, %ymm0
+; AVX512CD-NEXT:    vmovdqa {{.*#+}} ymm3 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
+; AVX512CD-NEXT:    vpsubw %ymm3, %ymm0, %ymm0
+; AVX512CD-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]
+; AVX512CD-NEXT:    vpand %ymm4, %ymm0, %ymm5
+; AVX512CD-NEXT:    vmovdqa {{.*#+}} ymm6 = [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]
+; AVX512CD-NEXT:    vpshufb %ymm5, %ymm6, %ymm5
+; AVX512CD-NEXT:    vpsrlw $4, %ymm0, %ymm0
+; AVX512CD-NEXT:    vpand %ymm4, %ymm0, %ymm0
+; AVX512CD-NEXT:    vpshufb %ymm0, %ymm6, %ymm0
+; AVX512CD-NEXT:    vpaddb %ymm5, %ymm0, %ymm0
+; AVX512CD-NEXT:    vpsllw $8, %ymm0, %ymm5
+; AVX512CD-NEXT:    vpaddb %ymm0, %ymm5, %ymm0
+; AVX512CD-NEXT:    vpsrlw $8, %ymm0, %ymm0
+; AVX512CD-NEXT:    vpsubw %ymm1, %ymm2, %ymm2
+; AVX512CD-NEXT:    vpand %ymm2, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpsubw %ymm3, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpand %ymm4, %ymm1, %ymm2
+; AVX512CD-NEXT:    vpshufb %ymm2, %ymm6, %ymm2
+; AVX512CD-NEXT:    vpsrlw $4, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpand %ymm4, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpshufb %ymm1, %ymm6, %ymm1
+; AVX512CD-NEXT:    vpaddb %ymm2, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpsllw $8, %ymm1, %ymm2
+; AVX512CD-NEXT:    vpaddb %ymm1, %ymm2, %ymm1
+; AVX512CD-NEXT:    vpsrlw $8, %ymm1, %ymm1
+; AVX512CD-NEXT:    retq
+;
+; AVX512CDBW-LABEL: testv32i16u:
+; AVX512CDBW:       ## BB#0:
+; AVX512CDBW-NEXT:    vextracti32x4 $3, %zmm0, %xmm1
+; AVX512CDBW-NEXT:    vpextrw $1, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vmovd %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntw %cx, %cx
+; AVX512CDBW-NEXT:    vmovd %ecx, %xmm2
+; AVX512CDBW-NEXT:    vpinsrw $1, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $2, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $2, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $3, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $3, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $4, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $4, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $5, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $5, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $6, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $6, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $7, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $7, %eax, %xmm2, %xmm1
+; AVX512CDBW-NEXT:    vextracti32x4 $2, %zmm0, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $1, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vmovd %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntw %cx, %cx
+; AVX512CDBW-NEXT:    vmovd %ecx, %xmm3
+; AVX512CDBW-NEXT:    vpinsrw $1, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $2, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $2, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $3, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $3, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $4, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $4, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $5, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $5, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $6, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $6, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $7, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $7, %eax, %xmm3, %xmm2
+; AVX512CDBW-NEXT:    vinserti128 $1, %xmm1, %ymm2, %ymm1
+; AVX512CDBW-NEXT:    vextracti32x4 $1, %zmm0, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $1, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vmovd %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntw %cx, %cx
+; AVX512CDBW-NEXT:    vmovd %ecx, %xmm3
+; AVX512CDBW-NEXT:    vpinsrw $1, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $2, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $2, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $3, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $3, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $4, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $4, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $5, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $5, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $6, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $6, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $7, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $7, %eax, %xmm3, %xmm2
+; AVX512CDBW-NEXT:    vpextrw $1, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vmovd %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntw %cx, %cx
+; AVX512CDBW-NEXT:    vmovd %ecx, %xmm3
+; AVX512CDBW-NEXT:    vpinsrw $1, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $2, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $2, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $3, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $3, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $4, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $4, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $5, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $5, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $6, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $6, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrw $7, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntw %ax, %ax
+; AVX512CDBW-NEXT:    vpinsrw $7, %eax, %xmm3, %xmm0
+; AVX512CDBW-NEXT:    vinserti128 $1, %xmm2, %ymm0, %ymm0
+; AVX512CDBW-NEXT:    vinserti64x4 $1, %ymm1, %zmm0, %zmm0
+; AVX512CDBW-NEXT:    retq
   %out = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %in, i1 -1)
   ret <32 x i16> %out
 }
 
 define <64 x i8> @testv64i8(<64 x i8> %in) nounwind {
-; ALL-LABEL: testv64i8:
-; ALL:       ## BB#0:
-; ALL-NEXT:    vpxor %ymm2, %ymm2, %ymm2
-; ALL-NEXT:    vpsubb %ymm0, %ymm2, %ymm3
-; ALL-NEXT:    vpand %ymm3, %ymm0, %ymm0
-; ALL-NEXT:    vmovdqa {{.*#+}} ymm3 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
-; ALL-NEXT:    vpsubb %ymm3, %ymm0, %ymm0
-; ALL-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]
-; ALL-NEXT:    vpand %ymm4, %ymm0, %ymm5
-; ALL-NEXT:    vmovdqa {{.*#+}} ymm6 = [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]
-; ALL-NEXT:    vpshufb %ymm5, %ymm6, %ymm5
-; ALL-NEXT:    vpsrlw $4, %ymm0, %ymm0
-; ALL-NEXT:    vpand %ymm4, %ymm0, %ymm0
-; ALL-NEXT:    vpshufb %ymm0, %ymm6, %ymm0
-; ALL-NEXT:    vpaddb %ymm5, %ymm0, %ymm0
-; ALL-NEXT:    vpsubb %ymm1, %ymm2, %ymm2
-; ALL-NEXT:    vpand %ymm2, %ymm1, %ymm1
-; ALL-NEXT:    vpsubb %ymm3, %ymm1, %ymm1
-; ALL-NEXT:    vpand %ymm4, %ymm1, %ymm2
-; ALL-NEXT:    vpshufb %ymm2, %ymm6, %ymm2
-; ALL-NEXT:    vpsrlw $4, %ymm1, %ymm1
-; ALL-NEXT:    vpand %ymm4, %ymm1, %ymm1
-; ALL-NEXT:    vpshufb %ymm1, %ymm6, %ymm1
-; ALL-NEXT:    vpaddb %ymm2, %ymm1, %ymm1
-; ALL-NEXT:    retq
+; AVX512CD-LABEL: testv64i8:
+; AVX512CD:       ## BB#0:
+; AVX512CD-NEXT:    vpxor %ymm2, %ymm2, %ymm2
+; AVX512CD-NEXT:    vpsubb %ymm0, %ymm2, %ymm3
+; AVX512CD-NEXT:    vpand %ymm3, %ymm0, %ymm0
+; AVX512CD-NEXT:    vmovdqa {{.*#+}} ymm3 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
+; AVX512CD-NEXT:    vpsubb %ymm3, %ymm0, %ymm0
+; AVX512CD-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]
+; AVX512CD-NEXT:    vpand %ymm4, %ymm0, %ymm5
+; AVX512CD-NEXT:    vmovdqa {{.*#+}} ymm6 = [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]
+; AVX512CD-NEXT:    vpshufb %ymm5, %ymm6, %ymm5
+; AVX512CD-NEXT:    vpsrlw $4, %ymm0, %ymm0
+; AVX512CD-NEXT:    vpand %ymm4, %ymm0, %ymm0
+; AVX512CD-NEXT:    vpshufb %ymm0, %ymm6, %ymm0
+; AVX512CD-NEXT:    vpaddb %ymm5, %ymm0, %ymm0
+; AVX512CD-NEXT:    vpsubb %ymm1, %ymm2, %ymm2
+; AVX512CD-NEXT:    vpand %ymm2, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpsubb %ymm3, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpand %ymm4, %ymm1, %ymm2
+; AVX512CD-NEXT:    vpshufb %ymm2, %ymm6, %ymm2
+; AVX512CD-NEXT:    vpsrlw $4, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpand %ymm4, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpshufb %ymm1, %ymm6, %ymm1
+; AVX512CD-NEXT:    vpaddb %ymm2, %ymm1, %ymm1
+; AVX512CD-NEXT:    retq
+;
+; AVX512CDBW-LABEL: testv64i8:
+; AVX512CDBW:       ## BB#0:
+; AVX512CDBW-NEXT:    vextracti32x4 $3, %zmm0, %xmm1
+; AVX512CDBW-NEXT:    vpextrb $1, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    movl $8, %eax
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpextrb $0, %xmm1, %edx
+; AVX512CDBW-NEXT:    tzcntl %edx, %edx
+; AVX512CDBW-NEXT:    cmpl $32, %edx
+; AVX512CDBW-NEXT:    cmovel %eax, %edx
+; AVX512CDBW-NEXT:    vmovd %edx, %xmm2
+; AVX512CDBW-NEXT:    vpinsrb $1, %ecx, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $2, %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $2, %ecx, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $3, %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $3, %ecx, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $4, %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $4, %ecx, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $5, %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $5, %ecx, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $6, %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $6, %ecx, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $7, %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $7, %ecx, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $8, %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $8, %ecx, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $9, %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $9, %ecx, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $10, %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $10, %ecx, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $11, %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $11, %ecx, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $12, %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $12, %ecx, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $13, %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $13, %ecx, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $14, %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $14, %ecx, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $15, %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $15, %ecx, %xmm2, %xmm1
+; AVX512CDBW-NEXT:    vextracti32x4 $2, %zmm0, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $1, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpextrb $0, %xmm2, %edx
+; AVX512CDBW-NEXT:    tzcntl %edx, %edx
+; AVX512CDBW-NEXT:    cmpl $32, %edx
+; AVX512CDBW-NEXT:    cmovel %eax, %edx
+; AVX512CDBW-NEXT:    vmovd %edx, %xmm3
+; AVX512CDBW-NEXT:    vpinsrb $1, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $2, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $2, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $3, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $3, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $4, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $4, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $5, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $5, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $6, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $6, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $7, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $7, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $8, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $8, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $9, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $9, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $10, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $10, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $11, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $11, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $12, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $12, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $13, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $13, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $14, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $14, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $15, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $15, %ecx, %xmm3, %xmm2
+; AVX512CDBW-NEXT:    vinserti128 $1, %xmm1, %ymm2, %ymm1
+; AVX512CDBW-NEXT:    vextracti32x4 $1, %zmm0, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $1, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpextrb $0, %xmm2, %edx
+; AVX512CDBW-NEXT:    tzcntl %edx, %edx
+; AVX512CDBW-NEXT:    cmpl $32, %edx
+; AVX512CDBW-NEXT:    cmovel %eax, %edx
+; AVX512CDBW-NEXT:    vmovd %edx, %xmm3
+; AVX512CDBW-NEXT:    vpinsrb $1, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $2, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $2, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $3, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $3, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $4, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $4, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $5, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $5, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $6, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $6, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $7, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $7, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $8, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $8, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $9, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $9, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $10, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $10, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $11, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $11, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $12, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $12, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $13, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $13, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $14, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $14, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $15, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $15, %ecx, %xmm3, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $1, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpextrb $0, %xmm0, %edx
+; AVX512CDBW-NEXT:    tzcntl %edx, %edx
+; AVX512CDBW-NEXT:    cmpl $32, %edx
+; AVX512CDBW-NEXT:    cmovel %eax, %edx
+; AVX512CDBW-NEXT:    vmovd %edx, %xmm3
+; AVX512CDBW-NEXT:    vpinsrb $1, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $2, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $2, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $3, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $3, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $4, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $4, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $5, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $5, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $6, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $6, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $7, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $7, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $8, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $8, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $9, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $9, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $10, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $10, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $11, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $11, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $12, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $12, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $13, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $13, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $14, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $14, %ecx, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $15, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    cmpl $32, %ecx
+; AVX512CDBW-NEXT:    cmovel %eax, %ecx
+; AVX512CDBW-NEXT:    vpinsrb $15, %ecx, %xmm3, %xmm0
+; AVX512CDBW-NEXT:    vinserti128 $1, %xmm2, %ymm0, %ymm0
+; AVX512CDBW-NEXT:    vinserti64x4 $1, %ymm1, %zmm0, %zmm0
+; AVX512CDBW-NEXT:    retq
   %out = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %in, i1 0)
   ret <64 x i8> %out
 }
 
 define <64 x i8> @testv64i8u(<64 x i8> %in) nounwind {
-; ALL-LABEL: testv64i8u:
-; ALL:       ## BB#0:
-; ALL-NEXT:    vpxor %ymm2, %ymm2, %ymm2
-; ALL-NEXT:    vpsubb %ymm0, %ymm2, %ymm3
-; ALL-NEXT:    vpand %ymm3, %ymm0, %ymm0
-; ALL-NEXT:    vmovdqa {{.*#+}} ymm3 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
-; ALL-NEXT:    vpsubb %ymm3, %ymm0, %ymm0
-; ALL-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]
-; ALL-NEXT:    vpand %ymm4, %ymm0, %ymm5
-; ALL-NEXT:    vmovdqa {{.*#+}} ymm6 = [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]
-; ALL-NEXT:    vpshufb %ymm5, %ymm6, %ymm5
-; ALL-NEXT:    vpsrlw $4, %ymm0, %ymm0
-; ALL-NEXT:    vpand %ymm4, %ymm0, %ymm0
-; ALL-NEXT:    vpshufb %ymm0, %ymm6, %ymm0
-; ALL-NEXT:    vpaddb %ymm5, %ymm0, %ymm0
-; ALL-NEXT:    vpsubb %ymm1, %ymm2, %ymm2
-; ALL-NEXT:    vpand %ymm2, %ymm1, %ymm1
-; ALL-NEXT:    vpsubb %ymm3, %ymm1, %ymm1
-; ALL-NEXT:    vpand %ymm4, %ymm1, %ymm2
-; ALL-NEXT:    vpshufb %ymm2, %ymm6, %ymm2
-; ALL-NEXT:    vpsrlw $4, %ymm1, %ymm1
-; ALL-NEXT:    vpand %ymm4, %ymm1, %ymm1
-; ALL-NEXT:    vpshufb %ymm1, %ymm6, %ymm1
-; ALL-NEXT:    vpaddb %ymm2, %ymm1, %ymm1
-; ALL-NEXT:    retq
+; AVX512CD-LABEL: testv64i8u:
+; AVX512CD:       ## BB#0:
+; AVX512CD-NEXT:    vpxor %ymm2, %ymm2, %ymm2
+; AVX512CD-NEXT:    vpsubb %ymm0, %ymm2, %ymm3
+; AVX512CD-NEXT:    vpand %ymm3, %ymm0, %ymm0
+; AVX512CD-NEXT:    vmovdqa {{.*#+}} ymm3 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
+; AVX512CD-NEXT:    vpsubb %ymm3, %ymm0, %ymm0
+; AVX512CD-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]
+; AVX512CD-NEXT:    vpand %ymm4, %ymm0, %ymm5
+; AVX512CD-NEXT:    vmovdqa {{.*#+}} ymm6 = [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]
+; AVX512CD-NEXT:    vpshufb %ymm5, %ymm6, %ymm5
+; AVX512CD-NEXT:    vpsrlw $4, %ymm0, %ymm0
+; AVX512CD-NEXT:    vpand %ymm4, %ymm0, %ymm0
+; AVX512CD-NEXT:    vpshufb %ymm0, %ymm6, %ymm0
+; AVX512CD-NEXT:    vpaddb %ymm5, %ymm0, %ymm0
+; AVX512CD-NEXT:    vpsubb %ymm1, %ymm2, %ymm2
+; AVX512CD-NEXT:    vpand %ymm2, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpsubb %ymm3, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpand %ymm4, %ymm1, %ymm2
+; AVX512CD-NEXT:    vpshufb %ymm2, %ymm6, %ymm2
+; AVX512CD-NEXT:    vpsrlw $4, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpand %ymm4, %ymm1, %ymm1
+; AVX512CD-NEXT:    vpshufb %ymm1, %ymm6, %ymm1
+; AVX512CD-NEXT:    vpaddb %ymm2, %ymm1, %ymm1
+; AVX512CD-NEXT:    retq
+;
+; AVX512CDBW-LABEL: testv64i8u:
+; AVX512CDBW:       ## BB#0:
+; AVX512CDBW-NEXT:    vextracti32x4 $3, %zmm0, %xmm1
+; AVX512CDBW-NEXT:    vpextrb $1, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpextrb $0, %xmm1, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    vmovd %ecx, %xmm2
+; AVX512CDBW-NEXT:    vpinsrb $1, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $2, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $2, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $3, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $3, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $4, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $4, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $5, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $5, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $6, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $6, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $7, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $7, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $8, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $8, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $9, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $9, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $10, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $10, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $11, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $11, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $12, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $12, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $13, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $13, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $14, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $14, %eax, %xmm2, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $15, %xmm1, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $15, %eax, %xmm2, %xmm1
+; AVX512CDBW-NEXT:    vextracti32x4 $2, %zmm0, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $1, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpextrb $0, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    vmovd %ecx, %xmm3
+; AVX512CDBW-NEXT:    vpinsrb $1, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $2, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $2, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $3, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $3, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $4, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $4, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $5, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $5, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $6, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $6, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $7, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $7, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $8, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $8, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $9, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $9, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $10, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $10, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $11, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $11, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $12, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $12, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $13, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $13, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $14, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $14, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $15, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $15, %eax, %xmm3, %xmm2
+; AVX512CDBW-NEXT:    vinserti128 $1, %xmm1, %ymm2, %ymm1
+; AVX512CDBW-NEXT:    vextracti32x4 $1, %zmm0, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $1, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpextrb $0, %xmm2, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    vmovd %ecx, %xmm3
+; AVX512CDBW-NEXT:    vpinsrb $1, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $2, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $2, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $3, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $3, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $4, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $4, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $5, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $5, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $6, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $6, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $7, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $7, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $8, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $8, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $9, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $9, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $10, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $10, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $11, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $11, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $12, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $12, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $13, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $13, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $14, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $14, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $15, %xmm2, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $15, %eax, %xmm3, %xmm2
+; AVX512CDBW-NEXT:    vpextrb $1, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpextrb $0, %xmm0, %ecx
+; AVX512CDBW-NEXT:    tzcntl %ecx, %ecx
+; AVX512CDBW-NEXT:    vmovd %ecx, %xmm3
+; AVX512CDBW-NEXT:    vpinsrb $1, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $2, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $2, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $3, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $3, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $4, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $4, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $5, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $5, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $6, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $6, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $7, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $7, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $8, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $8, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $9, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $9, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $10, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $10, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $11, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $11, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $12, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $12, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $13, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $13, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $14, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $14, %eax, %xmm3, %xmm3
+; AVX512CDBW-NEXT:    vpextrb $15, %xmm0, %eax
+; AVX512CDBW-NEXT:    tzcntl %eax, %eax
+; AVX512CDBW-NEXT:    vpinsrb $15, %eax, %xmm3, %xmm0
+; AVX512CDBW-NEXT:    vinserti128 $1, %xmm2, %ymm0, %ymm0
+; AVX512CDBW-NEXT:    vinserti64x4 $1, %ymm1, %zmm0, %zmm0
+; AVX512CDBW-NEXT:    retq
   %out = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %in, i1 -1)
   ret <64 x i8> %out
 }




More information about the llvm-commits mailing list