llvm-project/llvm/test/CodeGen/X86/masked_store_trunc.ll

1900 lines
75 KiB
LLVM
Raw Normal View History

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=avx512f | FileCheck %s --check-prefixes=AVX512,AVX512F
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=avx512vl | FileCheck %s --check-prefixes=AVX512,AVX512VL
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=avx512bw | FileCheck %s --check-prefixes=AVX512,AVX512BW,AVX512BWNOVL
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=avx512vl,avx512bw | FileCheck %s --check-prefixes=AVX512,AVX512VL,AVX512BWVL
define void @truncstore_v8i64_v8i32(<8 x i64> %x, <8 x i32>* %p, <8 x i32> %mask) {
; AVX512F-LABEL: truncstore_v8i64_v8i32:
; AVX512F: # %bb.0:
; AVX512F-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftlw $8, %k0, %k0
; AVX512F-NEXT: kshiftrw $8, %k0, %k1
; AVX512F-NEXT: vpmovqd %zmm0, %ymm0
; AVX512F-NEXT: vmovdqu32 %zmm0, (%rdi) {%k1}
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512VL-LABEL: truncstore_v8i64_v8i32:
; AVX512VL: # %bb.0:
; AVX512VL-NEXT: vptestmd %ymm1, %ymm1, %k1
; AVX512VL-NEXT: vpmovqd %zmm0, %ymm0
; AVX512VL-NEXT: vmovdqu32 %ymm0, (%rdi) {%k1}
; AVX512VL-NEXT: vzeroupper
; AVX512VL-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v8i64_v8i32:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
; AVX512BW-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512BW-NEXT: kshiftlw $8, %k0, %k0
; AVX512BW-NEXT: kshiftrw $8, %k0, %k1
; AVX512BW-NEXT: vpmovqd %zmm0, %ymm0
; AVX512BW-NEXT: vmovdqu32 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
%a = icmp ne <8 x i32> %mask, zeroinitializer
%b = trunc <8 x i64> %x to <8 x i32>
call void @llvm.masked.store.v8i32.p0v8i32(<8 x i32> %b, <8 x i32>* %p, i32 1, <8 x i1> %a)
ret void
}
define void @truncstore_v8i64_v8i16(<8 x i64> %x, <8 x i16>* %p, <8 x i32> %mask) {
; AVX512F-LABEL: truncstore_v8i64_v8i16:
; AVX512F: # %bb.0:
; AVX512F-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: vpmovqw %zmm0, %xmm0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB1_2
; AVX512F-NEXT: # %bb.1: # %cond.store
; AVX512F-NEXT: vpextrw $0, %xmm0, (%rdi)
; AVX512F-NEXT: .LBB1_2: # %else
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $1, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB1_4
; AVX512F-NEXT: # %bb.3: # %cond.store1
; AVX512F-NEXT: vpextrw $1, %xmm0, 2(%rdi)
; AVX512F-NEXT: .LBB1_4: # %else2
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $2, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB1_6
; AVX512F-NEXT: # %bb.5: # %cond.store3
; AVX512F-NEXT: vpextrw $2, %xmm0, 4(%rdi)
; AVX512F-NEXT: .LBB1_6: # %else4
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $3, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB1_8
; AVX512F-NEXT: # %bb.7: # %cond.store5
; AVX512F-NEXT: vpextrw $3, %xmm0, 6(%rdi)
; AVX512F-NEXT: .LBB1_8: # %else6
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $4, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB1_10
; AVX512F-NEXT: # %bb.9: # %cond.store7
; AVX512F-NEXT: vpextrw $4, %xmm0, 8(%rdi)
; AVX512F-NEXT: .LBB1_10: # %else8
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $5, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB1_12
; AVX512F-NEXT: # %bb.11: # %cond.store9
; AVX512F-NEXT: vpextrw $5, %xmm0, 10(%rdi)
; AVX512F-NEXT: .LBB1_12: # %else10
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $6, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB1_14
; AVX512F-NEXT: # %bb.13: # %cond.store11
; AVX512F-NEXT: vpextrw $6, %xmm0, 12(%rdi)
; AVX512F-NEXT: .LBB1_14: # %else12
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $7, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB1_16
; AVX512F-NEXT: # %bb.15: # %cond.store13
; AVX512F-NEXT: vpextrw $7, %xmm0, 14(%rdi)
; AVX512F-NEXT: .LBB1_16: # %else14
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v8i64_v8i16:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
; AVX512BW-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512BW-NEXT: kshiftld $24, %k0, %k0
; AVX512BW-NEXT: kshiftrd $24, %k0, %k1
; AVX512BW-NEXT: vpmovqw %zmm0, %xmm0
; AVX512BW-NEXT: vmovdqu16 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512BWVL-LABEL: truncstore_v8i64_v8i16:
; AVX512BWVL: # %bb.0:
; AVX512BWVL-NEXT: vptestmd %ymm1, %ymm1, %k1
; AVX512BWVL-NEXT: vpmovqw %zmm0, %xmm0
; AVX512BWVL-NEXT: vmovdqu16 %xmm0, (%rdi) {%k1}
; AVX512BWVL-NEXT: vzeroupper
; AVX512BWVL-NEXT: retq
%a = icmp ne <8 x i32> %mask, zeroinitializer
%b = trunc <8 x i64> %x to <8 x i16>
call void @llvm.masked.store.v8i16.p0v8i16(<8 x i16> %b, <8 x i16>* %p, i32 1, <8 x i1> %a)
ret void
}
define void @truncstore_v8i64_v8i8(<8 x i64> %x, <8 x i8>* %p, <8 x i32> %mask) {
; AVX512F-LABEL: truncstore_v8i64_v8i8:
; AVX512F: # %bb.0:
; AVX512F-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: vpmovqw %zmm0, %xmm0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB2_2
; AVX512F-NEXT: # %bb.1: # %cond.store
; AVX512F-NEXT: vpextrb $0, %xmm0, (%rdi)
; AVX512F-NEXT: .LBB2_2: # %else
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $1, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB2_4
; AVX512F-NEXT: # %bb.3: # %cond.store1
; AVX512F-NEXT: vpextrb $2, %xmm0, 1(%rdi)
; AVX512F-NEXT: .LBB2_4: # %else2
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $2, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB2_6
; AVX512F-NEXT: # %bb.5: # %cond.store3
; AVX512F-NEXT: vpextrb $4, %xmm0, 2(%rdi)
; AVX512F-NEXT: .LBB2_6: # %else4
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $3, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB2_8
; AVX512F-NEXT: # %bb.7: # %cond.store5
; AVX512F-NEXT: vpextrb $6, %xmm0, 3(%rdi)
; AVX512F-NEXT: .LBB2_8: # %else6
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $4, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB2_10
; AVX512F-NEXT: # %bb.9: # %cond.store7
; AVX512F-NEXT: vpextrb $8, %xmm0, 4(%rdi)
; AVX512F-NEXT: .LBB2_10: # %else8
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $5, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB2_12
; AVX512F-NEXT: # %bb.11: # %cond.store9
; AVX512F-NEXT: vpextrb $10, %xmm0, 5(%rdi)
; AVX512F-NEXT: .LBB2_12: # %else10
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $6, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB2_14
; AVX512F-NEXT: # %bb.13: # %cond.store11
; AVX512F-NEXT: vpextrb $12, %xmm0, 6(%rdi)
; AVX512F-NEXT: .LBB2_14: # %else12
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $7, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB2_16
; AVX512F-NEXT: # %bb.15: # %cond.store13
; AVX512F-NEXT: vpextrb $14, %xmm0, 7(%rdi)
; AVX512F-NEXT: .LBB2_16: # %else14
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v8i64_v8i8:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
; AVX512BW-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512BW-NEXT: vpmovqw %zmm0, %xmm0
; AVX512BW-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,2,4,6,8,10,12,14,u,u,u,u,u,u,u,u]
; AVX512BW-NEXT: kshiftlq $56, %k0, %k0
; AVX512BW-NEXT: kshiftrq $56, %k0, %k1
; AVX512BW-NEXT: vmovdqu8 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512BWVL-LABEL: truncstore_v8i64_v8i8:
; AVX512BWVL: # %bb.0:
; AVX512BWVL-NEXT: vptestmd %ymm1, %ymm1, %k1
; AVX512BWVL-NEXT: vpmovqw %zmm0, %xmm0
; AVX512BWVL-NEXT: vpmovwb %xmm0, (%rdi) {%k1}
; AVX512BWVL-NEXT: vzeroupper
; AVX512BWVL-NEXT: retq
%a = icmp ne <8 x i32> %mask, zeroinitializer
%b = trunc <8 x i64> %x to <8 x i8>
call void @llvm.masked.store.v8i8.p0v8i8(<8 x i8> %b, <8 x i8>* %p, i32 1, <8 x i1> %a)
ret void
}
define void @truncstore_v4i64_v4i32(<4 x i64> %x, <4 x i32>* %p, <4 x i32> %mask) {
; AVX512F-LABEL: truncstore_v4i64_v4i32:
; AVX512F: # %bb.0:
; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftlw $12, %k0, %k0
; AVX512F-NEXT: kshiftrw $12, %k0, %k1
; AVX512F-NEXT: vpmovqd %zmm0, %ymm0
; AVX512F-NEXT: vmovdqu32 %zmm0, (%rdi) {%k1}
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512VL-LABEL: truncstore_v4i64_v4i32:
; AVX512VL: # %bb.0:
; AVX512VL-NEXT: vptestmd %xmm1, %xmm1, %k1
; AVX512VL-NEXT: vpmovqd %ymm0, %xmm0
; AVX512VL-NEXT: vmovdqu32 %xmm0, (%rdi) {%k1}
; AVX512VL-NEXT: vzeroupper
; AVX512VL-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v4i64_v4i32:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
; AVX512BW-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512BW-NEXT: kshiftlw $12, %k0, %k0
; AVX512BW-NEXT: kshiftrw $12, %k0, %k1
; AVX512BW-NEXT: vpmovqd %zmm0, %ymm0
; AVX512BW-NEXT: vmovdqu32 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
%a = icmp ne <4 x i32> %mask, zeroinitializer
%b = trunc <4 x i64> %x to <4 x i32>
call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> %b, <4 x i32>* %p, i32 1, <4 x i1> %a)
ret void
}
define void @truncstore_v4i64_v4i16(<4 x i64> %x, <4 x i16>* %p, <4 x i32> %mask) {
; AVX512F-LABEL: truncstore_v4i64_v4i16:
; AVX512F: # %bb.0:
; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: vpmovqd %zmm0, %ymm0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB4_2
; AVX512F-NEXT: # %bb.1: # %cond.store
; AVX512F-NEXT: vpextrw $0, %xmm0, (%rdi)
; AVX512F-NEXT: .LBB4_2: # %else
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $1, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB4_4
; AVX512F-NEXT: # %bb.3: # %cond.store1
; AVX512F-NEXT: vpextrw $2, %xmm0, 2(%rdi)
; AVX512F-NEXT: .LBB4_4: # %else2
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $2, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB4_6
; AVX512F-NEXT: # %bb.5: # %cond.store3
; AVX512F-NEXT: vpextrw $4, %xmm0, 4(%rdi)
; AVX512F-NEXT: .LBB4_6: # %else4
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $3, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB4_8
; AVX512F-NEXT: # %bb.7: # %cond.store5
; AVX512F-NEXT: vpextrw $6, %xmm0, 6(%rdi)
; AVX512F-NEXT: .LBB4_8: # %else6
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v4i64_v4i16:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
; AVX512BW-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512BW-NEXT: vpmovqd %zmm0, %ymm0
; AVX512BW-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
; AVX512BW-NEXT: kshiftld $28, %k0, %k0
; AVX512BW-NEXT: kshiftrd $28, %k0, %k1
; AVX512BW-NEXT: vmovdqu16 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512BWVL-LABEL: truncstore_v4i64_v4i16:
; AVX512BWVL: # %bb.0:
; AVX512BWVL-NEXT: vptestmd %xmm1, %xmm1, %k1
; AVX512BWVL-NEXT: vpmovqd %ymm0, %xmm0
; AVX512BWVL-NEXT: vpmovdw %xmm0, (%rdi) {%k1}
; AVX512BWVL-NEXT: vzeroupper
; AVX512BWVL-NEXT: retq
%a = icmp ne <4 x i32> %mask, zeroinitializer
%b = trunc <4 x i64> %x to <4 x i16>
call void @llvm.masked.store.v4i16.p0v4i16(<4 x i16> %b, <4 x i16>* %p, i32 1, <4 x i1> %a)
ret void
}
define void @truncstore_v4i64_v4i8(<4 x i64> %x, <4 x i8>* %p, <4 x i32> %mask) {
; AVX512F-LABEL: truncstore_v4i64_v4i8:
; AVX512F: # %bb.0:
; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: vpmovqd %zmm0, %ymm0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB5_2
; AVX512F-NEXT: # %bb.1: # %cond.store
; AVX512F-NEXT: vpextrb $0, %xmm0, (%rdi)
; AVX512F-NEXT: .LBB5_2: # %else
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $1, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB5_4
; AVX512F-NEXT: # %bb.3: # %cond.store1
; AVX512F-NEXT: vpextrb $4, %xmm0, 1(%rdi)
; AVX512F-NEXT: .LBB5_4: # %else2
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $2, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB5_6
; AVX512F-NEXT: # %bb.5: # %cond.store3
; AVX512F-NEXT: vpextrb $8, %xmm0, 2(%rdi)
; AVX512F-NEXT: .LBB5_6: # %else4
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $3, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB5_8
; AVX512F-NEXT: # %bb.7: # %cond.store5
; AVX512F-NEXT: vpextrb $12, %xmm0, 3(%rdi)
; AVX512F-NEXT: .LBB5_8: # %else6
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v4i64_v4i8:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
; AVX512BW-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512BW-NEXT: vpmovqd %zmm0, %ymm0
; AVX512BW-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,4,8,12,u,u,u,u,u,u,u,u,u,u,u,u]
; AVX512BW-NEXT: kshiftlq $60, %k0, %k0
; AVX512BW-NEXT: kshiftrq $60, %k0, %k1
; AVX512BW-NEXT: vmovdqu8 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512BWVL-LABEL: truncstore_v4i64_v4i8:
; AVX512BWVL: # %bb.0:
; AVX512BWVL-NEXT: vptestmd %xmm1, %xmm1, %k1
; AVX512BWVL-NEXT: vpmovqd %ymm0, %xmm0
; AVX512BWVL-NEXT: vpmovdb %xmm0, (%rdi) {%k1}
; AVX512BWVL-NEXT: vzeroupper
; AVX512BWVL-NEXT: retq
%a = icmp ne <4 x i32> %mask, zeroinitializer
%b = trunc <4 x i64> %x to <4 x i8>
call void @llvm.masked.store.v4i8.p0v4i8(<4 x i8> %b, <4 x i8>* %p, i32 1, <4 x i1> %a)
ret void
}
define void @truncstore_v2i64_v2i32(<2 x i64> %x, <2 x i32>* %p, <2 x i64> %mask) {
; AVX512F-LABEL: truncstore_v2i64_v2i32:
; AVX512F: # %bb.0:
; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512F-NEXT: vptestmq %zmm1, %zmm1, %k0
; AVX512F-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
; AVX512F-NEXT: kshiftlw $14, %k0, %k0
; AVX512F-NEXT: kshiftrw $14, %k0, %k1
; AVX512F-NEXT: vmovdqu32 %zmm0, (%rdi) {%k1}
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512VL-LABEL: truncstore_v2i64_v2i32:
; AVX512VL: # %bb.0:
; AVX512VL-NEXT: vptestmq %xmm1, %xmm1, %k1
; AVX512VL-NEXT: vpmovqd %xmm0, (%rdi) {%k1}
; AVX512VL-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v2i64_v2i32:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512BW-NEXT: vptestmq %zmm1, %zmm1, %k0
; AVX512BW-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
; AVX512BW-NEXT: kshiftlw $14, %k0, %k0
; AVX512BW-NEXT: kshiftrw $14, %k0, %k1
; AVX512BW-NEXT: vmovdqu32 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
%a = icmp ne <2 x i64> %mask, zeroinitializer
%b = trunc <2 x i64> %x to <2 x i32>
call void @llvm.masked.store.v2i32.p0v2i32(<2 x i32> %b, <2 x i32>* %p, i32 1, <2 x i1> %a)
ret void
}
define void @truncstore_v2i64_v2i16(<2 x i64> %x, <2 x i16>* %p, <2 x i64> %mask) {
; AVX512F-LABEL: truncstore_v2i64_v2i16:
; AVX512F: # %bb.0:
; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512F-NEXT: vptestmq %zmm1, %zmm1, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB7_2
; AVX512F-NEXT: # %bb.1: # %cond.store
; AVX512F-NEXT: vpextrw $0, %xmm0, (%rdi)
; AVX512F-NEXT: .LBB7_2: # %else
; AVX512F-NEXT: vptestmq %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $1, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB7_4
; AVX512F-NEXT: # %bb.3: # %cond.store1
; AVX512F-NEXT: vpextrw $4, %xmm0, 2(%rdi)
; AVX512F-NEXT: .LBB7_4: # %else2
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v2i64_v2i16:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512BW-NEXT: vptestmq %zmm1, %zmm1, %k0
; AVX512BW-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
; AVX512BW-NEXT: vpshuflw {{.*#+}} xmm0 = xmm0[0,2,2,3,4,5,6,7]
; AVX512BW-NEXT: kshiftld $30, %k0, %k0
; AVX512BW-NEXT: kshiftrd $30, %k0, %k1
; AVX512BW-NEXT: vmovdqu16 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512BWVL-LABEL: truncstore_v2i64_v2i16:
; AVX512BWVL: # %bb.0:
; AVX512BWVL-NEXT: vptestmq %xmm1, %xmm1, %k1
; AVX512BWVL-NEXT: vpmovqw %xmm0, (%rdi) {%k1}
; AVX512BWVL-NEXT: retq
%a = icmp ne <2 x i64> %mask, zeroinitializer
%b = trunc <2 x i64> %x to <2 x i16>
call void @llvm.masked.store.v2i16.p0v2i16(<2 x i16> %b, <2 x i16>* %p, i32 1, <2 x i1> %a)
ret void
}
define void @truncstore_v2i64_v2i8(<2 x i64> %x, <2 x i8>* %p, <2 x i64> %mask) {
; AVX512F-LABEL: truncstore_v2i64_v2i8:
; AVX512F: # %bb.0:
; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512F-NEXT: vptestmq %zmm1, %zmm1, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB8_2
; AVX512F-NEXT: # %bb.1: # %cond.store
; AVX512F-NEXT: vpextrb $0, %xmm0, (%rdi)
; AVX512F-NEXT: .LBB8_2: # %else
; AVX512F-NEXT: vptestmq %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $1, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB8_4
; AVX512F-NEXT: # %bb.3: # %cond.store1
; AVX512F-NEXT: vpextrb $8, %xmm0, 1(%rdi)
; AVX512F-NEXT: .LBB8_4: # %else2
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v2i64_v2i8:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512BW-NEXT: vptestmq %zmm1, %zmm1, %k0
; AVX512BW-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,8,u,u,u,u,u,u,u,u,u,u,u,u,u,u]
; AVX512BW-NEXT: kshiftlq $62, %k0, %k0
; AVX512BW-NEXT: kshiftrq $62, %k0, %k1
; AVX512BW-NEXT: vmovdqu8 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512BWVL-LABEL: truncstore_v2i64_v2i8:
; AVX512BWVL: # %bb.0:
; AVX512BWVL-NEXT: vptestmq %xmm1, %xmm1, %k1
; AVX512BWVL-NEXT: vpmovqb %xmm0, (%rdi) {%k1}
; AVX512BWVL-NEXT: retq
%a = icmp ne <2 x i64> %mask, zeroinitializer
%b = trunc <2 x i64> %x to <2 x i8>
call void @llvm.masked.store.v2i8.p0v2i8(<2 x i8> %b, <2 x i8>* %p, i32 1, <2 x i1> %a)
ret void
}
define void @truncstore_v16i32_v16i16(<16 x i32> %x, <16 x i16>* %p, <16 x i32> %mask) {
; AVX512F-LABEL: truncstore_v16i32_v16i16:
; AVX512F: # %bb.0:
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: vpmovdw %zmm0, %ymm0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_2
; AVX512F-NEXT: # %bb.1: # %cond.store
; AVX512F-NEXT: vpextrw $0, %xmm0, (%rdi)
; AVX512F-NEXT: .LBB9_2: # %else
; AVX512F-NEXT: kshiftrw $1, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_4
; AVX512F-NEXT: # %bb.3: # %cond.store1
; AVX512F-NEXT: vpextrw $1, %xmm0, 2(%rdi)
; AVX512F-NEXT: .LBB9_4: # %else2
; AVX512F-NEXT: kshiftrw $2, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_6
; AVX512F-NEXT: # %bb.5: # %cond.store3
; AVX512F-NEXT: vpextrw $2, %xmm0, 4(%rdi)
; AVX512F-NEXT: .LBB9_6: # %else4
; AVX512F-NEXT: kshiftrw $3, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_8
; AVX512F-NEXT: # %bb.7: # %cond.store5
; AVX512F-NEXT: vpextrw $3, %xmm0, 6(%rdi)
; AVX512F-NEXT: .LBB9_8: # %else6
; AVX512F-NEXT: kshiftrw $4, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_10
; AVX512F-NEXT: # %bb.9: # %cond.store7
; AVX512F-NEXT: vpextrw $4, %xmm0, 8(%rdi)
; AVX512F-NEXT: .LBB9_10: # %else8
; AVX512F-NEXT: kshiftrw $5, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_12
; AVX512F-NEXT: # %bb.11: # %cond.store9
; AVX512F-NEXT: vpextrw $5, %xmm0, 10(%rdi)
; AVX512F-NEXT: .LBB9_12: # %else10
; AVX512F-NEXT: kshiftrw $6, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_14
; AVX512F-NEXT: # %bb.13: # %cond.store11
; AVX512F-NEXT: vpextrw $6, %xmm0, 12(%rdi)
; AVX512F-NEXT: .LBB9_14: # %else12
; AVX512F-NEXT: kshiftrw $7, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_16
; AVX512F-NEXT: # %bb.15: # %cond.store13
; AVX512F-NEXT: vpextrw $7, %xmm0, 14(%rdi)
; AVX512F-NEXT: .LBB9_16: # %else14
; AVX512F-NEXT: kshiftrw $8, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_18
; AVX512F-NEXT: # %bb.17: # %cond.store15
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
; AVX512F-NEXT: vpextrw $0, %xmm1, 16(%rdi)
; AVX512F-NEXT: .LBB9_18: # %else16
; AVX512F-NEXT: kshiftrw $9, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_20
; AVX512F-NEXT: # %bb.19: # %cond.store17
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
; AVX512F-NEXT: vpextrw $1, %xmm1, 18(%rdi)
; AVX512F-NEXT: .LBB9_20: # %else18
; AVX512F-NEXT: kshiftrw $10, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_22
; AVX512F-NEXT: # %bb.21: # %cond.store19
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
; AVX512F-NEXT: vpextrw $2, %xmm1, 20(%rdi)
; AVX512F-NEXT: .LBB9_22: # %else20
; AVX512F-NEXT: kshiftrw $11, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_24
; AVX512F-NEXT: # %bb.23: # %cond.store21
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
; AVX512F-NEXT: vpextrw $3, %xmm1, 22(%rdi)
; AVX512F-NEXT: .LBB9_24: # %else22
; AVX512F-NEXT: kshiftrw $12, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_26
; AVX512F-NEXT: # %bb.25: # %cond.store23
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
; AVX512F-NEXT: vpextrw $4, %xmm1, 24(%rdi)
; AVX512F-NEXT: .LBB9_26: # %else24
; AVX512F-NEXT: kshiftrw $13, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_28
; AVX512F-NEXT: # %bb.27: # %cond.store25
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
; AVX512F-NEXT: vpextrw $5, %xmm1, 26(%rdi)
; AVX512F-NEXT: .LBB9_28: # %else26
; AVX512F-NEXT: kshiftrw $14, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_30
; AVX512F-NEXT: # %bb.29: # %cond.store27
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
; AVX512F-NEXT: vpextrw $6, %xmm1, 28(%rdi)
; AVX512F-NEXT: .LBB9_30: # %else28
; AVX512F-NEXT: kshiftrw $15, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB9_32
; AVX512F-NEXT: # %bb.31: # %cond.store29
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm0
; AVX512F-NEXT: vpextrw $7, %xmm0, 30(%rdi)
; AVX512F-NEXT: .LBB9_32: # %else30
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v16i32_v16i16:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: vptestmd %zmm1, %zmm1, %k1
; AVX512BW-NEXT: vpmovdw %zmm0, %ymm0
; AVX512BW-NEXT: vmovdqu16 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512BWVL-LABEL: truncstore_v16i32_v16i16:
; AVX512BWVL: # %bb.0:
; AVX512BWVL-NEXT: vptestmd %zmm1, %zmm1, %k1
; AVX512BWVL-NEXT: vpmovdw %zmm0, %ymm0
; AVX512BWVL-NEXT: vmovdqu16 %ymm0, (%rdi) {%k1}
; AVX512BWVL-NEXT: vzeroupper
; AVX512BWVL-NEXT: retq
%a = icmp ne <16 x i32> %mask, zeroinitializer
%b = trunc <16 x i32> %x to <16 x i16>
call void @llvm.masked.store.v16i16.p0v16i16(<16 x i16> %b, <16 x i16>* %p, i32 1, <16 x i1> %a)
ret void
}
define void @truncstore_v16i32_v16i8(<16 x i32> %x, <16 x i8>* %p, <16 x i32> %mask) {
; AVX512F-LABEL: truncstore_v16i32_v16i8:
; AVX512F: # %bb.0:
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: vpmovdb %zmm0, %xmm0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_2
; AVX512F-NEXT: # %bb.1: # %cond.store
; AVX512F-NEXT: vpextrb $0, %xmm0, (%rdi)
; AVX512F-NEXT: .LBB10_2: # %else
; AVX512F-NEXT: kshiftrw $1, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_4
; AVX512F-NEXT: # %bb.3: # %cond.store1
; AVX512F-NEXT: vpextrb $1, %xmm0, 1(%rdi)
; AVX512F-NEXT: .LBB10_4: # %else2
; AVX512F-NEXT: kshiftrw $2, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_6
; AVX512F-NEXT: # %bb.5: # %cond.store3
; AVX512F-NEXT: vpextrb $2, %xmm0, 2(%rdi)
; AVX512F-NEXT: .LBB10_6: # %else4
; AVX512F-NEXT: kshiftrw $3, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_8
; AVX512F-NEXT: # %bb.7: # %cond.store5
; AVX512F-NEXT: vpextrb $3, %xmm0, 3(%rdi)
; AVX512F-NEXT: .LBB10_8: # %else6
; AVX512F-NEXT: kshiftrw $4, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_10
; AVX512F-NEXT: # %bb.9: # %cond.store7
; AVX512F-NEXT: vpextrb $4, %xmm0, 4(%rdi)
; AVX512F-NEXT: .LBB10_10: # %else8
; AVX512F-NEXT: kshiftrw $5, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_12
; AVX512F-NEXT: # %bb.11: # %cond.store9
; AVX512F-NEXT: vpextrb $5, %xmm0, 5(%rdi)
; AVX512F-NEXT: .LBB10_12: # %else10
; AVX512F-NEXT: kshiftrw $6, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_14
; AVX512F-NEXT: # %bb.13: # %cond.store11
; AVX512F-NEXT: vpextrb $6, %xmm0, 6(%rdi)
; AVX512F-NEXT: .LBB10_14: # %else12
; AVX512F-NEXT: kshiftrw $7, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_16
; AVX512F-NEXT: # %bb.15: # %cond.store13
; AVX512F-NEXT: vpextrb $7, %xmm0, 7(%rdi)
; AVX512F-NEXT: .LBB10_16: # %else14
; AVX512F-NEXT: kshiftrw $8, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_18
; AVX512F-NEXT: # %bb.17: # %cond.store15
; AVX512F-NEXT: vpextrb $8, %xmm0, 8(%rdi)
; AVX512F-NEXT: .LBB10_18: # %else16
; AVX512F-NEXT: kshiftrw $9, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_20
; AVX512F-NEXT: # %bb.19: # %cond.store17
; AVX512F-NEXT: vpextrb $9, %xmm0, 9(%rdi)
; AVX512F-NEXT: .LBB10_20: # %else18
; AVX512F-NEXT: kshiftrw $10, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_22
; AVX512F-NEXT: # %bb.21: # %cond.store19
; AVX512F-NEXT: vpextrb $10, %xmm0, 10(%rdi)
; AVX512F-NEXT: .LBB10_22: # %else20
; AVX512F-NEXT: kshiftrw $11, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_24
; AVX512F-NEXT: # %bb.23: # %cond.store21
; AVX512F-NEXT: vpextrb $11, %xmm0, 11(%rdi)
; AVX512F-NEXT: .LBB10_24: # %else22
; AVX512F-NEXT: kshiftrw $12, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_26
; AVX512F-NEXT: # %bb.25: # %cond.store23
; AVX512F-NEXT: vpextrb $12, %xmm0, 12(%rdi)
; AVX512F-NEXT: .LBB10_26: # %else24
; AVX512F-NEXT: kshiftrw $13, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_28
; AVX512F-NEXT: # %bb.27: # %cond.store25
; AVX512F-NEXT: vpextrb $13, %xmm0, 13(%rdi)
; AVX512F-NEXT: .LBB10_28: # %else26
; AVX512F-NEXT: kshiftrw $14, %k0, %k1
; AVX512F-NEXT: kmovw %k1, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_30
; AVX512F-NEXT: # %bb.29: # %cond.store27
; AVX512F-NEXT: vpextrb $14, %xmm0, 14(%rdi)
; AVX512F-NEXT: .LBB10_30: # %else28
; AVX512F-NEXT: kshiftrw $15, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB10_32
; AVX512F-NEXT: # %bb.31: # %cond.store29
; AVX512F-NEXT: vpextrb $15, %xmm0, 15(%rdi)
; AVX512F-NEXT: .LBB10_32: # %else30
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v16i32_v16i8:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: vptestmd %zmm1, %zmm1, %k1
; AVX512BW-NEXT: vpmovdb %zmm0, %xmm0
; AVX512BW-NEXT: vmovdqu8 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512BWVL-LABEL: truncstore_v16i32_v16i8:
; AVX512BWVL: # %bb.0:
; AVX512BWVL-NEXT: vptestmd %zmm1, %zmm1, %k1
; AVX512BWVL-NEXT: vpmovdb %zmm0, %xmm0
; AVX512BWVL-NEXT: vmovdqu8 %xmm0, (%rdi) {%k1}
; AVX512BWVL-NEXT: vzeroupper
; AVX512BWVL-NEXT: retq
%a = icmp ne <16 x i32> %mask, zeroinitializer
%b = trunc <16 x i32> %x to <16 x i8>
call void @llvm.masked.store.v16i8.p0v16i8(<16 x i8> %b, <16 x i8>* %p, i32 1, <16 x i1> %a)
ret void
}
define void @truncstore_v8i32_v8i16(<8 x i32> %x, <8 x i16>* %p, <8 x i32> %mask) {
; AVX512F-LABEL: truncstore_v8i32_v8i16:
; AVX512F: # %bb.0:
; AVX512F-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: vpmovdw %zmm0, %ymm0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB11_2
; AVX512F-NEXT: # %bb.1: # %cond.store
; AVX512F-NEXT: vpextrw $0, %xmm0, (%rdi)
; AVX512F-NEXT: .LBB11_2: # %else
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $1, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB11_4
; AVX512F-NEXT: # %bb.3: # %cond.store1
; AVX512F-NEXT: vpextrw $1, %xmm0, 2(%rdi)
; AVX512F-NEXT: .LBB11_4: # %else2
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $2, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB11_6
; AVX512F-NEXT: # %bb.5: # %cond.store3
; AVX512F-NEXT: vpextrw $2, %xmm0, 4(%rdi)
; AVX512F-NEXT: .LBB11_6: # %else4
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $3, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB11_8
; AVX512F-NEXT: # %bb.7: # %cond.store5
; AVX512F-NEXT: vpextrw $3, %xmm0, 6(%rdi)
; AVX512F-NEXT: .LBB11_8: # %else6
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $4, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB11_10
; AVX512F-NEXT: # %bb.9: # %cond.store7
; AVX512F-NEXT: vpextrw $4, %xmm0, 8(%rdi)
; AVX512F-NEXT: .LBB11_10: # %else8
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $5, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB11_12
; AVX512F-NEXT: # %bb.11: # %cond.store9
; AVX512F-NEXT: vpextrw $5, %xmm0, 10(%rdi)
; AVX512F-NEXT: .LBB11_12: # %else10
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $6, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB11_14
; AVX512F-NEXT: # %bb.13: # %cond.store11
; AVX512F-NEXT: vpextrw $6, %xmm0, 12(%rdi)
; AVX512F-NEXT: .LBB11_14: # %else12
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $7, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB11_16
; AVX512F-NEXT: # %bb.15: # %cond.store13
; AVX512F-NEXT: vpextrw $7, %xmm0, 14(%rdi)
; AVX512F-NEXT: .LBB11_16: # %else14
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v8i32_v8i16:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
; AVX512BW-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512BW-NEXT: kshiftld $24, %k0, %k0
; AVX512BW-NEXT: kshiftrd $24, %k0, %k1
; AVX512BW-NEXT: vpmovdw %zmm0, %ymm0
; AVX512BW-NEXT: vmovdqu16 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512BWVL-LABEL: truncstore_v8i32_v8i16:
; AVX512BWVL: # %bb.0:
; AVX512BWVL-NEXT: vptestmd %ymm1, %ymm1, %k1
; AVX512BWVL-NEXT: vpmovdw %ymm0, %xmm0
; AVX512BWVL-NEXT: vmovdqu16 %xmm0, (%rdi) {%k1}
; AVX512BWVL-NEXT: vzeroupper
; AVX512BWVL-NEXT: retq
%a = icmp ne <8 x i32> %mask, zeroinitializer
%b = trunc <8 x i32> %x to <8 x i16>
call void @llvm.masked.store.v8i16.p0v8i16(<8 x i16> %b, <8 x i16>* %p, i32 1, <8 x i1> %a)
ret void
}
define void @truncstore_v8i32_v8i8(<8 x i32> %x, <8 x i8>* %p, <8 x i32> %mask) {
; AVX512F-LABEL: truncstore_v8i32_v8i8:
; AVX512F: # %bb.0:
; AVX512F-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: vpmovdw %zmm0, %ymm0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB12_2
; AVX512F-NEXT: # %bb.1: # %cond.store
; AVX512F-NEXT: vpextrb $0, %xmm0, (%rdi)
; AVX512F-NEXT: .LBB12_2: # %else
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $1, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB12_4
; AVX512F-NEXT: # %bb.3: # %cond.store1
; AVX512F-NEXT: vpextrb $2, %xmm0, 1(%rdi)
; AVX512F-NEXT: .LBB12_4: # %else2
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $2, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB12_6
; AVX512F-NEXT: # %bb.5: # %cond.store3
; AVX512F-NEXT: vpextrb $4, %xmm0, 2(%rdi)
; AVX512F-NEXT: .LBB12_6: # %else4
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $3, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB12_8
; AVX512F-NEXT: # %bb.7: # %cond.store5
; AVX512F-NEXT: vpextrb $6, %xmm0, 3(%rdi)
; AVX512F-NEXT: .LBB12_8: # %else6
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $4, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB12_10
; AVX512F-NEXT: # %bb.9: # %cond.store7
; AVX512F-NEXT: vpextrb $8, %xmm0, 4(%rdi)
; AVX512F-NEXT: .LBB12_10: # %else8
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $5, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB12_12
; AVX512F-NEXT: # %bb.11: # %cond.store9
; AVX512F-NEXT: vpextrb $10, %xmm0, 5(%rdi)
; AVX512F-NEXT: .LBB12_12: # %else10
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $6, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB12_14
; AVX512F-NEXT: # %bb.13: # %cond.store11
; AVX512F-NEXT: vpextrb $12, %xmm0, 6(%rdi)
; AVX512F-NEXT: .LBB12_14: # %else12
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $7, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB12_16
; AVX512F-NEXT: # %bb.15: # %cond.store13
; AVX512F-NEXT: vpextrb $14, %xmm0, 7(%rdi)
; AVX512F-NEXT: .LBB12_16: # %else14
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v8i32_v8i8:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
; AVX512BW-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512BW-NEXT: vpmovdw %zmm0, %ymm0
; AVX512BW-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,2,4,6,8,10,12,14,u,u,u,u,u,u,u,u]
; AVX512BW-NEXT: kshiftlq $56, %k0, %k0
; AVX512BW-NEXT: kshiftrq $56, %k0, %k1
; AVX512BW-NEXT: vmovdqu8 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512BWVL-LABEL: truncstore_v8i32_v8i8:
; AVX512BWVL: # %bb.0:
; AVX512BWVL-NEXT: vptestmd %ymm1, %ymm1, %k1
; AVX512BWVL-NEXT: vpmovdw %ymm0, %xmm0
; AVX512BWVL-NEXT: vpmovwb %xmm0, (%rdi) {%k1}
; AVX512BWVL-NEXT: vzeroupper
; AVX512BWVL-NEXT: retq
%a = icmp ne <8 x i32> %mask, zeroinitializer
%b = trunc <8 x i32> %x to <8 x i8>
call void @llvm.masked.store.v8i8.p0v8i8(<8 x i8> %b, <8 x i8>* %p, i32 1, <8 x i1> %a)
ret void
}
define void @truncstore_v4i32_v4i16(<4 x i32> %x, <4 x i16>* %p, <4 x i32> %mask) {
; AVX512F-LABEL: truncstore_v4i32_v4i16:
; AVX512F: # %bb.0:
; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB13_2
; AVX512F-NEXT: # %bb.1: # %cond.store
; AVX512F-NEXT: vpextrw $0, %xmm0, (%rdi)
; AVX512F-NEXT: .LBB13_2: # %else
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $1, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB13_4
; AVX512F-NEXT: # %bb.3: # %cond.store1
; AVX512F-NEXT: vpextrw $2, %xmm0, 2(%rdi)
; AVX512F-NEXT: .LBB13_4: # %else2
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $2, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB13_6
; AVX512F-NEXT: # %bb.5: # %cond.store3
; AVX512F-NEXT: vpextrw $4, %xmm0, 4(%rdi)
; AVX512F-NEXT: .LBB13_6: # %else4
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $3, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB13_8
; AVX512F-NEXT: # %bb.7: # %cond.store5
; AVX512F-NEXT: vpextrw $6, %xmm0, 6(%rdi)
; AVX512F-NEXT: .LBB13_8: # %else6
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v4i32_v4i16:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512BW-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512BW-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
; AVX512BW-NEXT: kshiftld $28, %k0, %k0
; AVX512BW-NEXT: kshiftrd $28, %k0, %k1
; AVX512BW-NEXT: vmovdqu16 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512BWVL-LABEL: truncstore_v4i32_v4i16:
; AVX512BWVL: # %bb.0:
; AVX512BWVL-NEXT: vptestmd %xmm1, %xmm1, %k1
; AVX512BWVL-NEXT: vpmovdw %xmm0, (%rdi) {%k1}
; AVX512BWVL-NEXT: retq
%a = icmp ne <4 x i32> %mask, zeroinitializer
%b = trunc <4 x i32> %x to <4 x i16>
call void @llvm.masked.store.v4i16.p0v4i16(<4 x i16> %b, <4 x i16>* %p, i32 1, <4 x i1> %a)
ret void
}
define void @truncstore_v4i32_v4i8(<4 x i32> %x, <4 x i8>* %p, <4 x i32> %mask) {
; AVX512F-LABEL: truncstore_v4i32_v4i8:
; AVX512F: # %bb.0:
; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB14_2
; AVX512F-NEXT: # %bb.1: # %cond.store
; AVX512F-NEXT: vpextrb $0, %xmm0, (%rdi)
; AVX512F-NEXT: .LBB14_2: # %else
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $1, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB14_4
; AVX512F-NEXT: # %bb.3: # %cond.store1
; AVX512F-NEXT: vpextrb $4, %xmm0, 1(%rdi)
; AVX512F-NEXT: .LBB14_4: # %else2
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $2, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB14_6
; AVX512F-NEXT: # %bb.5: # %cond.store3
; AVX512F-NEXT: vpextrb $8, %xmm0, 2(%rdi)
; AVX512F-NEXT: .LBB14_6: # %else4
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $3, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB14_8
; AVX512F-NEXT: # %bb.7: # %cond.store5
; AVX512F-NEXT: vpextrb $12, %xmm0, 3(%rdi)
; AVX512F-NEXT: .LBB14_8: # %else6
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v4i32_v4i8:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512BW-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512BW-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,4,8,12,u,u,u,u,u,u,u,u,u,u,u,u]
; AVX512BW-NEXT: kshiftlq $60, %k0, %k0
; AVX512BW-NEXT: kshiftrq $60, %k0, %k1
; AVX512BW-NEXT: vmovdqu8 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512BWVL-LABEL: truncstore_v4i32_v4i8:
; AVX512BWVL: # %bb.0:
; AVX512BWVL-NEXT: vptestmd %xmm1, %xmm1, %k1
; AVX512BWVL-NEXT: vpmovdb %xmm0, (%rdi) {%k1}
; AVX512BWVL-NEXT: retq
%a = icmp ne <4 x i32> %mask, zeroinitializer
%b = trunc <4 x i32> %x to <4 x i8>
call void @llvm.masked.store.v4i8.p0v4i8(<4 x i8> %b, <4 x i8>* %p, i32 1, <4 x i1> %a)
ret void
}
define void @truncstore_v32i16_v32i8(<32 x i16> %x, <32 x i8>* %p, <32 x i8> %mask) {
; AVX512F-LABEL: truncstore_v32i16_v32i8:
; AVX512F: # %bb.0:
; AVX512F-NEXT: vpxor %xmm3, %xmm3, %xmm3
; AVX512F-NEXT: vpcmpeqb %ymm3, %ymm2, %ymm3
; AVX512F-NEXT: vmovdqa64 %zmm3, %zmm4
; AVX512F-NEXT: vpternlogq $15, %zmm3, %zmm3, %zmm4
; AVX512F-NEXT: vpmovsxbd %xmm4, %zmm4
; AVX512F-NEXT: vptestmd %zmm4, %zmm4, %k0
; AVX512F-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
; AVX512F-NEXT: vpmovdb %zmm0, %xmm0
; AVX512F-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
; AVX512F-NEXT: vpmovdb %zmm1, %xmm1
; AVX512F-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_2
; AVX512F-NEXT: # %bb.1: # %cond.store
; AVX512F-NEXT: vpextrb $0, %xmm0, (%rdi)
; AVX512F-NEXT: .LBB15_2: # %else
; AVX512F-NEXT: vpternlogq $15, %zmm3, %zmm3, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $1, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_4
; AVX512F-NEXT: # %bb.3: # %cond.store1
; AVX512F-NEXT: vpextrb $1, %xmm0, 1(%rdi)
; AVX512F-NEXT: .LBB15_4: # %else2
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $2, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_6
; AVX512F-NEXT: # %bb.5: # %cond.store3
; AVX512F-NEXT: vpextrb $2, %xmm0, 2(%rdi)
; AVX512F-NEXT: .LBB15_6: # %else4
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $3, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_8
; AVX512F-NEXT: # %bb.7: # %cond.store5
; AVX512F-NEXT: vpextrb $3, %xmm0, 3(%rdi)
; AVX512F-NEXT: .LBB15_8: # %else6
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $4, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_10
; AVX512F-NEXT: # %bb.9: # %cond.store7
; AVX512F-NEXT: vpextrb $4, %xmm0, 4(%rdi)
; AVX512F-NEXT: .LBB15_10: # %else8
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $5, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_12
; AVX512F-NEXT: # %bb.11: # %cond.store9
; AVX512F-NEXT: vpextrb $5, %xmm0, 5(%rdi)
; AVX512F-NEXT: .LBB15_12: # %else10
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $6, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_14
; AVX512F-NEXT: # %bb.13: # %cond.store11
; AVX512F-NEXT: vpextrb $6, %xmm0, 6(%rdi)
; AVX512F-NEXT: .LBB15_14: # %else12
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $7, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_16
; AVX512F-NEXT: # %bb.15: # %cond.store13
; AVX512F-NEXT: vpextrb $7, %xmm0, 7(%rdi)
; AVX512F-NEXT: .LBB15_16: # %else14
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $8, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_18
; AVX512F-NEXT: # %bb.17: # %cond.store15
; AVX512F-NEXT: vpextrb $8, %xmm0, 8(%rdi)
; AVX512F-NEXT: .LBB15_18: # %else16
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $9, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_20
; AVX512F-NEXT: # %bb.19: # %cond.store17
; AVX512F-NEXT: vpextrb $9, %xmm0, 9(%rdi)
; AVX512F-NEXT: .LBB15_20: # %else18
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $10, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_22
; AVX512F-NEXT: # %bb.21: # %cond.store19
; AVX512F-NEXT: vpextrb $10, %xmm0, 10(%rdi)
; AVX512F-NEXT: .LBB15_22: # %else20
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $11, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_24
; AVX512F-NEXT: # %bb.23: # %cond.store21
; AVX512F-NEXT: vpextrb $11, %xmm0, 11(%rdi)
; AVX512F-NEXT: .LBB15_24: # %else22
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $12, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_26
; AVX512F-NEXT: # %bb.25: # %cond.store23
; AVX512F-NEXT: vpextrb $12, %xmm0, 12(%rdi)
; AVX512F-NEXT: .LBB15_26: # %else24
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $13, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_28
; AVX512F-NEXT: # %bb.27: # %cond.store25
; AVX512F-NEXT: vpextrb $13, %xmm0, 13(%rdi)
; AVX512F-NEXT: .LBB15_28: # %else26
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $14, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_30
; AVX512F-NEXT: # %bb.29: # %cond.store27
; AVX512F-NEXT: vpextrb $14, %xmm0, 14(%rdi)
; AVX512F-NEXT: .LBB15_30: # %else28
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $15, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_32
; AVX512F-NEXT: # %bb.31: # %cond.store29
; AVX512F-NEXT: vpextrb $15, %xmm0, 15(%rdi)
; AVX512F-NEXT: .LBB15_32: # %else30
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_34
; AVX512F-NEXT: # %bb.33: # %cond.store31
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm3
; AVX512F-NEXT: vpextrb $0, %xmm3, 16(%rdi)
; AVX512F-NEXT: .LBB15_34: # %else32
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $1, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_36
; AVX512F-NEXT: # %bb.35: # %cond.store33
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
; AVX512F-NEXT: vpextrb $1, %xmm1, 17(%rdi)
; AVX512F-NEXT: .LBB15_36: # %else34
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $2, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_38
; AVX512F-NEXT: # %bb.37: # %cond.store35
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm3
; AVX512F-NEXT: vpextrb $2, %xmm3, 18(%rdi)
; AVX512F-NEXT: .LBB15_38: # %else36
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $3, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_40
; AVX512F-NEXT: # %bb.39: # %cond.store37
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
; AVX512F-NEXT: vpextrb $3, %xmm1, 19(%rdi)
; AVX512F-NEXT: .LBB15_40: # %else38
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $4, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_42
; AVX512F-NEXT: # %bb.41: # %cond.store39
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm3
; AVX512F-NEXT: vpextrb $4, %xmm3, 20(%rdi)
; AVX512F-NEXT: .LBB15_42: # %else40
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $5, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_44
; AVX512F-NEXT: # %bb.43: # %cond.store41
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
; AVX512F-NEXT: vpextrb $5, %xmm1, 21(%rdi)
; AVX512F-NEXT: .LBB15_44: # %else42
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $6, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_46
; AVX512F-NEXT: # %bb.45: # %cond.store43
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm3
; AVX512F-NEXT: vpextrb $6, %xmm3, 22(%rdi)
; AVX512F-NEXT: .LBB15_46: # %else44
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $7, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_48
; AVX512F-NEXT: # %bb.47: # %cond.store45
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
; AVX512F-NEXT: vpextrb $7, %xmm1, 23(%rdi)
; AVX512F-NEXT: .LBB15_48: # %else46
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $8, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_50
; AVX512F-NEXT: # %bb.49: # %cond.store47
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm3
; AVX512F-NEXT: vpextrb $8, %xmm3, 24(%rdi)
; AVX512F-NEXT: .LBB15_50: # %else48
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $9, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_52
; AVX512F-NEXT: # %bb.51: # %cond.store49
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
; AVX512F-NEXT: vpextrb $9, %xmm1, 25(%rdi)
; AVX512F-NEXT: .LBB15_52: # %else50
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $10, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_54
; AVX512F-NEXT: # %bb.53: # %cond.store51
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm3
; AVX512F-NEXT: vpextrb $10, %xmm3, 26(%rdi)
; AVX512F-NEXT: .LBB15_54: # %else52
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $11, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_56
; AVX512F-NEXT: # %bb.55: # %cond.store53
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
; AVX512F-NEXT: vpextrb $11, %xmm1, 27(%rdi)
; AVX512F-NEXT: .LBB15_56: # %else54
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $12, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_58
; AVX512F-NEXT: # %bb.57: # %cond.store55
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm3
; AVX512F-NEXT: vpextrb $12, %xmm3, 28(%rdi)
; AVX512F-NEXT: .LBB15_58: # %else56
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $13, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_60
; AVX512F-NEXT: # %bb.59: # %cond.store57
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
; AVX512F-NEXT: vpextrb $13, %xmm1, 29(%rdi)
; AVX512F-NEXT: .LBB15_60: # %else58
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm2
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm2
; AVX512F-NEXT: vpmovsxbd %xmm2, %zmm2
; AVX512F-NEXT: vptestmd %zmm2, %zmm2, %k0
; AVX512F-NEXT: kshiftrw $14, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_62
; AVX512F-NEXT: # %bb.61: # %cond.store59
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm2
; AVX512F-NEXT: vpextrb $14, %xmm2, 30(%rdi)
; AVX512F-NEXT: .LBB15_62: # %else60
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $15, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB15_64
; AVX512F-NEXT: # %bb.63: # %cond.store61
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm0
; AVX512F-NEXT: vpextrb $15, %xmm0, 31(%rdi)
; AVX512F-NEXT: .LBB15_64: # %else62
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v32i16_v32i8:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
; AVX512BW-NEXT: vptestmb %zmm1, %zmm1, %k0
; AVX512BW-NEXT: kmovd %k0, %k1
; AVX512BW-NEXT: vpmovwb %zmm0, %ymm0
; AVX512BW-NEXT: vmovdqu8 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512BWVL-LABEL: truncstore_v32i16_v32i8:
; AVX512BWVL: # %bb.0:
; AVX512BWVL-NEXT: vptestmb %ymm1, %ymm1, %k1
; AVX512BWVL-NEXT: vpmovwb %zmm0, %ymm0
; AVX512BWVL-NEXT: vmovdqu8 %ymm0, (%rdi) {%k1}
; AVX512BWVL-NEXT: vzeroupper
; AVX512BWVL-NEXT: retq
%a = icmp ne <32 x i8> %mask, zeroinitializer
%b = trunc <32 x i16> %x to <32 x i8>
call void @llvm.masked.store.v32i8.p0v32i8(<32 x i8> %b, <32 x i8>* %p, i32 1, <32 x i1> %a)
ret void
}
define void @truncstore_v16i16_v16i8(<16 x i16> %x, <16 x i8>* %p, <16 x i8> %mask) {
; AVX512F-LABEL: truncstore_v16i16_v16i8:
; AVX512F: # %bb.0:
; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
; AVX512F-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm2
; AVX512F-NEXT: vmovdqa64 %zmm2, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-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
; AVX512F-NEXT: vpmovdb %zmm0, %xmm0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_2
; AVX512F-NEXT: # %bb.1: # %cond.store
; AVX512F-NEXT: vpextrb $0, %xmm0, (%rdi)
; AVX512F-NEXT: .LBB16_2: # %else
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm2
; AVX512F-NEXT: vpmovsxbd %xmm2, %zmm2
; AVX512F-NEXT: vptestmd %zmm2, %zmm2, %k0
; AVX512F-NEXT: kshiftrw $1, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_4
; AVX512F-NEXT: # %bb.3: # %cond.store1
; AVX512F-NEXT: vpextrb $1, %xmm0, 1(%rdi)
; AVX512F-NEXT: .LBB16_4: # %else2
; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
; AVX512F-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm2
; AVX512F-NEXT: vmovdqa64 %zmm2, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $2, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_6
; AVX512F-NEXT: # %bb.5: # %cond.store3
; AVX512F-NEXT: vpextrb $2, %xmm0, 2(%rdi)
; AVX512F-NEXT: .LBB16_6: # %else4
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm2
; AVX512F-NEXT: vpmovsxbd %xmm2, %zmm2
; AVX512F-NEXT: vptestmd %zmm2, %zmm2, %k0
; AVX512F-NEXT: kshiftrw $3, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_8
; AVX512F-NEXT: # %bb.7: # %cond.store5
; AVX512F-NEXT: vpextrb $3, %xmm0, 3(%rdi)
; AVX512F-NEXT: .LBB16_8: # %else6
; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
; AVX512F-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm2
; AVX512F-NEXT: vmovdqa64 %zmm2, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $4, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_10
; AVX512F-NEXT: # %bb.9: # %cond.store7
; AVX512F-NEXT: vpextrb $4, %xmm0, 4(%rdi)
; AVX512F-NEXT: .LBB16_10: # %else8
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm2
; AVX512F-NEXT: vpmovsxbd %xmm2, %zmm2
; AVX512F-NEXT: vptestmd %zmm2, %zmm2, %k0
; AVX512F-NEXT: kshiftrw $5, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_12
; AVX512F-NEXT: # %bb.11: # %cond.store9
; AVX512F-NEXT: vpextrb $5, %xmm0, 5(%rdi)
; AVX512F-NEXT: .LBB16_12: # %else10
; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
; AVX512F-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm2
; AVX512F-NEXT: vmovdqa64 %zmm2, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $6, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_14
; AVX512F-NEXT: # %bb.13: # %cond.store11
; AVX512F-NEXT: vpextrb $6, %xmm0, 6(%rdi)
; AVX512F-NEXT: .LBB16_14: # %else12
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm2
; AVX512F-NEXT: vpmovsxbd %xmm2, %zmm2
; AVX512F-NEXT: vptestmd %zmm2, %zmm2, %k0
; AVX512F-NEXT: kshiftrw $7, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_16
; AVX512F-NEXT: # %bb.15: # %cond.store13
; AVX512F-NEXT: vpextrb $7, %xmm0, 7(%rdi)
; AVX512F-NEXT: .LBB16_16: # %else14
; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
; AVX512F-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm2
; AVX512F-NEXT: vmovdqa64 %zmm2, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $8, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_18
; AVX512F-NEXT: # %bb.17: # %cond.store15
; AVX512F-NEXT: vpextrb $8, %xmm0, 8(%rdi)
; AVX512F-NEXT: .LBB16_18: # %else16
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm2
; AVX512F-NEXT: vpmovsxbd %xmm2, %zmm2
; AVX512F-NEXT: vptestmd %zmm2, %zmm2, %k0
; AVX512F-NEXT: kshiftrw $9, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_20
; AVX512F-NEXT: # %bb.19: # %cond.store17
; AVX512F-NEXT: vpextrb $9, %xmm0, 9(%rdi)
; AVX512F-NEXT: .LBB16_20: # %else18
; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
; AVX512F-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm2
; AVX512F-NEXT: vmovdqa64 %zmm2, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $10, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_22
; AVX512F-NEXT: # %bb.21: # %cond.store19
; AVX512F-NEXT: vpextrb $10, %xmm0, 10(%rdi)
; AVX512F-NEXT: .LBB16_22: # %else20
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm2
; AVX512F-NEXT: vpmovsxbd %xmm2, %zmm2
; AVX512F-NEXT: vptestmd %zmm2, %zmm2, %k0
; AVX512F-NEXT: kshiftrw $11, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_24
; AVX512F-NEXT: # %bb.23: # %cond.store21
; AVX512F-NEXT: vpextrb $11, %xmm0, 11(%rdi)
; AVX512F-NEXT: .LBB16_24: # %else22
; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
; AVX512F-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm2
; AVX512F-NEXT: vmovdqa64 %zmm2, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm3
; AVX512F-NEXT: vpmovsxbd %xmm3, %zmm3
; AVX512F-NEXT: vptestmd %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $12, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_26
; AVX512F-NEXT: # %bb.25: # %cond.store23
; AVX512F-NEXT: vpextrb $12, %xmm0, 12(%rdi)
; AVX512F-NEXT: .LBB16_26: # %else24
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm2
; AVX512F-NEXT: vpmovsxbd %xmm2, %zmm2
; AVX512F-NEXT: vptestmd %zmm2, %zmm2, %k0
; AVX512F-NEXT: kshiftrw $13, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_28
; AVX512F-NEXT: # %bb.27: # %cond.store25
; AVX512F-NEXT: vpextrb $13, %xmm0, 13(%rdi)
; AVX512F-NEXT: .LBB16_28: # %else26
; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
; AVX512F-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm2
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm2
; AVX512F-NEXT: vpmovsxbd %xmm2, %zmm2
; AVX512F-NEXT: vptestmd %zmm2, %zmm2, %k0
; AVX512F-NEXT: kshiftrw $14, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_30
; AVX512F-NEXT: # %bb.29: # %cond.store27
; AVX512F-NEXT: vpextrb $14, %xmm0, 14(%rdi)
; AVX512F-NEXT: .LBB16_30: # %else28
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $15, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB16_32
; AVX512F-NEXT: # %bb.31: # %cond.store29
; AVX512F-NEXT: vpextrb $15, %xmm0, 15(%rdi)
; AVX512F-NEXT: .LBB16_32: # %else30
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v16i16_v16i8:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
; AVX512BW-NEXT: vptestmb %zmm1, %zmm1, %k0
; AVX512BW-NEXT: kmovw %k0, %k1
; AVX512BW-NEXT: vpmovwb %zmm0, %ymm0
; AVX512BW-NEXT: vmovdqu8 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512BWVL-LABEL: truncstore_v16i16_v16i8:
; AVX512BWVL: # %bb.0:
; AVX512BWVL-NEXT: vptestmb %xmm1, %xmm1, %k1
; AVX512BWVL-NEXT: vpmovwb %ymm0, %xmm0
; AVX512BWVL-NEXT: vmovdqu8 %xmm0, (%rdi) {%k1}
; AVX512BWVL-NEXT: vzeroupper
; AVX512BWVL-NEXT: retq
%a = icmp ne <16 x i8> %mask, zeroinitializer
%b = trunc <16 x i16> %x to <16 x i8>
call void @llvm.masked.store.v16i8.p0v16i8(<16 x i8> %b, <16 x i8>* %p, i32 1, <16 x i1> %a)
ret void
}
define void @truncstore_v8i16_v8i8(<8 x i16> %x, <8 x i8>* %p, <8 x i16> %mask) {
; AVX512F-LABEL: truncstore_v8i16_v8i8:
; AVX512F: # %bb.0:
; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
; AVX512F-NEXT: vpcmpeqw %xmm2, %xmm1, %xmm2
; AVX512F-NEXT: vmovdqa64 %zmm2, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm3
; AVX512F-NEXT: vpmovsxwq %xmm3, %zmm3
; AVX512F-NEXT: vptestmq %zmm3, %zmm3, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB17_2
; AVX512F-NEXT: # %bb.1: # %cond.store
; AVX512F-NEXT: vpextrb $0, %xmm0, (%rdi)
; AVX512F-NEXT: .LBB17_2: # %else
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm2
; AVX512F-NEXT: vpmovsxwq %xmm2, %zmm2
; AVX512F-NEXT: vptestmq %zmm2, %zmm2, %k0
; AVX512F-NEXT: kshiftrw $1, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB17_4
; AVX512F-NEXT: # %bb.3: # %cond.store1
; AVX512F-NEXT: vpextrb $2, %xmm0, 1(%rdi)
; AVX512F-NEXT: .LBB17_4: # %else2
; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
; AVX512F-NEXT: vpcmpeqw %xmm2, %xmm1, %xmm2
; AVX512F-NEXT: vmovdqa64 %zmm2, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm3
; AVX512F-NEXT: vpmovsxwq %xmm3, %zmm3
; AVX512F-NEXT: vptestmq %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $2, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB17_6
; AVX512F-NEXT: # %bb.5: # %cond.store3
; AVX512F-NEXT: vpextrb $4, %xmm0, 2(%rdi)
; AVX512F-NEXT: .LBB17_6: # %else4
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm2
; AVX512F-NEXT: vpmovsxwq %xmm2, %zmm2
; AVX512F-NEXT: vptestmq %zmm2, %zmm2, %k0
; AVX512F-NEXT: kshiftrw $3, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB17_8
; AVX512F-NEXT: # %bb.7: # %cond.store5
; AVX512F-NEXT: vpextrb $6, %xmm0, 3(%rdi)
; AVX512F-NEXT: .LBB17_8: # %else6
; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
; AVX512F-NEXT: vpcmpeqw %xmm2, %xmm1, %xmm2
; AVX512F-NEXT: vmovdqa64 %zmm2, %zmm3
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm3
; AVX512F-NEXT: vpmovsxwq %xmm3, %zmm3
; AVX512F-NEXT: vptestmq %zmm3, %zmm3, %k0
; AVX512F-NEXT: kshiftrw $4, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB17_10
; AVX512F-NEXT: # %bb.9: # %cond.store7
; AVX512F-NEXT: vpextrb $8, %xmm0, 4(%rdi)
; AVX512F-NEXT: .LBB17_10: # %else8
; AVX512F-NEXT: vpternlogq $15, %zmm2, %zmm2, %zmm2
; AVX512F-NEXT: vpmovsxwq %xmm2, %zmm2
; AVX512F-NEXT: vptestmq %zmm2, %zmm2, %k0
; AVX512F-NEXT: kshiftrw $5, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB17_12
; AVX512F-NEXT: # %bb.11: # %cond.store9
; AVX512F-NEXT: vpextrb $10, %xmm0, 5(%rdi)
; AVX512F-NEXT: .LBB17_12: # %else10
; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
; AVX512F-NEXT: vpcmpeqw %xmm2, %xmm1, %xmm1
; AVX512F-NEXT: vmovdqa64 %zmm1, %zmm2
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm2
; AVX512F-NEXT: vpmovsxwq %xmm2, %zmm2
; AVX512F-NEXT: vptestmq %zmm2, %zmm2, %k0
; AVX512F-NEXT: kshiftrw $6, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB17_14
; AVX512F-NEXT: # %bb.13: # %cond.store11
; AVX512F-NEXT: vpextrb $12, %xmm0, 6(%rdi)
; AVX512F-NEXT: .LBB17_14: # %else12
; AVX512F-NEXT: vpternlogq $15, %zmm1, %zmm1, %zmm1
; AVX512F-NEXT: vpmovsxwq %xmm1, %zmm1
; AVX512F-NEXT: vptestmq %zmm1, %zmm1, %k0
; AVX512F-NEXT: kshiftrw $7, %k0, %k0
; AVX512F-NEXT: kmovw %k0, %eax
; AVX512F-NEXT: testb $1, %al
; AVX512F-NEXT: je .LBB17_16
; AVX512F-NEXT: # %bb.15: # %cond.store13
; AVX512F-NEXT: vpextrb $14, %xmm0, 7(%rdi)
; AVX512F-NEXT: .LBB17_16: # %else14
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: truncstore_v8i16_v8i8:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; AVX512BW-NEXT: vptestmw %zmm1, %zmm1, %k0
; AVX512BW-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,2,4,6,8,10,12,14,u,u,u,u,u,u,u,u]
; AVX512BW-NEXT: kshiftlq $56, %k0, %k0
; AVX512BW-NEXT: kshiftrq $56, %k0, %k1
; AVX512BW-NEXT: vmovdqu8 %zmm0, (%rdi) {%k1}
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512BWVL-LABEL: truncstore_v8i16_v8i8:
; AVX512BWVL: # %bb.0:
; AVX512BWVL-NEXT: vptestmw %xmm1, %xmm1, %k1
; AVX512BWVL-NEXT: vpmovwb %xmm0, (%rdi) {%k1}
; AVX512BWVL-NEXT: retq
%a = icmp ne <8 x i16> %mask, zeroinitializer
%b = trunc <8 x i16> %x to <8 x i8>
call void @llvm.masked.store.v8i8.p0v8i8(<8 x i8> %b, <8 x i8>* %p, i32 1, <8 x i1> %a)
ret void
}
declare void @llvm.masked.store.v8i32.p0v8i32(<8 x i32>, <8 x i32>*, i32, <8 x i1>)
declare void @llvm.masked.store.v8i16.p0v8i16(<8 x i16>, <8 x i16>*, i32, <8 x i1>)
declare void @llvm.masked.store.v8i8.p0v8i8(<8 x i8>, <8 x i8>*, i32, <8 x i1>)
declare void @llvm.masked.store.v4i32.p0v4i32(<4 x i32>, <4 x i32>*, i32, <4 x i1>)
declare void @llvm.masked.store.v4i16.p0v4i16(<4 x i16>, <4 x i16>*, i32, <4 x i1>)
declare void @llvm.masked.store.v4i8.p0v4i8(<4 x i8>, <4 x i8>*, i32, <4 x i1>)
declare void @llvm.masked.store.v2i32.p0v2i32(<2 x i32>, <2 x i32>*, i32, <2 x i1>)
declare void @llvm.masked.store.v2i16.p0v2i16(<2 x i16>, <2 x i16>*, i32, <2 x i1>)
declare void @llvm.masked.store.v2i8.p0v2i8(<2 x i8>, <2 x i8>*, i32, <2 x i1>)
declare void @llvm.masked.store.v16i16.p0v16i16(<16 x i16>, <16 x i16>*, i32, <16 x i1>)
declare void @llvm.masked.store.v16i8.p0v16i8(<16 x i8>, <16 x i8>*, i32, <16 x i1>)
declare void @llvm.masked.store.v32i8.p0v32i8(<32 x i8>, <32 x i8>*, i32, <32 x i1>)