diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-10-29 18:25:48 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-10-29 18:25:48 +0000 |
commit | 3a2f3c2c0a1accb241726b11780c177f3cd13410 (patch) | |
tree | a1a4e21944a730eae2b633aded3334cb02b89bdc /llvm/lib/Target | |
parent | 220fd33522caef69faf8b22707130cc114b64164 (diff) | |
download | bcm5719-llvm-3a2f3c2c0a1accb241726b11780c177f3cd13410.tar.gz bcm5719-llvm-3a2f3c2c0a1accb241726b11780c177f3cd13410.zip |
[X86][SSE] getFauxShuffleMask - Fix shuffle mask adjustment for multiple inserted subvectors
Part of the issue discovered in PR39483, although its not fully exposed until I reapply rL345395 (by reverting rL345451)
llvm-svn: 345520
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index f2c5040b89e..35239b79f18 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -6379,13 +6379,12 @@ static bool getFauxShuffleMask(SDValue N, SmallVectorImpl<int> &Mask, Mask.push_back(i); for (int i = 0; i != (int)NumSubElts; ++i) { int M = SubMask[i]; - if (M < 0) { - Mask[i + InsertIdx] = M; - } else { + if (0 <= M) { int InputIdx = M / NumSubElts; int ExtractIdx = SubInputs[InputIdx].getConstantOperandVal(1); - Mask[i + InsertIdx] = (NumElts * (1 + InputIdx)) + ExtractIdx + M; + M = (NumElts * (1 + InputIdx)) + ExtractIdx + (M % NumSubElts); } + Mask[i + InsertIdx] = M; } // TODO - Add support for more than 1 subinput. return Ops.size() <= 2; |