diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-03-03 21:55:01 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-03-03 21:55:01 +0000 |
commit | f33cb61471c0feb31aa97f52273ec5c3799b5ac9 (patch) | |
tree | 4ebe3d2a4c172a34dd9b7426e91cf852dea41eee /llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp | |
parent | 05920b14c8892d8183eb6df0cae8659d9d1dd9e3 (diff) | |
download | llvm-f33cb61471c0feb31aa97f52273ec5c3799b5ac9.zip llvm-f33cb61471c0feb31aa97f52273ec5c3799b5ac9.tar.gz llvm-f33cb61471c0feb31aa97f52273ec5c3799b5ac9.tar.bz2 |
[X86][AVX512BW] Fixed 512-bit PSHUFB shuffle mask decode and added combine test.
PSHUFB decoder was assuming that input was 128 or 256-bit vector only.
llvm-svn: 262661
Diffstat (limited to 'llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp')
-rw-r--r-- | llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp b/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp index e2e3f8c..5c99926 100644 --- a/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp +++ b/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp @@ -314,9 +314,9 @@ void DecodePSHUFBMask(ArrayRef<uint64_t> RawMask, ShuffleMask.push_back(M); continue; } - // For AVX vectors with 32 bytes the base of the shuffle is the half of - // the vector we're inside. - int Base = i < 16 ? 0 : 16; + // For 256/512-bit vectors the base of the shuffle is the 128-bit + // subvector we're inside. + int Base = (i / 16) * 16; // If the high bit (7) of the byte is set, the element is zeroed. if (M & (1 << 7)) ShuffleMask.push_back(SM_SentinelZero); |