Skip to content

Commit 22d8ba3

Browse files
committed
[X86] getConstVector - use APInt::extractBits instead of shift+mask. NFC.
1 parent 53d433e commit 22d8ba3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4001,8 +4001,8 @@ static SDValue getConstVector(ArrayRef<APInt> Bits, const APInt &Undefs,
40014001
const APInt &V = Bits[i];
40024002
assert(V.getBitWidth() == VT.getScalarSizeInBits() && "Unexpected sizes");
40034003
if (Split) {
4004-
Ops.push_back(DAG.getConstant(V.trunc(32), dl, EltVT));
4005-
Ops.push_back(DAG.getConstant(V.lshr(32).trunc(32), dl, EltVT));
4004+
Ops.push_back(DAG.getConstant(V.extractBits(32, 0), dl, EltVT));
4005+
Ops.push_back(DAG.getConstant(V.extractBits(32, 32), dl, EltVT));
40064006
} else if (EltVT == MVT::f32) {
40074007
APFloat FV(APFloat::IEEEsingle(), V);
40084008
Ops.push_back(DAG.getConstantFP(FV, dl, EltVT));

0 commit comments

Comments
 (0)