mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
[x86] Switch to a formulation of a for loop that is much more obviously
not corrupting the mask by mutating it more times than intended. No functionality changed (the results were non-overlapping so the old version "worked" but was non-obvious). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214953 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2b9b50379b
commit
346b68772b
@ -7519,9 +7519,10 @@ static SDValue lowerV8I16SingleInputVectorShuffle(
|
||||
int FreeDWord = (PSHUFDMask[DestOffset / 2] == -1 ? 0 : 1) + DestOffset / 2;
|
||||
assert(PSHUFDMask[FreeDWord] == -1 && "DWord not free");
|
||||
PSHUFDMask[FreeDWord] = IncomingInputs[0] / 2;
|
||||
for (int Input : IncomingInputs)
|
||||
std::replace(HalfMask.begin(), HalfMask.end(), Input,
|
||||
FreeDWord * 2 + Input % 2);
|
||||
for (int &M : HalfMask)
|
||||
for (int Input : IncomingInputs)
|
||||
if (M == Input)
|
||||
M = FreeDWord * 2 + Input % 2;
|
||||
};
|
||||
moveInputsToRightHalf(HToLInputs, LToLInputs, PSHUFHMask, LoMask,
|
||||
/*SourceOffset*/ 4, /*DestOffset*/ 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user