2018-02-11 16:06:27 +08:00
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2019-09-07 05:49:01 +08:00
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=fast-variable-shuffle,avx512vl,avx512bw,avx512dq,prefer-256-bit | FileCheck %s --check-prefixes=CHECK,CHECK-AVX512
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=fast-variable-shuffle,avx512vl,avx512bw,avx512dq,prefer-256-bit,avx512vbmi | FileCheck %s --check-prefixes=CHECK,CHECK-VBMI
2019-09-12 07:54:36 +08:00
; Make sure CPUs default to prefer-256-bit. avx512vnni isn't interesting as it just adds an isel peephole for vpmaddwd+vpaddd
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=skylake-avx512 | FileCheck %s --check-prefixes=CHECK,CHECK-AVX512
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=-avx512vnni -mcpu=cascadelake | FileCheck %s --check-prefixes=CHECK,CHECK-AVX512
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=-avx512vnni -mcpu=cooperlake | FileCheck %s --check-prefixes=CHECK,CHECK-AVX512
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=cannonlake | FileCheck %s --check-prefixes=CHECK,CHECK-VBMI
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=-avx512vnni -mcpu=icelake-client | FileCheck %s --check-prefixes=CHECK,CHECK-VBMI
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=-avx512vnni -mcpu=icelake-server | FileCheck %s --check-prefixes=CHECK,CHECK-VBMI
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=-avx512vnni -mcpu=tigerlake | FileCheck %s --check-prefixes=CHECK,CHECK-VBMI
2018-02-11 16:06:27 +08:00
; This file primarily contains tests for specific places in X86ISelLowering.cpp that needed be made aware of the legalizer not allowing 512-bit vectors due to prefer-256-bit even though AVX512 is enabled.
2018-10-26 05:16:06 +08:00
define void @add256 ( < 16 x i32 > * %a , < 16 x i32 > * %b , < 16 x i32 > * %c ) "min-legal-vector-width" = "256" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: add256:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa (%rdi), %ymm0
; CHECK-NEXT: vmovdqa 32(%rdi), %ymm1
; CHECK-NEXT: vpaddd 32(%rsi), %ymm1, %ymm1
[DAGCombiner] If a TokenFactor would be merged into its user, consider the user later.
Summary:
A number of optimizations are inhibited by single-use TokenFactors not
being merged into the TokenFactor using it. This makes we consider if
we can do the merge immediately.
Most tests changes here are due to the change in visitation causing
minor reorderings and associated reassociation of paired memory
operations.
CodeGen tests with non-reordering changes:
X86/aligned-variadic.ll -- memory-based add folded into stored leaq
value.
X86/constant-combiners.ll -- Optimizes out overlap between stores.
X86/pr40631_deadstore_elision -- folds constant byte store into
preceding quad word constant store.
Reviewers: RKSimon, craig.topper, spatel, efriedma, courbet
Reviewed By: courbet
Subscribers: dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, eraman, hiraditya, kbarton, jrtc27, atanasyan, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59260
llvm-svn: 356068
2019-03-14 01:07:09 +08:00
; CHECK-NEXT: vpaddd (%rsi), %ymm0, %ymm0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vmovdqa %ymm0, (%rdx)
[DAGCombiner] If a TokenFactor would be merged into its user, consider the user later.
Summary:
A number of optimizations are inhibited by single-use TokenFactors not
being merged into the TokenFactor using it. This makes we consider if
we can do the merge immediately.
Most tests changes here are due to the change in visitation causing
minor reorderings and associated reassociation of paired memory
operations.
CodeGen tests with non-reordering changes:
X86/aligned-variadic.ll -- memory-based add folded into stored leaq
value.
X86/constant-combiners.ll -- Optimizes out overlap between stores.
X86/pr40631_deadstore_elision -- folds constant byte store into
preceding quad word constant store.
Reviewers: RKSimon, craig.topper, spatel, efriedma, courbet
Reviewed By: courbet
Subscribers: dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, eraman, hiraditya, kbarton, jrtc27, atanasyan, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59260
llvm-svn: 356068
2019-03-14 01:07:09 +08:00
; CHECK-NEXT: vmovdqa %ymm1, 32(%rdx)
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%d = load < 16 x i32 > , < 16 x i32 > * %a
%e = load < 16 x i32 > , < 16 x i32 > * %b
%f = add < 16 x i32 > %d , %e
store < 16 x i32 > %f , < 16 x i32 > * %c
ret void
}
2018-10-26 05:16:06 +08:00
define void @add512 ( < 16 x i32 > * %a , < 16 x i32 > * %b , < 16 x i32 > * %c ) "min-legal-vector-width" = "512" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: add512:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa64 (%rdi), %zmm0
; CHECK-NEXT: vpaddd (%rsi), %zmm0, %zmm0
; CHECK-NEXT: vmovdqa64 %zmm0, (%rdx)
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%d = load < 16 x i32 > , < 16 x i32 > * %a
%e = load < 16 x i32 > , < 16 x i32 > * %b
%f = add < 16 x i32 > %d , %e
store < 16 x i32 > %f , < 16 x i32 > * %c
ret void
}
2018-10-26 05:16:06 +08:00
define void @avg_v64i8_256 ( < 64 x i8 > * %a , < 64 x i8 > * %b ) "min-legal-vector-width" = "256" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: avg_v64i8_256:
; CHECK: # %bb.0:
2018-03-20 04:19:46 +08:00
; CHECK-NEXT: vmovdqa (%rsi), %ymm0
; CHECK-NEXT: vmovdqa 32(%rsi), %ymm1
; CHECK-NEXT: vpavgb (%rdi), %ymm0, %ymm0
; CHECK-NEXT: vpavgb 32(%rdi), %ymm1, %ymm1
2018-03-18 03:24:54 +08:00
; CHECK-NEXT: vmovdqu %ymm1, (%rax)
2018-03-20 04:19:46 +08:00
; CHECK-NEXT: vmovdqu %ymm0, (%rax)
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%1 = load < 64 x i8 > , < 64 x i8 > * %a
%2 = load < 64 x i8 > , < 64 x i8 > * %b
%3 = zext < 64 x i8 > %1 to < 64 x i32 >
%4 = zext < 64 x i8 > %2 to < 64 x i32 >
%5 = add nuw nsw < 64 x i32 > %3 , < i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 >
%6 = add nuw nsw < 64 x i32 > %5 , %4
%7 = lshr < 64 x i32 > %6 , < i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 >
%8 = trunc < 64 x i32 > %7 to < 64 x i8 >
store < 64 x i8 > %8 , < 64 x i8 > * undef , align 4
ret void
}
2018-10-26 05:16:06 +08:00
define void @avg_v64i8_512 ( < 64 x i8 > * %a , < 64 x i8 > * %b ) "min-legal-vector-width" = "512" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: avg_v64i8_512:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa64 (%rsi), %zmm0
; CHECK-NEXT: vpavgb (%rdi), %zmm0, %zmm0
; CHECK-NEXT: vmovdqu64 %zmm0, (%rax)
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%1 = load < 64 x i8 > , < 64 x i8 > * %a
%2 = load < 64 x i8 > , < 64 x i8 > * %b
%3 = zext < 64 x i8 > %1 to < 64 x i32 >
%4 = zext < 64 x i8 > %2 to < 64 x i32 >
%5 = add nuw nsw < 64 x i32 > %3 , < i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 >
%6 = add nuw nsw < 64 x i32 > %5 , %4
%7 = lshr < 64 x i32 > %6 , < i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 , i32 1 >
%8 = trunc < 64 x i32 > %7 to < 64 x i8 >
store < 64 x i8 > %8 , < 64 x i8 > * undef , align 4
ret void
}
2018-10-26 05:16:06 +08:00
define void @pmaddwd_32_256 ( < 32 x i16 > * %APtr , < 32 x i16 > * %BPtr , < 16 x i32 > * %CPtr ) "min-legal-vector-width" = "256" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: pmaddwd_32_256:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa (%rdi), %ymm0
; CHECK-NEXT: vmovdqa 32(%rdi), %ymm1
; CHECK-NEXT: vpmaddwd 32(%rsi), %ymm1, %ymm1
[DAGCombiner] If a TokenFactor would be merged into its user, consider the user later.
Summary:
A number of optimizations are inhibited by single-use TokenFactors not
being merged into the TokenFactor using it. This makes we consider if
we can do the merge immediately.
Most tests changes here are due to the change in visitation causing
minor reorderings and associated reassociation of paired memory
operations.
CodeGen tests with non-reordering changes:
X86/aligned-variadic.ll -- memory-based add folded into stored leaq
value.
X86/constant-combiners.ll -- Optimizes out overlap between stores.
X86/pr40631_deadstore_elision -- folds constant byte store into
preceding quad word constant store.
Reviewers: RKSimon, craig.topper, spatel, efriedma, courbet
Reviewed By: courbet
Subscribers: dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, eraman, hiraditya, kbarton, jrtc27, atanasyan, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59260
llvm-svn: 356068
2019-03-14 01:07:09 +08:00
; CHECK-NEXT: vpmaddwd (%rsi), %ymm0, %ymm0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vmovdqa %ymm0, (%rdx)
[DAGCombiner] If a TokenFactor would be merged into its user, consider the user later.
Summary:
A number of optimizations are inhibited by single-use TokenFactors not
being merged into the TokenFactor using it. This makes we consider if
we can do the merge immediately.
Most tests changes here are due to the change in visitation causing
minor reorderings and associated reassociation of paired memory
operations.
CodeGen tests with non-reordering changes:
X86/aligned-variadic.ll -- memory-based add folded into stored leaq
value.
X86/constant-combiners.ll -- Optimizes out overlap between stores.
X86/pr40631_deadstore_elision -- folds constant byte store into
preceding quad word constant store.
Reviewers: RKSimon, craig.topper, spatel, efriedma, courbet
Reviewed By: courbet
Subscribers: dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, eraman, hiraditya, kbarton, jrtc27, atanasyan, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59260
llvm-svn: 356068
2019-03-14 01:07:09 +08:00
; CHECK-NEXT: vmovdqa %ymm1, 32(%rdx)
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%A = load < 32 x i16 > , < 32 x i16 > * %APtr
%B = load < 32 x i16 > , < 32 x i16 > * %BPtr
%a = sext < 32 x i16 > %A to < 32 x i32 >
%b = sext < 32 x i16 > %B to < 32 x i32 >
%m = mul nsw < 32 x i32 > %a , %b
%odd = shufflevector < 32 x i32 > %m , < 32 x i32 > undef , < 16 x i32 > < i32 0 , i32 2 , i32 4 , i32 6 , i32 8 , i32 10 , i32 12 , i32 14 , i32 16 , i32 18 , i32 20 , i32 22 , i32 24 , i32 26 , i32 28 , i32 30 >
%even = shufflevector < 32 x i32 > %m , < 32 x i32 > undef , < 16 x i32 > < i32 1 , i32 3 , i32 5 , i32 7 , i32 9 , i32 11 , i32 13 , i32 15 , i32 17 , i32 19 , i32 21 , i32 23 , i32 25 , i32 27 , i32 29 , i32 31 >
%ret = add < 16 x i32 > %odd , %even
store < 16 x i32 > %ret , < 16 x i32 > * %CPtr
ret void
}
2018-10-26 05:16:06 +08:00
define void @pmaddwd_32_512 ( < 32 x i16 > * %APtr , < 32 x i16 > * %BPtr , < 16 x i32 > * %CPtr ) "min-legal-vector-width" = "512" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: pmaddwd_32_512:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa64 (%rdi), %zmm0
; CHECK-NEXT: vpmaddwd (%rsi), %zmm0, %zmm0
; CHECK-NEXT: vmovdqa64 %zmm0, (%rdx)
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%A = load < 32 x i16 > , < 32 x i16 > * %APtr
%B = load < 32 x i16 > , < 32 x i16 > * %BPtr
%a = sext < 32 x i16 > %A to < 32 x i32 >
%b = sext < 32 x i16 > %B to < 32 x i32 >
%m = mul nsw < 32 x i32 > %a , %b
%odd = shufflevector < 32 x i32 > %m , < 32 x i32 > undef , < 16 x i32 > < i32 0 , i32 2 , i32 4 , i32 6 , i32 8 , i32 10 , i32 12 , i32 14 , i32 16 , i32 18 , i32 20 , i32 22 , i32 24 , i32 26 , i32 28 , i32 30 >
%even = shufflevector < 32 x i32 > %m , < 32 x i32 > undef , < 16 x i32 > < i32 1 , i32 3 , i32 5 , i32 7 , i32 9 , i32 11 , i32 13 , i32 15 , i32 17 , i32 19 , i32 21 , i32 23 , i32 25 , i32 27 , i32 29 , i32 31 >
%ret = add < 16 x i32 > %odd , %even
store < 16 x i32 > %ret , < 16 x i32 > * %CPtr
ret void
}
2018-10-26 05:16:06 +08:00
define void @psubus_64i8_max_256 ( < 64 x i8 > * %xptr , < 64 x i8 > * %yptr , < 64 x i8 > * %zptr ) "min-legal-vector-width" = "256" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: psubus_64i8_max_256:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa (%rdi), %ymm0
; CHECK-NEXT: vmovdqa 32(%rdi), %ymm1
; CHECK-NEXT: vpsubusb 32(%rsi), %ymm1, %ymm1
[DAGCombiner] If a TokenFactor would be merged into its user, consider the user later.
Summary:
A number of optimizations are inhibited by single-use TokenFactors not
being merged into the TokenFactor using it. This makes we consider if
we can do the merge immediately.
Most tests changes here are due to the change in visitation causing
minor reorderings and associated reassociation of paired memory
operations.
CodeGen tests with non-reordering changes:
X86/aligned-variadic.ll -- memory-based add folded into stored leaq
value.
X86/constant-combiners.ll -- Optimizes out overlap between stores.
X86/pr40631_deadstore_elision -- folds constant byte store into
preceding quad word constant store.
Reviewers: RKSimon, craig.topper, spatel, efriedma, courbet
Reviewed By: courbet
Subscribers: dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, eraman, hiraditya, kbarton, jrtc27, atanasyan, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59260
llvm-svn: 356068
2019-03-14 01:07:09 +08:00
; CHECK-NEXT: vpsubusb (%rsi), %ymm0, %ymm0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vmovdqa %ymm0, (%rdx)
[DAGCombiner] If a TokenFactor would be merged into its user, consider the user later.
Summary:
A number of optimizations are inhibited by single-use TokenFactors not
being merged into the TokenFactor using it. This makes we consider if
we can do the merge immediately.
Most tests changes here are due to the change in visitation causing
minor reorderings and associated reassociation of paired memory
operations.
CodeGen tests with non-reordering changes:
X86/aligned-variadic.ll -- memory-based add folded into stored leaq
value.
X86/constant-combiners.ll -- Optimizes out overlap between stores.
X86/pr40631_deadstore_elision -- folds constant byte store into
preceding quad word constant store.
Reviewers: RKSimon, craig.topper, spatel, efriedma, courbet
Reviewed By: courbet
Subscribers: dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, eraman, hiraditya, kbarton, jrtc27, atanasyan, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59260
llvm-svn: 356068
2019-03-14 01:07:09 +08:00
; CHECK-NEXT: vmovdqa %ymm1, 32(%rdx)
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%x = load < 64 x i8 > , < 64 x i8 > * %xptr
%y = load < 64 x i8 > , < 64 x i8 > * %yptr
%cmp = icmp ult < 64 x i8 > %x , %y
%max = select < 64 x i1 > %cmp , < 64 x i8 > %y , < 64 x i8 > %x
%res = sub < 64 x i8 > %max , %y
store < 64 x i8 > %res , < 64 x i8 > * %zptr
ret void
}
2018-10-26 05:16:06 +08:00
define void @psubus_64i8_max_512 ( < 64 x i8 > * %xptr , < 64 x i8 > * %yptr , < 64 x i8 > * %zptr ) "min-legal-vector-width" = "512" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: psubus_64i8_max_512:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa64 (%rdi), %zmm0
; CHECK-NEXT: vpsubusb (%rsi), %zmm0, %zmm0
; CHECK-NEXT: vmovdqa64 %zmm0, (%rdx)
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%x = load < 64 x i8 > , < 64 x i8 > * %xptr
%y = load < 64 x i8 > , < 64 x i8 > * %yptr
%cmp = icmp ult < 64 x i8 > %x , %y
%max = select < 64 x i1 > %cmp , < 64 x i8 > %y , < 64 x i8 > %x
%res = sub < 64 x i8 > %max , %y
store < 64 x i8 > %res , < 64 x i8 > * %zptr
ret void
}
2018-10-26 05:16:06 +08:00
define i32 @_Z9test_charPcS_i_256 ( i8 * nocapture readonly , i8 * nocapture readonly , i32 ) "min-legal-vector-width" = "256" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: _Z9test_charPcS_i_256:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %edx, %eax
; CHECK-NEXT: vpxor %xmm0, %xmm0, %xmm0
; CHECK-NEXT: xorl %ecx, %ecx
; CHECK-NEXT: vpxor %xmm1, %xmm1, %xmm1
; CHECK-NEXT: vpxor %xmm2, %xmm2, %xmm2
; CHECK-NEXT: .p2align 4, 0x90
; CHECK-NEXT: .LBB8_1: # %vector.body
; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
2018-07-23 03:44:35 +08:00
; CHECK-NEXT: vpmovsxbw (%rdi,%rcx), %ymm3
; CHECK-NEXT: vpmovsxbw 16(%rdi,%rcx), %ymm4
; CHECK-NEXT: vpmovsxbw (%rsi,%rcx), %ymm5
; CHECK-NEXT: vpmaddwd %ymm3, %ymm5, %ymm3
; CHECK-NEXT: vpaddd %ymm1, %ymm3, %ymm1
; CHECK-NEXT: vpmovsxbw 16(%rsi,%rcx), %ymm3
; CHECK-NEXT: vpmaddwd %ymm4, %ymm3, %ymm3
; CHECK-NEXT: vpaddd %ymm2, %ymm3, %ymm2
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: addq $32, %rcx
; CHECK-NEXT: cmpq %rcx, %rax
; CHECK-NEXT: jne .LBB8_1
; CHECK-NEXT: # %bb.2: # %middle.block
2018-07-23 03:44:35 +08:00
; CHECK-NEXT: vpaddd %ymm0, %ymm1, %ymm1
; CHECK-NEXT: vpaddd %ymm0, %ymm2, %ymm0
; CHECK-NEXT: vpaddd %ymm0, %ymm1, %ymm0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vextracti128 $1, %ymm0, %xmm1
2019-01-25 23:37:42 +08:00
; CHECK-NEXT: vpaddd %xmm1, %xmm0, %xmm0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
2019-01-25 23:37:42 +08:00
; CHECK-NEXT: vpaddd %xmm1, %xmm0, %xmm0
[x86] add and use fast horizontal vector math subtarget feature
This is the planned follow-up to D52997. Here we are reducing horizontal vector math codegen
by default. AMD Jaguar (btver2) should have no difference with this patch because it has
fast-hops. (If we want to set that bit for other CPUs, let me know.)
The code changes are small, but there are many test diffs. For files that are specifically
testing for hops, I added RUNs to distinguish fast/slow, so we can see the consequences
side-by-side. For files that are primarily concerned with codegen other than hops, I just
updated the CHECK lines to reflect the new default codegen.
To recap the recent horizontal op story:
1. Before rL343727, we were producing hops for all subtargets for a variety of patterns.
Hops were likely not optimal for all targets though.
2. The IR improvement in r343727 exposed a hole in the backend hop pattern matching, so
we reduced hop codegen for all subtargets. That was bad for Jaguar (PR39195).
3. We restored the hop codegen for all targets with rL344141. Good for Jaguar, but
probably bad for other CPUs.
4. This patch allows us to distinguish when we want to produce hops, so everyone can be
happy. I'm not sure if we have the best predicate here, but the intent is to undo the
extra hop-iness that was enabled by r344141.
Differential Revision: https://reviews.llvm.org/D53095
llvm-svn: 344361
2018-10-13 00:41:02 +08:00
; CHECK-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
2018-10-30 22:14:34 +08:00
; CHECK-NEXT: vpaddd %xmm1, %xmm0, %xmm0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vmovd %xmm0, %eax
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
entry:
%3 = zext i32 %2 to i64
br label %vector.body
vector.body:
%index = phi i64 [ %index.next , %vector.body ] , [ 0 , %entry ]
%vec.phi = phi < 32 x i32 > [ %11 , %vector.body ] , [ zeroinitializer , %entry ]
%4 = getelementptr inbounds i8 , i8 * %0 , i64 %index
%5 = bitcast i8 * %4 to < 32 x i8 > *
%wide.load = load < 32 x i8 > , < 32 x i8 > * %5 , align 1
%6 = sext < 32 x i8 > %wide.load to < 32 x i32 >
%7 = getelementptr inbounds i8 , i8 * %1 , i64 %index
%8 = bitcast i8 * %7 to < 32 x i8 > *
%wide.load14 = load < 32 x i8 > , < 32 x i8 > * %8 , align 1
%9 = sext < 32 x i8 > %wide.load14 to < 32 x i32 >
%10 = mul nsw < 32 x i32 > %9 , %6
%11 = add nsw < 32 x i32 > %10 , %vec.phi
%index.next = add i64 %index , 32
%12 = icmp eq i64 %index.next , %3
br i1 %12 , label %middle.block , label %vector.body
middle.block:
%rdx.shuf1 = shufflevector < 32 x i32 > %11 , < 32 x i32 > undef , < 32 x i32 > < i32 16 , i32 17 , i32 18 , i32 19 , i32 20 , i32 21 , i32 22 , i32 23 , i32 24 , i32 25 , i32 26 , i32 27 , i32 28 , i32 29 , i32 30 , i32 31 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx1 = add < 32 x i32 > %11 , %rdx.shuf1
%rdx.shuf = shufflevector < 32 x i32 > %bin.rdx1 , < 32 x i32 > undef , < 32 x i32 > < i32 8 , i32 9 , i32 10 , i32 11 , i32 12 , i32 13 , i32 14 , i32 15 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx = add < 32 x i32 > %bin.rdx1 , %rdx.shuf
%rdx.shuf15 = shufflevector < 32 x i32 > %bin.rdx , < 32 x i32 > undef , < 32 x i32 > < i32 4 , i32 5 , i32 6 , i32 7 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx32 = add < 32 x i32 > %bin.rdx , %rdx.shuf15
%rdx.shuf17 = shufflevector < 32 x i32 > %bin.rdx32 , < 32 x i32 > undef , < 32 x i32 > < i32 2 , i32 3 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx18 = add < 32 x i32 > %bin.rdx32 , %rdx.shuf17
%rdx.shuf19 = shufflevector < 32 x i32 > %bin.rdx18 , < 32 x i32 > undef , < 32 x i32 > < i32 1 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx20 = add < 32 x i32 > %bin.rdx18 , %rdx.shuf19
%13 = extractelement < 32 x i32 > %bin.rdx20 , i32 0
ret i32 %13
}
2018-10-26 05:16:06 +08:00
define i32 @_Z9test_charPcS_i_512 ( i8 * nocapture readonly , i8 * nocapture readonly , i32 ) "min-legal-vector-width" = "512" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: _Z9test_charPcS_i_512:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %edx, %eax
; CHECK-NEXT: vpxor %xmm0, %xmm0, %xmm0
; CHECK-NEXT: xorl %ecx, %ecx
; CHECK-NEXT: vpxor %xmm1, %xmm1, %xmm1
; CHECK-NEXT: .p2align 4, 0x90
; CHECK-NEXT: .LBB9_1: # %vector.body
; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
; CHECK-NEXT: vpmovsxbw (%rdi,%rcx), %zmm2
; CHECK-NEXT: vpmovsxbw (%rsi,%rcx), %zmm3
; CHECK-NEXT: vpmaddwd %zmm2, %zmm3, %zmm2
; CHECK-NEXT: vpaddd %zmm1, %zmm2, %zmm1
; CHECK-NEXT: addq $32, %rcx
; CHECK-NEXT: cmpq %rcx, %rax
; CHECK-NEXT: jne .LBB9_1
; CHECK-NEXT: # %bb.2: # %middle.block
; CHECK-NEXT: vpaddd %zmm0, %zmm1, %zmm0
; CHECK-NEXT: vextracti64x4 $1, %zmm0, %ymm1
; CHECK-NEXT: vpaddd %zmm1, %zmm0, %zmm0
; CHECK-NEXT: vextracti128 $1, %ymm0, %xmm1
2019-01-30 03:13:39 +08:00
; CHECK-NEXT: vpaddd %xmm1, %xmm0, %xmm0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
2019-01-30 03:13:39 +08:00
; CHECK-NEXT: vpaddd %xmm1, %xmm0, %xmm0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
2018-10-30 22:14:34 +08:00
; CHECK-NEXT: vpaddd %xmm1, %xmm0, %xmm0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vmovd %xmm0, %eax
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
entry:
%3 = zext i32 %2 to i64
br label %vector.body
vector.body:
%index = phi i64 [ %index.next , %vector.body ] , [ 0 , %entry ]
%vec.phi = phi < 32 x i32 > [ %11 , %vector.body ] , [ zeroinitializer , %entry ]
%4 = getelementptr inbounds i8 , i8 * %0 , i64 %index
%5 = bitcast i8 * %4 to < 32 x i8 > *
%wide.load = load < 32 x i8 > , < 32 x i8 > * %5 , align 1
%6 = sext < 32 x i8 > %wide.load to < 32 x i32 >
%7 = getelementptr inbounds i8 , i8 * %1 , i64 %index
%8 = bitcast i8 * %7 to < 32 x i8 > *
%wide.load14 = load < 32 x i8 > , < 32 x i8 > * %8 , align 1
%9 = sext < 32 x i8 > %wide.load14 to < 32 x i32 >
%10 = mul nsw < 32 x i32 > %9 , %6
%11 = add nsw < 32 x i32 > %10 , %vec.phi
%index.next = add i64 %index , 32
%12 = icmp eq i64 %index.next , %3
br i1 %12 , label %middle.block , label %vector.body
middle.block:
%rdx.shuf1 = shufflevector < 32 x i32 > %11 , < 32 x i32 > undef , < 32 x i32 > < i32 16 , i32 17 , i32 18 , i32 19 , i32 20 , i32 21 , i32 22 , i32 23 , i32 24 , i32 25 , i32 26 , i32 27 , i32 28 , i32 29 , i32 30 , i32 31 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx1 = add < 32 x i32 > %11 , %rdx.shuf1
%rdx.shuf = shufflevector < 32 x i32 > %bin.rdx1 , < 32 x i32 > undef , < 32 x i32 > < i32 8 , i32 9 , i32 10 , i32 11 , i32 12 , i32 13 , i32 14 , i32 15 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx = add < 32 x i32 > %bin.rdx1 , %rdx.shuf
%rdx.shuf15 = shufflevector < 32 x i32 > %bin.rdx , < 32 x i32 > undef , < 32 x i32 > < i32 4 , i32 5 , i32 6 , i32 7 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx32 = add < 32 x i32 > %bin.rdx , %rdx.shuf15
%rdx.shuf17 = shufflevector < 32 x i32 > %bin.rdx32 , < 32 x i32 > undef , < 32 x i32 > < i32 2 , i32 3 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx18 = add < 32 x i32 > %bin.rdx32 , %rdx.shuf17
%rdx.shuf19 = shufflevector < 32 x i32 > %bin.rdx18 , < 32 x i32 > undef , < 32 x i32 > < i32 1 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx20 = add < 32 x i32 > %bin.rdx18 , %rdx.shuf19
%13 = extractelement < 32 x i32 > %bin.rdx20 , i32 0
ret i32 %13
}
@a = global [ 1024 x i8 ] zeroinitializer , align 16
@b = global [ 1024 x i8 ] zeroinitializer , align 16
2018-10-26 05:16:06 +08:00
define i32 @sad_16i8_256 ( ) "min-legal-vector-width" = "256" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: sad_16i8_256:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vpxor %xmm0, %xmm0, %xmm0
; CHECK-NEXT: movq $-1024, %rax # imm = 0xFC00
; CHECK-NEXT: vpxor %xmm1, %xmm1, %xmm1
; CHECK-NEXT: .p2align 4, 0x90
; CHECK-NEXT: .LBB10_1: # %vector.body
; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
; CHECK-NEXT: vmovdqu a+1024(%rax), %xmm2
; CHECK-NEXT: vpsadbw b+1024(%rax), %xmm2, %xmm2
; CHECK-NEXT: vpaddd %ymm1, %ymm2, %ymm1
; CHECK-NEXT: addq $4, %rax
; CHECK-NEXT: jne .LBB10_1
; CHECK-NEXT: # %bb.2: # %middle.block
; CHECK-NEXT: vpaddd %ymm0, %ymm1, %ymm0
; CHECK-NEXT: vextracti128 $1, %ymm0, %xmm1
2019-01-25 23:37:42 +08:00
; CHECK-NEXT: vpaddd %xmm1, %xmm0, %xmm0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
2019-01-25 23:37:42 +08:00
; CHECK-NEXT: vpaddd %xmm1, %xmm0, %xmm0
[x86] add and use fast horizontal vector math subtarget feature
This is the planned follow-up to D52997. Here we are reducing horizontal vector math codegen
by default. AMD Jaguar (btver2) should have no difference with this patch because it has
fast-hops. (If we want to set that bit for other CPUs, let me know.)
The code changes are small, but there are many test diffs. For files that are specifically
testing for hops, I added RUNs to distinguish fast/slow, so we can see the consequences
side-by-side. For files that are primarily concerned with codegen other than hops, I just
updated the CHECK lines to reflect the new default codegen.
To recap the recent horizontal op story:
1. Before rL343727, we were producing hops for all subtargets for a variety of patterns.
Hops were likely not optimal for all targets though.
2. The IR improvement in r343727 exposed a hole in the backend hop pattern matching, so
we reduced hop codegen for all subtargets. That was bad for Jaguar (PR39195).
3. We restored the hop codegen for all targets with rL344141. Good for Jaguar, but
probably bad for other CPUs.
4. This patch allows us to distinguish when we want to produce hops, so everyone can be
happy. I'm not sure if we have the best predicate here, but the intent is to undo the
extra hop-iness that was enabled by r344141.
Differential Revision: https://reviews.llvm.org/D53095
llvm-svn: 344361
2018-10-13 00:41:02 +08:00
; CHECK-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
2018-10-30 22:14:34 +08:00
; CHECK-NEXT: vpaddd %xmm1, %xmm0, %xmm0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vmovd %xmm0, %eax
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
entry:
br label %vector.body
vector.body:
%index = phi i64 [ 0 , %entry ] , [ %index.next , %vector.body ]
%vec.phi = phi < 16 x i32 > [ zeroinitializer , %entry ] , [ %10 , %vector.body ]
%0 = getelementptr inbounds [ 1024 x i8 ] , [ 1024 x i8 ] * @a , i64 0 , i64 %index
%1 = bitcast i8 * %0 to < 16 x i8 > *
%wide.load = load < 16 x i8 > , < 16 x i8 > * %1 , align 4
%2 = zext < 16 x i8 > %wide.load to < 16 x i32 >
%3 = getelementptr inbounds [ 1024 x i8 ] , [ 1024 x i8 ] * @b , i64 0 , i64 %index
%4 = bitcast i8 * %3 to < 16 x i8 > *
%wide.load1 = load < 16 x i8 > , < 16 x i8 > * %4 , align 4
%5 = zext < 16 x i8 > %wide.load1 to < 16 x i32 >
%6 = sub nsw < 16 x i32 > %2 , %5
%7 = icmp sgt < 16 x i32 > %6 , < i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 >
%8 = sub nsw < 16 x i32 > zeroinitializer , %6
%9 = select < 16 x i1 > %7 , < 16 x i32 > %6 , < 16 x i32 > %8
%10 = add nsw < 16 x i32 > %9 , %vec.phi
%index.next = add i64 %index , 4
%11 = icmp eq i64 %index.next , 1024
br i1 %11 , label %middle.block , label %vector.body
middle.block:
%.lcssa = phi < 16 x i32 > [ %10 , %vector.body ]
%rdx.shuf = shufflevector < 16 x i32 > %.lcssa , < 16 x i32 > undef , < 16 x i32 > < i32 8 , i32 9 , i32 10 , i32 11 , i32 12 , i32 13 , i32 14 , i32 15 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx = add < 16 x i32 > %.lcssa , %rdx.shuf
%rdx.shuf2 = shufflevector < 16 x i32 > %bin.rdx , < 16 x i32 > undef , < 16 x i32 > < i32 4 , i32 5 , i32 6 , i32 7 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx2 = add < 16 x i32 > %bin.rdx , %rdx.shuf2
%rdx.shuf3 = shufflevector < 16 x i32 > %bin.rdx2 , < 16 x i32 > undef , < 16 x i32 > < i32 2 , i32 3 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx3 = add < 16 x i32 > %bin.rdx2 , %rdx.shuf3
%rdx.shuf4 = shufflevector < 16 x i32 > %bin.rdx3 , < 16 x i32 > undef , < 16 x i32 > < i32 1 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx4 = add < 16 x i32 > %bin.rdx3 , %rdx.shuf4
%12 = extractelement < 16 x i32 > %bin.rdx4 , i32 0
ret i32 %12
}
2018-10-26 05:16:06 +08:00
define i32 @sad_16i8_512 ( ) "min-legal-vector-width" = "512" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: sad_16i8_512:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vpxor %xmm0, %xmm0, %xmm0
; CHECK-NEXT: movq $-1024, %rax # imm = 0xFC00
; CHECK-NEXT: .p2align 4, 0x90
; CHECK-NEXT: .LBB11_1: # %vector.body
; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
; CHECK-NEXT: vmovdqu a+1024(%rax), %xmm1
; CHECK-NEXT: vpsadbw b+1024(%rax), %xmm1, %xmm1
; CHECK-NEXT: vpaddd %zmm0, %zmm1, %zmm0
; CHECK-NEXT: addq $4, %rax
; CHECK-NEXT: jne .LBB11_1
; CHECK-NEXT: # %bb.2: # %middle.block
; CHECK-NEXT: vextracti64x4 $1, %zmm0, %ymm1
; CHECK-NEXT: vpaddd %zmm1, %zmm0, %zmm0
; CHECK-NEXT: vextracti128 $1, %ymm0, %xmm1
2019-01-30 03:13:39 +08:00
; CHECK-NEXT: vpaddd %xmm1, %xmm0, %xmm0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
2019-01-30 03:13:39 +08:00
; CHECK-NEXT: vpaddd %xmm1, %xmm0, %xmm0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
2018-10-30 22:14:34 +08:00
; CHECK-NEXT: vpaddd %xmm1, %xmm0, %xmm0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vmovd %xmm0, %eax
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
entry:
br label %vector.body
vector.body:
%index = phi i64 [ 0 , %entry ] , [ %index.next , %vector.body ]
%vec.phi = phi < 16 x i32 > [ zeroinitializer , %entry ] , [ %10 , %vector.body ]
%0 = getelementptr inbounds [ 1024 x i8 ] , [ 1024 x i8 ] * @a , i64 0 , i64 %index
%1 = bitcast i8 * %0 to < 16 x i8 > *
%wide.load = load < 16 x i8 > , < 16 x i8 > * %1 , align 4
%2 = zext < 16 x i8 > %wide.load to < 16 x i32 >
%3 = getelementptr inbounds [ 1024 x i8 ] , [ 1024 x i8 ] * @b , i64 0 , i64 %index
%4 = bitcast i8 * %3 to < 16 x i8 > *
%wide.load1 = load < 16 x i8 > , < 16 x i8 > * %4 , align 4
%5 = zext < 16 x i8 > %wide.load1 to < 16 x i32 >
%6 = sub nsw < 16 x i32 > %2 , %5
%7 = icmp sgt < 16 x i32 > %6 , < i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 , i32 -1 >
%8 = sub nsw < 16 x i32 > zeroinitializer , %6
%9 = select < 16 x i1 > %7 , < 16 x i32 > %6 , < 16 x i32 > %8
%10 = add nsw < 16 x i32 > %9 , %vec.phi
%index.next = add i64 %index , 4
%11 = icmp eq i64 %index.next , 1024
br i1 %11 , label %middle.block , label %vector.body
middle.block:
%.lcssa = phi < 16 x i32 > [ %10 , %vector.body ]
%rdx.shuf = shufflevector < 16 x i32 > %.lcssa , < 16 x i32 > undef , < 16 x i32 > < i32 8 , i32 9 , i32 10 , i32 11 , i32 12 , i32 13 , i32 14 , i32 15 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx = add < 16 x i32 > %.lcssa , %rdx.shuf
%rdx.shuf2 = shufflevector < 16 x i32 > %bin.rdx , < 16 x i32 > undef , < 16 x i32 > < i32 4 , i32 5 , i32 6 , i32 7 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx2 = add < 16 x i32 > %bin.rdx , %rdx.shuf2
%rdx.shuf3 = shufflevector < 16 x i32 > %bin.rdx2 , < 16 x i32 > undef , < 16 x i32 > < i32 2 , i32 3 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx3 = add < 16 x i32 > %bin.rdx2 , %rdx.shuf3
%rdx.shuf4 = shufflevector < 16 x i32 > %bin.rdx3 , < 16 x i32 > undef , < 16 x i32 > < i32 1 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
%bin.rdx4 = add < 16 x i32 > %bin.rdx3 , %rdx.shuf4
%12 = extractelement < 16 x i32 > %bin.rdx4 , i32 0
ret i32 %12
}
2018-10-26 05:16:06 +08:00
define void @sbto16f32_256 ( < 16 x i16 > %a , < 16 x float > * %res ) "min-legal-vector-width" = "256" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: sbto16f32_256:
; CHECK: # %bb.0:
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vpmovw2m %ymm0, %k0
; CHECK-NEXT: kshiftrw $8, %k0, %k1
; CHECK-NEXT: vpmovm2d %k1, %ymm0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vcvtdq2ps %ymm0, %ymm0
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vpmovm2d %k0, %ymm1
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vcvtdq2ps %ymm1, %ymm1
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vmovaps %ymm1, (%rdi)
; CHECK-NEXT: vmovaps %ymm0, 32(%rdi)
; CHECK-NEXT: vzeroupper
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: retq
2018-02-12 02:52:16 +08:00
%mask = icmp slt < 16 x i16 > %a , zeroinitializer
2018-02-11 16:06:27 +08:00
%1 = sitofp < 16 x i1 > %mask to < 16 x float >
2018-02-12 02:52:16 +08:00
store < 16 x float > %1 , < 16 x float > * %res
ret void
2018-02-11 16:06:27 +08:00
}
2018-10-26 05:16:06 +08:00
define void @sbto16f32_512 ( < 16 x i16 > %a , < 16 x float > * %res ) "min-legal-vector-width" = "512" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: sbto16f32_512:
; CHECK: # %bb.0:
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vpmovw2m %ymm0, %k0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vpmovm2d %k0, %zmm0
; CHECK-NEXT: vcvtdq2ps %zmm0, %zmm0
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vmovaps %zmm0, (%rdi)
; CHECK-NEXT: vzeroupper
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: retq
2018-02-12 02:52:16 +08:00
%mask = icmp slt < 16 x i16 > %a , zeroinitializer
2018-02-11 16:06:27 +08:00
%1 = sitofp < 16 x i1 > %mask to < 16 x float >
2018-02-12 02:52:16 +08:00
store < 16 x float > %1 , < 16 x float > * %res
ret void
2018-02-11 16:06:27 +08:00
}
2018-10-26 05:16:06 +08:00
define void @sbto16f64_256 ( < 16 x i16 > %a , < 16 x double > * %res ) "min-legal-vector-width" = "256" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: sbto16f64_256:
; CHECK: # %bb.0:
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vpmovw2m %ymm0, %k0
; CHECK-NEXT: kshiftrw $8, %k0, %k1
; CHECK-NEXT: vpmovm2d %k1, %ymm0
; CHECK-NEXT: vcvtdq2pd %xmm0, %ymm1
; CHECK-NEXT: vextracti128 $1, %ymm0, %xmm0
; CHECK-NEXT: vcvtdq2pd %xmm0, %ymm0
; CHECK-NEXT: vpmovm2d %k0, %ymm2
; CHECK-NEXT: vcvtdq2pd %xmm2, %ymm3
; CHECK-NEXT: vextracti128 $1, %ymm2, %xmm2
; CHECK-NEXT: vcvtdq2pd %xmm2, %ymm2
; CHECK-NEXT: vmovaps %ymm2, 32(%rdi)
; CHECK-NEXT: vmovaps %ymm3, (%rdi)
; CHECK-NEXT: vmovaps %ymm0, 96(%rdi)
; CHECK-NEXT: vmovaps %ymm1, 64(%rdi)
; CHECK-NEXT: vzeroupper
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: retq
2018-02-12 02:52:16 +08:00
%mask = icmp slt < 16 x i16 > %a , zeroinitializer
%1 = sitofp < 16 x i1 > %mask to < 16 x double >
store < 16 x double > %1 , < 16 x double > * %res
ret void
2018-02-11 16:06:27 +08:00
}
2018-10-26 05:16:06 +08:00
define void @sbto16f64_512 ( < 16 x i16 > %a , < 16 x double > * %res ) "min-legal-vector-width" = "512" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: sbto16f64_512:
; CHECK: # %bb.0:
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vpmovw2m %ymm0, %k0
; CHECK-NEXT: vpmovm2d %k0, %zmm0
; CHECK-NEXT: vcvtdq2pd %ymm0, %zmm1
; CHECK-NEXT: vextracti64x4 $1, %zmm0, %ymm0
; CHECK-NEXT: vcvtdq2pd %ymm0, %zmm0
; CHECK-NEXT: vmovaps %zmm0, 64(%rdi)
; CHECK-NEXT: vmovaps %zmm1, (%rdi)
; CHECK-NEXT: vzeroupper
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: retq
2018-02-12 02:52:16 +08:00
%mask = icmp slt < 16 x i16 > %a , zeroinitializer
%1 = sitofp < 16 x i1 > %mask to < 16 x double >
store < 16 x double > %1 , < 16 x double > * %res
ret void
2018-02-11 16:06:27 +08:00
}
2018-10-26 05:16:06 +08:00
define void @ubto16f32_256 ( < 16 x i16 > %a , < 16 x float > * %res ) "min-legal-vector-width" = "256" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: ubto16f32_256:
; CHECK: # %bb.0:
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vpmovw2m %ymm0, %k0
; CHECK-NEXT: kshiftrw $8, %k0, %k1
; CHECK-NEXT: vpmovm2d %k1, %ymm0
; CHECK-NEXT: vpsrld $31, %ymm0, %ymm0
; CHECK-NEXT: vcvtdq2ps %ymm0, %ymm0
; CHECK-NEXT: vpmovm2d %k0, %ymm1
; CHECK-NEXT: vpsrld $31, %ymm1, %ymm1
; CHECK-NEXT: vcvtdq2ps %ymm1, %ymm1
; CHECK-NEXT: vmovaps %ymm1, (%rdi)
; CHECK-NEXT: vmovaps %ymm0, 32(%rdi)
; CHECK-NEXT: vzeroupper
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: retq
2018-02-12 02:52:16 +08:00
%mask = icmp slt < 16 x i16 > %a , zeroinitializer
2018-02-11 16:06:27 +08:00
%1 = uitofp < 16 x i1 > %mask to < 16 x float >
2018-02-12 02:52:16 +08:00
store < 16 x float > %1 , < 16 x float > * %res
ret void
2018-02-11 16:06:27 +08:00
}
2018-10-26 05:16:06 +08:00
define void @ubto16f32_512 ( < 16 x i16 > %a , < 16 x float > * %res ) "min-legal-vector-width" = "512" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: ubto16f32_512:
; CHECK: # %bb.0:
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vpmovw2m %ymm0, %k0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vpmovm2d %k0, %zmm0
; CHECK-NEXT: vpsrld $31, %zmm0, %zmm0
; CHECK-NEXT: vcvtdq2ps %zmm0, %zmm0
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vmovaps %zmm0, (%rdi)
; CHECK-NEXT: vzeroupper
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: retq
2018-02-12 02:52:16 +08:00
%mask = icmp slt < 16 x i16 > %a , zeroinitializer
2018-02-11 16:06:27 +08:00
%1 = uitofp < 16 x i1 > %mask to < 16 x float >
2018-02-12 02:52:16 +08:00
store < 16 x float > %1 , < 16 x float > * %res
ret void
2018-02-11 16:06:27 +08:00
}
2018-10-26 05:16:06 +08:00
define void @ubto16f64_256 ( < 16 x i16 > %a , < 16 x double > * %res ) "min-legal-vector-width" = "256" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: ubto16f64_256:
; CHECK: # %bb.0:
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vpmovw2m %ymm0, %k0
; CHECK-NEXT: kshiftrw $8, %k0, %k1
; CHECK-NEXT: vpmovm2d %k1, %ymm0
; CHECK-NEXT: vpsrld $31, %ymm0, %ymm0
; CHECK-NEXT: vcvtdq2pd %xmm0, %ymm1
; CHECK-NEXT: vextracti128 $1, %ymm0, %xmm0
; CHECK-NEXT: vcvtdq2pd %xmm0, %ymm0
; CHECK-NEXT: vpmovm2d %k0, %ymm2
; CHECK-NEXT: vpsrld $31, %ymm2, %ymm2
; CHECK-NEXT: vcvtdq2pd %xmm2, %ymm3
; CHECK-NEXT: vextracti128 $1, %ymm2, %xmm2
; CHECK-NEXT: vcvtdq2pd %xmm2, %ymm2
; CHECK-NEXT: vmovaps %ymm2, 32(%rdi)
; CHECK-NEXT: vmovaps %ymm3, (%rdi)
; CHECK-NEXT: vmovaps %ymm0, 96(%rdi)
; CHECK-NEXT: vmovaps %ymm1, 64(%rdi)
; CHECK-NEXT: vzeroupper
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: retq
2018-02-12 02:52:16 +08:00
%mask = icmp slt < 16 x i16 > %a , zeroinitializer
2018-02-11 16:06:27 +08:00
%1 = uitofp < 16 x i1 > %mask to < 16 x double >
2018-02-12 02:52:16 +08:00
store < 16 x double > %1 , < 16 x double > * %res
ret void
2018-02-11 16:06:27 +08:00
}
2018-10-26 05:16:06 +08:00
define void @ubto16f64_512 ( < 16 x i16 > %a , < 16 x double > * %res ) "min-legal-vector-width" = "512" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: ubto16f64_512:
; CHECK: # %bb.0:
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vpmovw2m %ymm0, %k0
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: vpmovm2d %k0, %zmm0
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vpsrld $31, %zmm0, %zmm0
; CHECK-NEXT: vcvtdq2pd %ymm0, %zmm1
; CHECK-NEXT: vextracti64x4 $1, %zmm0, %ymm0
; CHECK-NEXT: vcvtdq2pd %ymm0, %zmm0
; CHECK-NEXT: vmovaps %zmm0, 64(%rdi)
; CHECK-NEXT: vmovaps %zmm1, (%rdi)
; CHECK-NEXT: vzeroupper
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: retq
2018-02-12 02:52:16 +08:00
%mask = icmp slt < 16 x i16 > %a , zeroinitializer
2018-02-11 16:06:27 +08:00
%1 = uitofp < 16 x i1 > %mask to < 16 x double >
2018-02-12 02:52:16 +08:00
store < 16 x double > %1 , < 16 x double > * %res
ret void
2018-02-11 16:06:27 +08:00
}
2018-10-26 05:16:06 +08:00
define < 16 x i16 > @test_16f32toub_256 ( < 16 x float > * %ptr , < 16 x i16 > %passthru ) "min-legal-vector-width" = "256" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: test_16f32toub_256:
; CHECK: # %bb.0:
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vcvttps2dq (%rdi), %ymm1
2018-11-23 06:56:52 +08:00
; CHECK-NEXT: vpslld $31, %ymm1, %ymm1
; CHECK-NEXT: vpmovd2m %ymm1, %k0
; CHECK-NEXT: vcvttps2dq 32(%rdi), %ymm1
; CHECK-NEXT: vpslld $31, %ymm1, %ymm1
; CHECK-NEXT: vpmovd2m %ymm1, %k1
; CHECK-NEXT: kunpckbw %k0, %k1, %k1
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vmovdqu16 %ymm0, %ymm0 {%k1} {z}
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: retq
2018-02-12 02:52:16 +08:00
%a = load < 16 x float > , < 16 x float > * %ptr
2018-02-11 16:06:27 +08:00
%mask = fptoui < 16 x float > %a to < 16 x i1 >
2018-02-12 02:52:16 +08:00
%select = select < 16 x i1 > %mask , < 16 x i16 > %passthru , < 16 x i16 > zeroinitializer
ret < 16 x i16 > %select
2018-02-11 16:06:27 +08:00
}
2018-10-26 05:16:06 +08:00
define < 16 x i16 > @test_16f32toub_512 ( < 16 x float > * %ptr , < 16 x i16 > %passthru ) "min-legal-vector-width" = "512" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: test_16f32toub_512:
; CHECK: # %bb.0:
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vcvttps2dq (%rdi), %zmm1
; CHECK-NEXT: vpslld $31, %zmm1, %zmm1
2018-02-20 06:07:31 +08:00
; CHECK-NEXT: vpmovd2m %zmm1, %k1
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vmovdqu16 %ymm0, %ymm0 {%k1} {z}
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: retq
2018-02-12 02:52:16 +08:00
%a = load < 16 x float > , < 16 x float > * %ptr
2018-02-11 16:06:27 +08:00
%mask = fptoui < 16 x float > %a to < 16 x i1 >
2018-02-12 02:52:16 +08:00
%select = select < 16 x i1 > %mask , < 16 x i16 > %passthru , < 16 x i16 > zeroinitializer
ret < 16 x i16 > %select
2018-02-11 16:06:27 +08:00
}
2018-10-26 05:16:06 +08:00
define < 16 x i16 > @test_16f32tosb_256 ( < 16 x float > * %ptr , < 16 x i16 > %passthru ) "min-legal-vector-width" = "256" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: test_16f32tosb_256:
; CHECK: # %bb.0:
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vcvttps2dq (%rdi), %ymm1
2018-11-23 06:56:52 +08:00
; CHECK-NEXT: vpmovd2m %ymm1, %k0
; CHECK-NEXT: vcvttps2dq 32(%rdi), %ymm1
; CHECK-NEXT: vpmovd2m %ymm1, %k1
; CHECK-NEXT: kunpckbw %k0, %k1, %k1
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vmovdqu16 %ymm0, %ymm0 {%k1} {z}
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: retq
2018-02-12 02:52:16 +08:00
%a = load < 16 x float > , < 16 x float > * %ptr
2018-02-11 16:06:27 +08:00
%mask = fptosi < 16 x float > %a to < 16 x i1 >
2018-02-12 02:52:16 +08:00
%select = select < 16 x i1 > %mask , < 16 x i16 > %passthru , < 16 x i16 > zeroinitializer
ret < 16 x i16 > %select
2018-02-11 16:06:27 +08:00
}
2018-10-26 05:16:06 +08:00
define < 16 x i16 > @test_16f32tosb_512 ( < 16 x float > * %ptr , < 16 x i16 > %passthru ) "min-legal-vector-width" = "512" {
2018-02-11 16:06:27 +08:00
; CHECK-LABEL: test_16f32tosb_512:
; CHECK: # %bb.0:
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vcvttps2dq (%rdi), %zmm1
2018-02-20 06:07:31 +08:00
; CHECK-NEXT: vpmovd2m %zmm1, %k1
2018-02-12 02:52:16 +08:00
; CHECK-NEXT: vmovdqu16 %ymm0, %ymm0 {%k1} {z}
2018-02-11 16:06:27 +08:00
; CHECK-NEXT: retq
2018-02-12 02:52:16 +08:00
%a = load < 16 x float > , < 16 x float > * %ptr
2018-02-11 16:06:27 +08:00
%mask = fptosi < 16 x float > %a to < 16 x i1 >
2018-02-12 02:52:16 +08:00
%select = select < 16 x i1 > %mask , < 16 x i16 > %passthru , < 16 x i16 > zeroinitializer
ret < 16 x i16 > %select
2018-02-11 16:06:27 +08:00
}
2018-11-17 10:36:02 +08:00
define void @mul256 ( < 64 x i8 > * %a , < 64 x i8 > * %b , < 64 x i8 > * %c ) "min-legal-vector-width" = "256" {
2019-09-07 05:49:01 +08:00
; CHECK-AVX512-LABEL: mul256:
; CHECK-AVX512: # %bb.0:
; CHECK-AVX512-NEXT: vmovdqa (%rdi), %ymm0
; CHECK-AVX512-NEXT: vmovdqa 32(%rdi), %ymm1
; CHECK-AVX512-NEXT: vmovdqa (%rsi), %ymm2
; CHECK-AVX512-NEXT: vmovdqa 32(%rsi), %ymm3
; CHECK-AVX512-NEXT: vpunpckhbw {{.*#+}} ymm4 = ymm3[8],ymm0[8],ymm3[9],ymm0[9],ymm3[10],ymm0[10],ymm3[11],ymm0[11],ymm3[12],ymm0[12],ymm3[13],ymm0[13],ymm3[14],ymm0[14],ymm3[15],ymm0[15],ymm3[24],ymm0[24],ymm3[25],ymm0[25],ymm3[26],ymm0[26],ymm3[27],ymm0[27],ymm3[28],ymm0[28],ymm3[29],ymm0[29],ymm3[30],ymm0[30],ymm3[31],ymm0[31]
; CHECK-AVX512-NEXT: vpunpckhbw {{.*#+}} ymm5 = ymm1[8],ymm0[8],ymm1[9],ymm0[9],ymm1[10],ymm0[10],ymm1[11],ymm0[11],ymm1[12],ymm0[12],ymm1[13],ymm0[13],ymm1[14],ymm0[14],ymm1[15],ymm0[15],ymm1[24],ymm0[24],ymm1[25],ymm0[25],ymm1[26],ymm0[26],ymm1[27],ymm0[27],ymm1[28],ymm0[28],ymm1[29],ymm0[29],ymm1[30],ymm0[30],ymm1[31],ymm0[31]
; CHECK-AVX512-NEXT: vpmullw %ymm4, %ymm5, %ymm4
; CHECK-AVX512-NEXT: vmovdqa {{.*#+}} ymm5 = [255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255]
; CHECK-AVX512-NEXT: vpand %ymm5, %ymm4, %ymm4
; CHECK-AVX512-NEXT: vpunpcklbw {{.*#+}} ymm3 = ymm3[0],ymm0[0],ymm3[1],ymm0[1],ymm3[2],ymm0[2],ymm3[3],ymm0[3],ymm3[4],ymm0[4],ymm3[5],ymm0[5],ymm3[6],ymm0[6],ymm3[7],ymm0[7],ymm3[16],ymm0[16],ymm3[17],ymm0[17],ymm3[18],ymm0[18],ymm3[19],ymm0[19],ymm3[20],ymm0[20],ymm3[21],ymm0[21],ymm3[22],ymm0[22],ymm3[23],ymm0[23]
; CHECK-AVX512-NEXT: vpunpcklbw {{.*#+}} ymm1 = ymm1[0],ymm0[0],ymm1[1],ymm0[1],ymm1[2],ymm0[2],ymm1[3],ymm0[3],ymm1[4],ymm0[4],ymm1[5],ymm0[5],ymm1[6],ymm0[6],ymm1[7],ymm0[7],ymm1[16],ymm0[16],ymm1[17],ymm0[17],ymm1[18],ymm0[18],ymm1[19],ymm0[19],ymm1[20],ymm0[20],ymm1[21],ymm0[21],ymm1[22],ymm0[22],ymm1[23],ymm0[23]
; CHECK-AVX512-NEXT: vpmullw %ymm3, %ymm1, %ymm1
; CHECK-AVX512-NEXT: vpand %ymm5, %ymm1, %ymm1
; CHECK-AVX512-NEXT: vpackuswb %ymm4, %ymm1, %ymm1
; CHECK-AVX512-NEXT: vpunpckhbw {{.*#+}} ymm3 = ymm2[8],ymm0[8],ymm2[9],ymm0[9],ymm2[10],ymm0[10],ymm2[11],ymm0[11],ymm2[12],ymm0[12],ymm2[13],ymm0[13],ymm2[14],ymm0[14],ymm2[15],ymm0[15],ymm2[24],ymm0[24],ymm2[25],ymm0[25],ymm2[26],ymm0[26],ymm2[27],ymm0[27],ymm2[28],ymm0[28],ymm2[29],ymm0[29],ymm2[30],ymm0[30],ymm2[31],ymm0[31]
; CHECK-AVX512-NEXT: vpunpckhbw {{.*#+}} ymm4 = ymm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31]
; CHECK-AVX512-NEXT: vpmullw %ymm3, %ymm4, %ymm3
; CHECK-AVX512-NEXT: vpand %ymm5, %ymm3, %ymm3
; CHECK-AVX512-NEXT: vpunpcklbw {{.*#+}} ymm2 = ymm2[0],ymm0[0],ymm2[1],ymm0[1],ymm2[2],ymm0[2],ymm2[3],ymm0[3],ymm2[4],ymm0[4],ymm2[5],ymm0[5],ymm2[6],ymm0[6],ymm2[7],ymm0[7],ymm2[16],ymm0[16],ymm2[17],ymm0[17],ymm2[18],ymm0[18],ymm2[19],ymm0[19],ymm2[20],ymm0[20],ymm2[21],ymm0[21],ymm2[22],ymm0[22],ymm2[23],ymm0[23]
; CHECK-AVX512-NEXT: vpunpcklbw {{.*#+}} ymm0 = ymm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23]
; CHECK-AVX512-NEXT: vpmullw %ymm2, %ymm0, %ymm0
; CHECK-AVX512-NEXT: vpand %ymm5, %ymm0, %ymm0
; CHECK-AVX512-NEXT: vpackuswb %ymm3, %ymm0, %ymm0
; CHECK-AVX512-NEXT: vmovdqa %ymm0, (%rdx)
; CHECK-AVX512-NEXT: vmovdqa %ymm1, 32(%rdx)
; CHECK-AVX512-NEXT: vzeroupper
; CHECK-AVX512-NEXT: retq
;
; CHECK-VBMI-LABEL: mul256:
; CHECK-VBMI: # %bb.0:
; CHECK-VBMI-NEXT: vmovdqa (%rdi), %ymm0
; CHECK-VBMI-NEXT: vmovdqa 32(%rdi), %ymm1
; CHECK-VBMI-NEXT: vmovdqa (%rsi), %ymm2
; CHECK-VBMI-NEXT: vmovdqa 32(%rsi), %ymm3
; CHECK-VBMI-NEXT: vpunpckhbw {{.*#+}} ymm4 = ymm3[8],ymm0[8],ymm3[9],ymm0[9],ymm3[10],ymm0[10],ymm3[11],ymm0[11],ymm3[12],ymm0[12],ymm3[13],ymm0[13],ymm3[14],ymm0[14],ymm3[15],ymm0[15],ymm3[24],ymm0[24],ymm3[25],ymm0[25],ymm3[26],ymm0[26],ymm3[27],ymm0[27],ymm3[28],ymm0[28],ymm3[29],ymm0[29],ymm3[30],ymm0[30],ymm3[31],ymm0[31]
; CHECK-VBMI-NEXT: vpunpckhbw {{.*#+}} ymm5 = ymm1[8],ymm0[8],ymm1[9],ymm0[9],ymm1[10],ymm0[10],ymm1[11],ymm0[11],ymm1[12],ymm0[12],ymm1[13],ymm0[13],ymm1[14],ymm0[14],ymm1[15],ymm0[15],ymm1[24],ymm0[24],ymm1[25],ymm0[25],ymm1[26],ymm0[26],ymm1[27],ymm0[27],ymm1[28],ymm0[28],ymm1[29],ymm0[29],ymm1[30],ymm0[30],ymm1[31],ymm0[31]
; CHECK-VBMI-NEXT: vpmullw %ymm4, %ymm5, %ymm4
; CHECK-VBMI-NEXT: vpunpcklbw {{.*#+}} ymm3 = ymm3[0],ymm0[0],ymm3[1],ymm0[1],ymm3[2],ymm0[2],ymm3[3],ymm0[3],ymm3[4],ymm0[4],ymm3[5],ymm0[5],ymm3[6],ymm0[6],ymm3[7],ymm0[7],ymm3[16],ymm0[16],ymm3[17],ymm0[17],ymm3[18],ymm0[18],ymm3[19],ymm0[19],ymm3[20],ymm0[20],ymm3[21],ymm0[21],ymm3[22],ymm0[22],ymm3[23],ymm0[23]
; CHECK-VBMI-NEXT: vpunpcklbw {{.*#+}} ymm1 = ymm1[0],ymm0[0],ymm1[1],ymm0[1],ymm1[2],ymm0[2],ymm1[3],ymm0[3],ymm1[4],ymm0[4],ymm1[5],ymm0[5],ymm1[6],ymm0[6],ymm1[7],ymm0[7],ymm1[16],ymm0[16],ymm1[17],ymm0[17],ymm1[18],ymm0[18],ymm1[19],ymm0[19],ymm1[20],ymm0[20],ymm1[21],ymm0[21],ymm1[22],ymm0[22],ymm1[23],ymm0[23]
; CHECK-VBMI-NEXT: vpmullw %ymm3, %ymm1, %ymm1
; CHECK-VBMI-NEXT: vmovdqa {{.*#+}} ymm3 = [0,2,4,6,8,10,12,14,32,34,36,38,40,42,44,46,16,18,20,22,24,26,28,30,48,50,52,54,56,58,60,62]
; CHECK-VBMI-NEXT: vpermt2b %ymm4, %ymm3, %ymm1
; CHECK-VBMI-NEXT: vpunpckhbw {{.*#+}} ymm4 = ymm2[8],ymm0[8],ymm2[9],ymm0[9],ymm2[10],ymm0[10],ymm2[11],ymm0[11],ymm2[12],ymm0[12],ymm2[13],ymm0[13],ymm2[14],ymm0[14],ymm2[15],ymm0[15],ymm2[24],ymm0[24],ymm2[25],ymm0[25],ymm2[26],ymm0[26],ymm2[27],ymm0[27],ymm2[28],ymm0[28],ymm2[29],ymm0[29],ymm2[30],ymm0[30],ymm2[31],ymm0[31]
; CHECK-VBMI-NEXT: vpunpckhbw {{.*#+}} ymm5 = ymm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31]
; CHECK-VBMI-NEXT: vpmullw %ymm4, %ymm5, %ymm4
; CHECK-VBMI-NEXT: vpunpcklbw {{.*#+}} ymm2 = ymm2[0],ymm0[0],ymm2[1],ymm0[1],ymm2[2],ymm0[2],ymm2[3],ymm0[3],ymm2[4],ymm0[4],ymm2[5],ymm0[5],ymm2[6],ymm0[6],ymm2[7],ymm0[7],ymm2[16],ymm0[16],ymm2[17],ymm0[17],ymm2[18],ymm0[18],ymm2[19],ymm0[19],ymm2[20],ymm0[20],ymm2[21],ymm0[21],ymm2[22],ymm0[22],ymm2[23],ymm0[23]
; CHECK-VBMI-NEXT: vpunpcklbw {{.*#+}} ymm0 = ymm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23]
; CHECK-VBMI-NEXT: vpmullw %ymm2, %ymm0, %ymm0
; CHECK-VBMI-NEXT: vpermt2b %ymm4, %ymm3, %ymm0
; CHECK-VBMI-NEXT: vmovdqa %ymm0, (%rdx)
; CHECK-VBMI-NEXT: vmovdqa %ymm1, 32(%rdx)
; CHECK-VBMI-NEXT: vzeroupper
; CHECK-VBMI-NEXT: retq
2018-11-17 10:36:02 +08:00
%d = load < 64 x i8 > , < 64 x i8 > * %a
%e = load < 64 x i8 > , < 64 x i8 > * %b
%f = mul < 64 x i8 > %d , %e
store < 64 x i8 > %f , < 64 x i8 > * %c
ret void
}
define void @mul512 ( < 64 x i8 > * %a , < 64 x i8 > * %b , < 64 x i8 > * %c ) "min-legal-vector-width" = "512" {
2019-09-07 05:49:01 +08:00
; CHECK-AVX512-LABEL: mul512:
; CHECK-AVX512: # %bb.0:
; CHECK-AVX512-NEXT: vmovdqa64 (%rdi), %zmm0
; CHECK-AVX512-NEXT: vmovdqa64 (%rsi), %zmm1
; CHECK-AVX512-NEXT: vpunpckhbw {{.*#+}} zmm2 = zmm1[8],zmm0[8],zmm1[9],zmm0[9],zmm1[10],zmm0[10],zmm1[11],zmm0[11],zmm1[12],zmm0[12],zmm1[13],zmm0[13],zmm1[14],zmm0[14],zmm1[15],zmm0[15],zmm1[24],zmm0[24],zmm1[25],zmm0[25],zmm1[26],zmm0[26],zmm1[27],zmm0[27],zmm1[28],zmm0[28],zmm1[29],zmm0[29],zmm1[30],zmm0[30],zmm1[31],zmm0[31],zmm1[40],zmm0[40],zmm1[41],zmm0[41],zmm1[42],zmm0[42],zmm1[43],zmm0[43],zmm1[44],zmm0[44],zmm1[45],zmm0[45],zmm1[46],zmm0[46],zmm1[47],zmm0[47],zmm1[56],zmm0[56],zmm1[57],zmm0[57],zmm1[58],zmm0[58],zmm1[59],zmm0[59],zmm1[60],zmm0[60],zmm1[61],zmm0[61],zmm1[62],zmm0[62],zmm1[63],zmm0[63]
; CHECK-AVX512-NEXT: vpunpckhbw {{.*#+}} zmm3 = zmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63]
; CHECK-AVX512-NEXT: vpmullw %zmm2, %zmm3, %zmm2
; CHECK-AVX512-NEXT: vmovdqa64 {{.*#+}} zmm3 = [255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255]
; CHECK-AVX512-NEXT: vpandq %zmm3, %zmm2, %zmm2
; CHECK-AVX512-NEXT: vpunpcklbw {{.*#+}} zmm1 = zmm1[0],zmm0[0],zmm1[1],zmm0[1],zmm1[2],zmm0[2],zmm1[3],zmm0[3],zmm1[4],zmm0[4],zmm1[5],zmm0[5],zmm1[6],zmm0[6],zmm1[7],zmm0[7],zmm1[16],zmm0[16],zmm1[17],zmm0[17],zmm1[18],zmm0[18],zmm1[19],zmm0[19],zmm1[20],zmm0[20],zmm1[21],zmm0[21],zmm1[22],zmm0[22],zmm1[23],zmm0[23],zmm1[32],zmm0[32],zmm1[33],zmm0[33],zmm1[34],zmm0[34],zmm1[35],zmm0[35],zmm1[36],zmm0[36],zmm1[37],zmm0[37],zmm1[38],zmm0[38],zmm1[39],zmm0[39],zmm1[48],zmm0[48],zmm1[49],zmm0[49],zmm1[50],zmm0[50],zmm1[51],zmm0[51],zmm1[52],zmm0[52],zmm1[53],zmm0[53],zmm1[54],zmm0[54],zmm1[55],zmm0[55]
; CHECK-AVX512-NEXT: vpunpcklbw {{.*#+}} zmm0 = zmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55]
; CHECK-AVX512-NEXT: vpmullw %zmm1, %zmm0, %zmm0
; CHECK-AVX512-NEXT: vpandq %zmm3, %zmm0, %zmm0
; CHECK-AVX512-NEXT: vpackuswb %zmm2, %zmm0, %zmm0
; CHECK-AVX512-NEXT: vmovdqa64 %zmm0, (%rdx)
; CHECK-AVX512-NEXT: vzeroupper
; CHECK-AVX512-NEXT: retq
;
; CHECK-VBMI-LABEL: mul512:
; CHECK-VBMI: # %bb.0:
; CHECK-VBMI-NEXT: vmovdqa64 (%rdi), %zmm0
; CHECK-VBMI-NEXT: vmovdqa64 (%rsi), %zmm1
; CHECK-VBMI-NEXT: vpunpckhbw {{.*#+}} zmm2 = zmm1[8],zmm0[8],zmm1[9],zmm0[9],zmm1[10],zmm0[10],zmm1[11],zmm0[11],zmm1[12],zmm0[12],zmm1[13],zmm0[13],zmm1[14],zmm0[14],zmm1[15],zmm0[15],zmm1[24],zmm0[24],zmm1[25],zmm0[25],zmm1[26],zmm0[26],zmm1[27],zmm0[27],zmm1[28],zmm0[28],zmm1[29],zmm0[29],zmm1[30],zmm0[30],zmm1[31],zmm0[31],zmm1[40],zmm0[40],zmm1[41],zmm0[41],zmm1[42],zmm0[42],zmm1[43],zmm0[43],zmm1[44],zmm0[44],zmm1[45],zmm0[45],zmm1[46],zmm0[46],zmm1[47],zmm0[47],zmm1[56],zmm0[56],zmm1[57],zmm0[57],zmm1[58],zmm0[58],zmm1[59],zmm0[59],zmm1[60],zmm0[60],zmm1[61],zmm0[61],zmm1[62],zmm0[62],zmm1[63],zmm0[63]
; CHECK-VBMI-NEXT: vpunpckhbw {{.*#+}} zmm3 = zmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63]
; CHECK-VBMI-NEXT: vpmullw %zmm2, %zmm3, %zmm2
; CHECK-VBMI-NEXT: vpunpcklbw {{.*#+}} zmm1 = zmm1[0],zmm0[0],zmm1[1],zmm0[1],zmm1[2],zmm0[2],zmm1[3],zmm0[3],zmm1[4],zmm0[4],zmm1[5],zmm0[5],zmm1[6],zmm0[6],zmm1[7],zmm0[7],zmm1[16],zmm0[16],zmm1[17],zmm0[17],zmm1[18],zmm0[18],zmm1[19],zmm0[19],zmm1[20],zmm0[20],zmm1[21],zmm0[21],zmm1[22],zmm0[22],zmm1[23],zmm0[23],zmm1[32],zmm0[32],zmm1[33],zmm0[33],zmm1[34],zmm0[34],zmm1[35],zmm0[35],zmm1[36],zmm0[36],zmm1[37],zmm0[37],zmm1[38],zmm0[38],zmm1[39],zmm0[39],zmm1[48],zmm0[48],zmm1[49],zmm0[49],zmm1[50],zmm0[50],zmm1[51],zmm0[51],zmm1[52],zmm0[52],zmm1[53],zmm0[53],zmm1[54],zmm0[54],zmm1[55],zmm0[55]
; CHECK-VBMI-NEXT: vpunpcklbw {{.*#+}} zmm0 = zmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55]
; CHECK-VBMI-NEXT: vpmullw %zmm1, %zmm0, %zmm0
; CHECK-VBMI-NEXT: vmovdqa64 {{.*#+}} zmm1 = [0,2,4,6,8,10,12,14,64,66,68,70,72,74,76,78,16,18,20,22,24,26,28,30,80,82,84,86,88,90,92,94,32,34,36,38,40,42,44,46,96,98,100,102,104,106,108,110,48,50,52,54,56,58,60,62,112,114,116,118,120,122,124,126]
; CHECK-VBMI-NEXT: vpermi2b %zmm2, %zmm0, %zmm1
; CHECK-VBMI-NEXT: vmovdqa64 %zmm1, (%rdx)
; CHECK-VBMI-NEXT: vzeroupper
; CHECK-VBMI-NEXT: retq
2018-11-17 10:36:02 +08:00
%d = load < 64 x i8 > , < 64 x i8 > * %a
%e = load < 64 x i8 > , < 64 x i8 > * %b
%f = mul < 64 x i8 > %d , %e
store < 64 x i8 > %f , < 64 x i8 > * %c
ret void
}
2019-07-18 06:26:00 +08:00
; This threw an assertion at one point.
define < 4 x i32 > @mload_v4i32 ( < 4 x i32 > %trigger , < 4 x i32 > * %addr , < 4 x i32 > %dst ) "min-legal-vector-width" = "256" {
; CHECK-LABEL: mload_v4i32:
; CHECK: # %bb.0:
; CHECK-NEXT: vptestnmd %xmm0, %xmm0, %k1
; CHECK-NEXT: vpblendmd (%rdi), %xmm1, %xmm0 {%k1}
; CHECK-NEXT: retq
%mask = icmp eq < 4 x i32 > %trigger , zeroinitializer
%res = call < 4 x i32 > @llvm.masked.load.v4i32.p0v4i32 ( < 4 x i32 > * %addr , i32 4 , < 4 x i1 > %mask , < 4 x i32 > %dst )
ret < 4 x i32 > %res
}
declare < 4 x i32 > @llvm.masked.load.v4i32.p0v4i32 ( < 4 x i32 > * , i32 , < 4 x i1 > , < 4 x i32 > )
2019-08-02 02:48:57 +08:00
2019-09-12 05:30:42 +08:00
define < 16 x i32 > @trunc_v16i64_v16i32 ( < 16 x i64 > * %x ) nounwind "min-legal-vector-width" = "256" {
; CHECK-LABEL: trunc_v16i64_v16i32:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa (%rdi), %ymm0
; CHECK-NEXT: vmovdqa 32(%rdi), %ymm1
; CHECK-NEXT: vmovdqa 64(%rdi), %ymm2
; CHECK-NEXT: vmovdqa 96(%rdi), %ymm3
; CHECK-NEXT: vpmovqd %ymm0, %xmm0
; CHECK-NEXT: vpmovqd %ymm1, %xmm1
; CHECK-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0
; CHECK-NEXT: vpmovqd %ymm2, %xmm1
; CHECK-NEXT: vpmovqd %ymm3, %xmm2
; CHECK-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1
; CHECK-NEXT: retq
%a = load < 16 x i64 > , < 16 x i64 > * %x
%b = trunc < 16 x i64 > %a to < 16 x i32 >
ret < 16 x i32 > %b
}
2019-09-06 14:02:17 +08:00
define < 16 x i8 > @trunc_v16i64_v16i8 ( < 16 x i64 > * %x ) nounwind "min-legal-vector-width" = "256" {
; CHECK-LABEL: trunc_v16i64_v16i8:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa (%rdi), %ymm0
; CHECK-NEXT: vmovdqa 32(%rdi), %ymm1
; CHECK-NEXT: vmovdqa 64(%rdi), %ymm2
; CHECK-NEXT: vmovdqa 96(%rdi), %ymm3
2019-10-07 02:43:08 +08:00
; CHECK-NEXT: vpmovqb %ymm3, %xmm3
; CHECK-NEXT: vpmovqb %ymm2, %xmm2
; CHECK-NEXT: vpunpckldq {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
; CHECK-NEXT: vpmovqb %ymm1, %xmm1
; CHECK-NEXT: vpmovqb %ymm0, %xmm0
; CHECK-NEXT: vpunpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
2019-09-06 14:02:17 +08:00
; CHECK-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm2[0]
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%a = load < 16 x i64 > , < 16 x i64 > * %x
%b = trunc < 16 x i64 > %a to < 16 x i8 >
ret < 16 x i8 > %b
}
2019-08-02 02:48:57 +08:00
define < 16 x i8 > @trunc_v16i32_v16i8 ( < 16 x i32 > * %x ) nounwind "min-legal-vector-width" = "256" {
; CHECK-LABEL: trunc_v16i32_v16i8:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa (%rdi), %ymm0
; CHECK-NEXT: vmovdqa 32(%rdi), %ymm1
2019-08-09 05:36:47 +08:00
; CHECK-NEXT: vpmovdb %ymm1, %xmm1
; CHECK-NEXT: vpmovdb %ymm0, %xmm0
; CHECK-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
2019-08-02 02:48:57 +08:00
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%a = load < 16 x i32 > , < 16 x i32 > * %x
%b = trunc < 16 x i32 > %a to < 16 x i8 >
ret < 16 x i8 > %b
}
2019-10-03 14:18:45 +08:00
define < 8 x i8 > @trunc_v8i64_v8i8 ( < 8 x i64 > * %x ) nounwind "min-legal-vector-width" = "256" {
2019-10-07 02:43:08 +08:00
; CHECK-LABEL: trunc_v8i64_v8i8:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa (%rdi), %ymm0
; CHECK-NEXT: vmovdqa 32(%rdi), %ymm1
; CHECK-NEXT: vpmovqb %ymm1, %xmm1
; CHECK-NEXT: vpmovqb %ymm0, %xmm0
; CHECK-NEXT: vpunpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
2019-10-03 14:18:45 +08:00
%a = load < 8 x i64 > , < 8 x i64 > * %x
%b = trunc < 8 x i64 > %a to < 8 x i8 >
ret < 8 x i8 > %b
}
2019-08-02 02:48:57 +08:00
define < 8 x i16 > @trunc_v8i64_v8i16 ( < 8 x i64 > * %x ) nounwind "min-legal-vector-width" = "256" {
; CHECK-LABEL: trunc_v8i64_v8i16:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa (%rdi), %ymm0
; CHECK-NEXT: vmovdqa 32(%rdi), %ymm1
2019-08-09 05:36:47 +08:00
; CHECK-NEXT: vpmovqw %ymm1, %xmm1
; CHECK-NEXT: vpmovqw %ymm0, %xmm0
; CHECK-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
2019-08-02 02:48:57 +08:00
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%a = load < 8 x i64 > , < 8 x i64 > * %x
%b = trunc < 8 x i64 > %a to < 8 x i16 >
ret < 8 x i16 > %b
}
2019-08-08 04:54:46 +08:00
define < 8 x i32 > @trunc_v8i64_v8i32_zeroes ( < 8 x i64 > * %x ) nounwind "min-legal-vector-width" = "256" {
; CHECK-LABEL: trunc_v8i64_v8i32_zeroes:
; CHECK: # %bb.0:
2019-09-07 05:49:01 +08:00
; CHECK-NEXT: vpsrlq $48, 32(%rdi), %ymm1
; CHECK-NEXT: vpsrlq $48, (%rdi), %ymm2
; CHECK-NEXT: vmovdqa {{.*#+}} ymm0 = [0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30]
; CHECK-NEXT: vpermi2w %ymm1, %ymm2, %ymm0
2019-08-08 04:54:46 +08:00
; CHECK-NEXT: retq
%a = load < 8 x i64 > , < 8 x i64 > * %x
%b = lshr < 8 x i64 > %a , < i64 48 , i64 48 , i64 48 , i64 48 , i64 48 , i64 48 , i64 48 , i64 48 >
%c = trunc < 8 x i64 > %b to < 8 x i32 >
ret < 8 x i32 > %c
}
define < 16 x i16 > @trunc_v16i32_v16i16_zeroes ( < 16 x i32 > * %x ) nounwind "min-legal-vector-width" = "256" {
; CHECK-LABEL: trunc_v16i32_v16i16_zeroes:
; CHECK: # %bb.0:
2019-08-08 05:16:10 +08:00
; CHECK-NEXT: vmovdqa (%rdi), %ymm1
; CHECK-NEXT: vmovdqa {{.*#+}} ymm0 = [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31]
; CHECK-NEXT: vpermi2w 32(%rdi), %ymm1, %ymm0
2019-08-08 04:54:46 +08:00
; CHECK-NEXT: retq
%a = load < 16 x i32 > , < 16 x i32 > * %x
%b = lshr < 16 x i32 > %a , < i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 >
%c = trunc < 16 x i32 > %b to < 16 x i16 >
ret < 16 x i16 > %c
}
define < 32 x i8 > @trunc_v32i16_v32i8_zeroes ( < 32 x i16 > * %x ) nounwind "min-legal-vector-width" = "256" {
2019-09-07 05:49:01 +08:00
; CHECK-AVX512-LABEL: trunc_v32i16_v32i8_zeroes:
; CHECK-AVX512: # %bb.0:
; CHECK-AVX512-NEXT: vpsrlw $8, 32(%rdi), %ymm0
; CHECK-AVX512-NEXT: vpsrlw $8, (%rdi), %ymm1
; CHECK-AVX512-NEXT: vpackuswb %ymm0, %ymm1, %ymm0
; CHECK-AVX512-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
; CHECK-AVX512-NEXT: retq
;
; CHECK-VBMI-LABEL: trunc_v32i16_v32i8_zeroes:
; CHECK-VBMI: # %bb.0:
; CHECK-VBMI-NEXT: vmovdqa (%rdi), %ymm1
; CHECK-VBMI-NEXT: vmovdqa {{.*#+}} ymm0 = [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63]
; CHECK-VBMI-NEXT: vpermi2b 32(%rdi), %ymm1, %ymm0
; CHECK-VBMI-NEXT: retq
2019-08-08 04:54:46 +08:00
%a = load < 32 x i16 > , < 32 x i16 > * %x
%b = lshr < 32 x i16 > %a , < i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 >
%c = trunc < 32 x i16 > %b to < 32 x i8 >
ret < 32 x i8 > %c
}
define < 8 x i32 > @trunc_v8i64_v8i32_sign ( < 8 x i64 > * %x ) nounwind "min-legal-vector-width" = "256" {
; CHECK-LABEL: trunc_v8i64_v8i32_sign:
; CHECK: # %bb.0:
2019-09-07 05:49:01 +08:00
; CHECK-NEXT: vpsraq $48, 32(%rdi), %ymm1
; CHECK-NEXT: vpsraq $48, (%rdi), %ymm2
; CHECK-NEXT: vmovdqa {{.*#+}} ymm0 = [0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30]
; CHECK-NEXT: vpermi2w %ymm1, %ymm2, %ymm0
2019-08-08 04:54:46 +08:00
; CHECK-NEXT: retq
%a = load < 8 x i64 > , < 8 x i64 > * %x
%b = ashr < 8 x i64 > %a , < i64 48 , i64 48 , i64 48 , i64 48 , i64 48 , i64 48 , i64 48 , i64 48 >
%c = trunc < 8 x i64 > %b to < 8 x i32 >
ret < 8 x i32 > %c
}
define < 16 x i16 > @trunc_v16i32_v16i16_sign ( < 16 x i32 > * %x ) nounwind "min-legal-vector-width" = "256" {
; CHECK-LABEL: trunc_v16i32_v16i16_sign:
; CHECK: # %bb.0:
2019-09-07 05:49:01 +08:00
; CHECK-NEXT: vmovdqa (%rdi), %ymm1
; CHECK-NEXT: vmovdqa {{.*#+}} ymm0 = [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31]
; CHECK-NEXT: vpermi2w 32(%rdi), %ymm1, %ymm0
2019-08-08 04:54:46 +08:00
; CHECK-NEXT: retq
%a = load < 16 x i32 > , < 16 x i32 > * %x
%b = ashr < 16 x i32 > %a , < i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 , i32 16 >
%c = trunc < 16 x i32 > %b to < 16 x i16 >
ret < 16 x i16 > %c
}
define < 32 x i8 > @trunc_v32i16_v32i8_sign ( < 32 x i16 > * %x ) nounwind "min-legal-vector-width" = "256" {
2019-09-07 05:49:01 +08:00
; CHECK-AVX512-LABEL: trunc_v32i16_v32i8_sign:
; CHECK-AVX512: # %bb.0:
; CHECK-AVX512-NEXT: vpsraw $8, 32(%rdi), %ymm0
; CHECK-AVX512-NEXT: vpsraw $8, (%rdi), %ymm1
; CHECK-AVX512-NEXT: vpacksswb %ymm0, %ymm1, %ymm0
; CHECK-AVX512-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
; CHECK-AVX512-NEXT: retq
;
; CHECK-VBMI-LABEL: trunc_v32i16_v32i8_sign:
; CHECK-VBMI: # %bb.0:
; CHECK-VBMI-NEXT: vmovdqa (%rdi), %ymm1
; CHECK-VBMI-NEXT: vmovdqa {{.*#+}} ymm0 = [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63]
; CHECK-VBMI-NEXT: vpermi2b 32(%rdi), %ymm1, %ymm0
; CHECK-VBMI-NEXT: retq
2019-08-08 04:54:46 +08:00
%a = load < 32 x i16 > , < 32 x i16 > * %x
%b = ashr < 32 x i16 > %a , < i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 , i16 8 >
%c = trunc < 32 x i16 > %b to < 32 x i8 >
ret < 32 x i8 > %c
}
2019-09-06 14:02:17 +08:00
define void @zext_v16i8_v16i64 ( < 16 x i8 > %x , < 16 x i64 > * %y ) nounwind "min-legal-vector-width" = "256" {
; CHECK-LABEL: zext_v16i8_v16i64:
; CHECK: # %bb.0:
; CHECK-NEXT: vpmovzxbw {{.*#+}} ymm1 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero,xmm0[8],zero,xmm0[9],zero,xmm0[10],zero,xmm0[11],zero,xmm0[12],zero,xmm0[13],zero,xmm0[14],zero,xmm0[15],zero
; CHECK-NEXT: vpshufd {{.*#+}} xmm2 = xmm1[2,3,0,1]
; CHECK-NEXT: vpmovzxwq {{.*#+}} ymm2 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero,xmm2[2],zero,zero,zero,xmm2[3],zero,zero,zero
; CHECK-NEXT: vextracti128 $1, %ymm1, %xmm1
; CHECK-NEXT: vpshufd {{.*#+}} xmm3 = xmm1[2,3,0,1]
; CHECK-NEXT: vpmovzxwq {{.*#+}} ymm3 = xmm3[0],zero,zero,zero,xmm3[1],zero,zero,zero,xmm3[2],zero,zero,zero,xmm3[3],zero,zero,zero
; CHECK-NEXT: vpmovzxwq {{.*#+}} ymm1 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero,xmm1[2],zero,zero,zero,xmm1[3],zero,zero,zero
; CHECK-NEXT: vpmovzxbq {{.*#+}} ymm0 = xmm0[0],zero,zero,zero,zero,zero,zero,zero,xmm0[1],zero,zero,zero,zero,zero,zero,zero,xmm0[2],zero,zero,zero,zero,zero,zero,zero,xmm0[3],zero,zero,zero,zero,zero,zero,zero
; CHECK-NEXT: vmovdqa %ymm0, (%rdi)
; CHECK-NEXT: vmovdqa %ymm1, 64(%rdi)
; CHECK-NEXT: vmovdqa %ymm3, 96(%rdi)
; CHECK-NEXT: vmovdqa %ymm2, 32(%rdi)
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%a = zext < 16 x i8 > %x to < 16 x i64 >
store < 16 x i64 > %a , < 16 x i64 > * %y
ret void
}
define void @sext_v16i8_v16i64 ( < 16 x i8 > %x , < 16 x i64 > * %y ) nounwind "min-legal-vector-width" = "256" {
; CHECK-LABEL: sext_v16i8_v16i64:
; CHECK: # %bb.0:
; CHECK-NEXT: vpmovsxbw %xmm0, %ymm0
; CHECK-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
; CHECK-NEXT: vpmovsxwq %xmm1, %ymm1
; CHECK-NEXT: vextracti128 $1, %ymm0, %xmm2
; CHECK-NEXT: vpshufd {{.*#+}} xmm3 = xmm2[2,3,0,1]
; CHECK-NEXT: vpmovsxwq %xmm3, %ymm3
; CHECK-NEXT: vpmovsxwq %xmm0, %ymm0
; CHECK-NEXT: vpmovsxwq %xmm2, %ymm2
; CHECK-NEXT: vmovdqa %ymm2, 64(%rdi)
; CHECK-NEXT: vmovdqa %ymm0, (%rdi)
; CHECK-NEXT: vmovdqa %ymm3, 96(%rdi)
; CHECK-NEXT: vmovdqa %ymm1, 32(%rdi)
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%a = sext < 16 x i8 > %x to < 16 x i64 >
store < 16 x i64 > %a , < 16 x i64 > * %y
ret void
}
2019-10-03 06:35:03 +08:00
define void @vselect_split_v8i16_setcc ( < 8 x i16 > %s , < 8 x i16 > %t , < 8 x i64 > * %p , < 8 x i64 > * %q , < 8 x i64 > * %r ) "min-legal-vector-width" = "256" {
; CHECK-LABEL: vselect_split_v8i16_setcc:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa (%rsi), %ymm2
; CHECK-NEXT: vmovdqa 32(%rsi), %ymm3
; CHECK-NEXT: vpcmpeqw %xmm1, %xmm0, %k1
2019-10-07 02:43:03 +08:00
; CHECK-NEXT: kshiftrb $4, %k1, %k2
2019-10-03 06:35:03 +08:00
; CHECK-NEXT: vmovdqa64 32(%rdi), %ymm3 {%k2}
; CHECK-NEXT: vmovdqa64 (%rdi), %ymm2 {%k1}
; CHECK-NEXT: vmovdqa %ymm2, (%rdx)
; CHECK-NEXT: vmovdqa %ymm3, 32(%rdx)
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%x = load < 8 x i64 > , < 8 x i64 > * %p
%y = load < 8 x i64 > , < 8 x i64 > * %q
%a = icmp eq < 8 x i16 > %s , %t
%b = select < 8 x i1 > %a , < 8 x i64 > %x , < 8 x i64 > %y
store < 8 x i64 > %b , < 8 x i64 > * %r
ret void
}
define void @vselect_split_v8i32_setcc ( < 8 x i32 > %s , < 8 x i32 > %t , < 8 x i64 > * %p , < 8 x i64 > * %q , < 8 x i64 > * %r ) "min-legal-vector-width" = "256" {
; CHECK-LABEL: vselect_split_v8i32_setcc:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa (%rsi), %ymm2
; CHECK-NEXT: vmovdqa 32(%rsi), %ymm3
2019-10-07 02:43:03 +08:00
; CHECK-NEXT: vpcmpeqd %ymm1, %ymm0, %k1
; CHECK-NEXT: kshiftrb $4, %k1, %k2
2019-10-03 06:35:03 +08:00
; CHECK-NEXT: vmovdqa64 32(%rdi), %ymm3 {%k2}
; CHECK-NEXT: vmovdqa64 (%rdi), %ymm2 {%k1}
; CHECK-NEXT: vmovdqa %ymm2, (%rdx)
; CHECK-NEXT: vmovdqa %ymm3, 32(%rdx)
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%x = load < 8 x i64 > , < 8 x i64 > * %p
%y = load < 8 x i64 > , < 8 x i64 > * %q
%a = icmp eq < 8 x i32 > %s , %t
%b = select < 8 x i1 > %a , < 8 x i64 > %x , < 8 x i64 > %y
store < 8 x i64 > %b , < 8 x i64 > * %r
ret void
}
define void @vselect_split_v16i8_setcc ( < 16 x i8 > %s , < 16 x i8 > %t , < 16 x i32 > * %p , < 16 x i32 > * %q , < 16 x i32 > * %r ) "min-legal-vector-width" = "256" {
; CHECK-LABEL: vselect_split_v16i8_setcc:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa (%rsi), %ymm2
; CHECK-NEXT: vmovdqa 32(%rsi), %ymm3
; CHECK-NEXT: vpcmpeqb %xmm1, %xmm0, %k1
2019-10-07 02:43:03 +08:00
; CHECK-NEXT: kshiftrw $8, %k1, %k2
2019-10-03 06:35:03 +08:00
; CHECK-NEXT: vmovdqa32 32(%rdi), %ymm3 {%k2}
; CHECK-NEXT: vmovdqa32 (%rdi), %ymm2 {%k1}
; CHECK-NEXT: vmovdqa %ymm2, (%rdx)
; CHECK-NEXT: vmovdqa %ymm3, 32(%rdx)
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%x = load < 16 x i32 > , < 16 x i32 > * %p
%y = load < 16 x i32 > , < 16 x i32 > * %q
%a = icmp eq < 16 x i8 > %s , %t
%b = select < 16 x i1 > %a , < 16 x i32 > %x , < 16 x i32 > %y
store < 16 x i32 > %b , < 16 x i32 > * %r
ret void
}
define void @vselect_split_v16i16_setcc ( < 16 x i16 > %s , < 16 x i16 > %t , < 16 x i32 > * %p , < 16 x i32 > * %q , < 16 x i32 > * %r ) "min-legal-vector-width" = "256" {
; CHECK-LABEL: vselect_split_v16i16_setcc:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa (%rsi), %ymm2
; CHECK-NEXT: vmovdqa 32(%rsi), %ymm3
2019-10-07 02:43:03 +08:00
; CHECK-NEXT: vpcmpeqw %ymm1, %ymm0, %k1
; CHECK-NEXT: kshiftrw $8, %k1, %k2
2019-10-03 06:35:03 +08:00
; CHECK-NEXT: vmovdqa32 32(%rdi), %ymm3 {%k2}
; CHECK-NEXT: vmovdqa32 (%rdi), %ymm2 {%k1}
; CHECK-NEXT: vmovdqa %ymm2, (%rdx)
; CHECK-NEXT: vmovdqa %ymm3, 32(%rdx)
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%x = load < 16 x i32 > , < 16 x i32 > * %p
%y = load < 16 x i32 > , < 16 x i32 > * %q
%a = icmp eq < 16 x i16 > %s , %t
%b = select < 16 x i1 > %a , < 16 x i32 > %x , < 16 x i32 > %y
store < 16 x i32 > %b , < 16 x i32 > * %r
ret void
}
2019-10-10 14:25:00 +08:00
2019-10-11 12:02:04 +08:00
define < 16 x i8 > @trunc_packus_v16i32_v16i8 ( < 16 x i32 > * %p ) "min-legal-vector-width" = "256" {
2019-10-10 14:25:00 +08:00
; CHECK-LABEL: trunc_packus_v16i32_v16i8:
; CHECK: # %bb.0:
2019-10-11 03:40:44 +08:00
; CHECK-NEXT: vmovdqa (%rdi), %ymm0
; CHECK-NEXT: vpackusdw 32(%rdi), %ymm0, %ymm0
; CHECK-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
; CHECK-NEXT: vpmovuswb %ymm0, %xmm0
2019-10-10 14:25:00 +08:00
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%a = load < 16 x i32 > , < 16 x i32 > * %p
%b = icmp slt < 16 x i32 > %a , < i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 >
%c = select < 16 x i1 > %b , < 16 x i32 > %a , < 16 x i32 > < i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 >
%d = icmp sgt < 16 x i32 > %c , zeroinitializer
%e = select < 16 x i1 > %d , < 16 x i32 > %c , < 16 x i32 > zeroinitializer
%f = trunc < 16 x i32 > %e to < 16 x i8 >
ret < 16 x i8 > %f
}
2019-10-11 05:46:44 +08:00
2019-10-11 12:02:04 +08:00
define void @trunc_packus_v16i32_v16i8_store ( < 16 x i32 > * %p , < 16 x i8 > * %q ) "min-legal-vector-width" = "256" {
; CHECK-LABEL: trunc_packus_v16i32_v16i8_store:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovdqa (%rdi), %ymm0
; CHECK-NEXT: vpackusdw 32(%rdi), %ymm0, %ymm0
; CHECK-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
2019-10-11 12:16:49 +08:00
; CHECK-NEXT: vpmovuswb %ymm0, (%rsi)
2019-10-11 12:02:04 +08:00
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
%a = load < 16 x i32 > , < 16 x i32 > * %p
%b = icmp slt < 16 x i32 > %a , < i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 >
%c = select < 16 x i1 > %b , < 16 x i32 > %a , < 16 x i32 > < i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 , i32 255 >
%d = icmp sgt < 16 x i32 > %c , zeroinitializer
%e = select < 16 x i1 > %d , < 16 x i32 > %c , < 16 x i32 > zeroinitializer
%f = trunc < 16 x i32 > %e to < 16 x i8 >
store < 16 x i8 > %f , < 16 x i8 > * %q
ret void
}
2019-11-13 05:17:00 +08:00
define < 64 x i1 > @v64i1_argument_return ( < 64 x i1 > %x ) "min-legal-vector-width" = "256" {
; CHECK-LABEL: v64i1_argument_return:
; CHECK: # %bb.0:
; CHECK-NEXT: retq
ret < 64 x i1 > %x
}
define void @v64i1_shuffle ( < 64 x i8 > * %x , < 64 x i8 > * %y ) "min-legal-vector-width" = "256" {
; CHECK-LABEL: v64i1_shuffle:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vmovdqa (%rdi), %ymm0
; CHECK-NEXT: vmovdqa 32(%rdi), %ymm1
; CHECK-NEXT: vptestnmb %ymm1, %ymm1, %k0
; CHECK-NEXT: vptestnmb %ymm0, %ymm0, %k1
; CHECK-NEXT: vpmovm2b %k1, %ymm2
; CHECK-NEXT: vmovdqa {{.*#+}} ymm3 = [1,0,3,2,5,4,7,6,9,8,11,10,13,12,15,14,1,0,3,2,5,4,7,6,9,8,11,10,13,12,15,14]
; CHECK-NEXT: vpshufb %ymm3, %ymm2, %ymm2
; CHECK-NEXT: vpmovb2m %ymm2, %k1
; CHECK-NEXT: vpmovm2b %k0, %ymm2
; CHECK-NEXT: vpshufb %ymm3, %ymm2, %ymm2
; CHECK-NEXT: vpmovb2m %ymm2, %k2
; CHECK-NEXT: vmovdqu8 %ymm1, 32(%rsi) {%k2}
; CHECK-NEXT: vmovdqu8 %ymm0, (%rsi) {%k1}
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
entry:
%a = load < 64 x i8 > , < 64 x i8 > * %x
%b = icmp eq < 64 x i8 > %a , zeroinitializer
%shuf = shufflevector < 64 x i1 > %b , < 64 x i1 > undef , < 64 x i32 > < i32 1 , i32 0 , i32 3 , i32 2 , i32 5 , i32 4 , i32 7 , i32 6 , i32 9 , i32 8 , i32 11 , i32 10 , i32 13 , i32 12 , i32 15 , i32 14 , i32 17 , i32 16 , i32 19 , i32 18 , i32 21 , i32 20 , i32 23 , i32 22 , i32 25 , i32 24 , i32 27 , i32 26 , i32 29 , i32 28 , i32 31 , i32 30 , i32 33 , i32 32 , i32 35 , i32 34 , i32 37 , i32 36 , i32 39 , i32 38 , i32 41 , i32 40 , i32 43 , i32 42 , i32 45 , i32 44 , i32 47 , i32 46 , i32 49 , i32 48 , i32 51 , i32 50 , i32 53 , i32 52 , i32 55 , i32 54 , i32 57 , i32 56 , i32 59 , i32 58 , i32 61 , i32 60 , i32 63 , i32 62 >
call void @llvm.masked.store.v64i8.p0v64i8 ( < 64 x i8 > %a , < 64 x i8 > * %y , i32 1 , < 64 x i1 > %shuf )
ret void
}
declare void @llvm.masked.store.v64i8.p0v64i8 ( < 64 x i8 > , < 64 x i8 > * , i32 , < 64 x i1 > )