diff options
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 533ee7c6a43..872f3d5d12a 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -5318,12 +5318,11 @@ static bool getTargetConstantBitsFromNode(SDValue Op, unsigned EltSizeInBits, return true; } if (auto *CInt = dyn_cast<ConstantInt>(Cst)) { - Mask |= CInt->getValue().zextOrTrunc(SizeInBits).shl(BitOffset); + Mask.insertBits(CInt->getValue(), BitOffset); return true; } if (auto *CFP = dyn_cast<ConstantFP>(Cst)) { - APInt CstBits = CFP->getValueAPF().bitcastToAPInt(); - Mask |= CstBits.zextOrTrunc(SizeInBits).shl(BitOffset); + Mask.insertBits(CFP->getValueAPF().bitcastToAPInt(), BitOffset); return true; } return false; @@ -5340,7 +5339,7 @@ static bool getTargetConstantBitsFromNode(SDValue Op, unsigned EltSizeInBits, } auto *Cst = cast<ConstantSDNode>(Src); APInt Bits = Cst->getAPIntValue().zextOrTrunc(SrcEltSizeInBits); - MaskBits |= Bits.zext(SizeInBits).shl(BitOffset); + MaskBits.insertBits(Bits, BitOffset); } return SplitBitData(); } diff --git a/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp b/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp index 9190b66367c..2cebb76022e 100644 --- a/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp +++ b/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp @@ -91,8 +91,7 @@ static bool extractConstantMask(const Constant *C, unsigned MaskEltSizeInBits, continue; } - auto *Elt = cast<ConstantInt>(COp); - MaskBits |= Elt->getValue().zextOrTrunc(CstSizeInBits).shl(BitOffset); + MaskBits.insertBits(cast<ConstantInt>(COp)->getValue(), BitOffset); } // Now extract the undef/constant bit data into the raw shuffle masks. |