forked from OSchip/llvm-project
[X86] Simplify lowerVectorShuffleAsBitMask to handle only integer VT's
Summary: This function is only called with integer VT arguments, so remove code that handles FP vectors. Reviewers: RKSimon, craig.topper, delena, andreadb Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26985 llvm-svn: 287743
This commit is contained in:
parent
768c6f0ca6
commit
14aba43ea9
|
@ -7627,16 +7627,11 @@ static SDValue lowerVectorShuffleAsBitMask(const SDLoc &DL, MVT VT, SDValue V1,
|
||||||
SDValue V2, ArrayRef<int> Mask,
|
SDValue V2, ArrayRef<int> Mask,
|
||||||
const SmallBitVector &Zeroable,
|
const SmallBitVector &Zeroable,
|
||||||
SelectionDAG &DAG) {
|
SelectionDAG &DAG) {
|
||||||
|
assert(!VT.isFloatingPoint() && "Floating point types are not supported");
|
||||||
MVT EltVT = VT.getVectorElementType();
|
MVT EltVT = VT.getVectorElementType();
|
||||||
int NumEltBits = EltVT.getSizeInBits();
|
SDValue Zero = DAG.getConstant(0, DL, EltVT);
|
||||||
MVT IntEltVT = MVT::getIntegerVT(NumEltBits);
|
SDValue AllOnes =
|
||||||
SDValue Zero = DAG.getConstant(0, DL, IntEltVT);
|
DAG.getConstant(APInt::getAllOnesValue(EltVT.getSizeInBits()), DL, EltVT);
|
||||||
SDValue AllOnes = DAG.getConstant(APInt::getAllOnesValue(NumEltBits), DL,
|
|
||||||
IntEltVT);
|
|
||||||
if (EltVT.isFloatingPoint()) {
|
|
||||||
Zero = DAG.getBitcast(EltVT, Zero);
|
|
||||||
AllOnes = DAG.getBitcast(EltVT, AllOnes);
|
|
||||||
}
|
|
||||||
SmallVector<SDValue, 16> VMaskOps(Mask.size(), Zero);
|
SmallVector<SDValue, 16> VMaskOps(Mask.size(), Zero);
|
||||||
SDValue V;
|
SDValue V;
|
||||||
for (int i = 0, Size = Mask.size(); i < Size; ++i) {
|
for (int i = 0, Size = Mask.size(); i < Size; ++i) {
|
||||||
|
@ -7655,10 +7650,7 @@ static SDValue lowerVectorShuffleAsBitMask(const SDLoc &DL, MVT VT, SDValue V1,
|
||||||
return SDValue(); // No non-zeroable elements!
|
return SDValue(); // No non-zeroable elements!
|
||||||
|
|
||||||
SDValue VMask = DAG.getBuildVector(VT, DL, VMaskOps);
|
SDValue VMask = DAG.getBuildVector(VT, DL, VMaskOps);
|
||||||
V = DAG.getNode(VT.isFloatingPoint()
|
return DAG.getNode(ISD::AND, DL, VT, V, VMask);
|
||||||
? (unsigned) X86ISD::FAND : (unsigned) ISD::AND,
|
|
||||||
DL, VT, V, VMask);
|
|
||||||
return V;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Try to emit a blend instruction for a shuffle using bit math.
|
/// \brief Try to emit a blend instruction for a shuffle using bit math.
|
||||||
|
|
Loading…
Reference in New Issue