This avoids the use of getZExtValue and uses the modulo shift amount which is whats expected for funnel shifts anyhow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365016
91177308-0d34-0410-b5e6-
96231b3b80d8
APInt APIntShiftAmt;
if (isConstantSplat(Amt, APIntShiftAmt)) {
- uint64_t ShiftAmt = APIntShiftAmt.getZExtValue();
+ uint64_t ShiftAmt = APIntShiftAmt.urem(VT.getScalarSizeInBits());
return DAG.getNode(IsFSHR ? X86ISD::VSHRD : X86ISD::VSHLD, DL, VT,
Op0, Op1, DAG.getConstant(ShiftAmt, DL, MVT::i8));
}