mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
[X86][SSE] createVariablePermute - move source vector canonicalization to top of function. NFCI.
This is to make it easier to return early from the switch statement with custom lowering. llvm-svn: 327157
This commit is contained in:
parent
d1d0f87c24
commit
bd3a277bb8
@ -7926,6 +7926,14 @@ SDValue createVariablePermute(MVT VT, SDValue SrcVec, SDValue IndicesVec,
|
|||||||
NumElts * VT.getScalarSizeInBits());
|
NumElts * VT.getScalarSizeInBits());
|
||||||
IndicesVec = DAG.getZExtOrTrunc(IndicesVec, SDLoc(IndicesVec), IndicesVT);
|
IndicesVec = DAG.getZExtOrTrunc(IndicesVec, SDLoc(IndicesVec), IndicesVT);
|
||||||
|
|
||||||
|
// Adjust SrcVec to match VT type.
|
||||||
|
if (SrcVec.getValueSizeInBits() > VT.getSizeInBits())
|
||||||
|
return SDValue();
|
||||||
|
else if (SrcVec.getValueSizeInBits() < VT.getSizeInBits())
|
||||||
|
SrcVec =
|
||||||
|
DAG.getNode(ISD::INSERT_SUBVECTOR, SDLoc(SrcVec), VT, DAG.getUNDEF(VT),
|
||||||
|
SrcVec, DAG.getIntPtrConstant(0, SDLoc(SrcVec)));
|
||||||
|
|
||||||
unsigned Opcode = 0;
|
unsigned Opcode = 0;
|
||||||
switch (VT.SimpleTy) {
|
switch (VT.SimpleTy) {
|
||||||
default:
|
default:
|
||||||
@ -8004,14 +8012,6 @@ SDValue createVariablePermute(MVT VT, SDValue SrcVec, SDValue IndicesVec,
|
|||||||
(VT.getScalarSizeInBits() % ShuffleVT.getScalarSizeInBits()) == 0 &&
|
(VT.getScalarSizeInBits() % ShuffleVT.getScalarSizeInBits()) == 0 &&
|
||||||
"Illegal variable permute shuffle type");
|
"Illegal variable permute shuffle type");
|
||||||
|
|
||||||
if (SrcVec.getValueSizeInBits() > VT.getSizeInBits())
|
|
||||||
return SDValue();
|
|
||||||
else if (SrcVec.getValueSizeInBits() < VT.getSizeInBits()) {
|
|
||||||
SrcVec =
|
|
||||||
DAG.getNode(ISD::INSERT_SUBVECTOR, SDLoc(SrcVec), VT, DAG.getUNDEF(VT),
|
|
||||||
SrcVec, DAG.getIntPtrConstant(0, SDLoc(SrcVec)));
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t Scale = VT.getScalarSizeInBits() / ShuffleVT.getScalarSizeInBits();
|
uint64_t Scale = VT.getScalarSizeInBits() / ShuffleVT.getScalarSizeInBits();
|
||||||
if (Scale > 1) {
|
if (Scale > 1) {
|
||||||
assert(isPowerOf2_64(Scale) && "Illegal variable permute shuffle scale");
|
assert(isPowerOf2_64(Scale) && "Illegal variable permute shuffle scale");
|
||||||
|
Loading…
Reference in New Issue
Block a user