Skip to content

Commit e994494

Browse files
authored
[PowerPC] Use MathExtras helpers to simplify code. NFC (#104691)
1 parent 88f8010 commit e994494

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9513,10 +9513,8 @@ SDValue PPCTargetLowering::LowerBUILD_VECTOR(SDValue Op,
95139513
} else {
95149514
// We may lose precision, so we have to use XXSPLTI32DX.
95159515

9516-
uint32_t Hi =
9517-
(uint32_t)((APSplatBits.getZExtValue() & 0xFFFFFFFF00000000LL) >> 32);
9518-
uint32_t Lo =
9519-
(uint32_t)(APSplatBits.getZExtValue() & 0xFFFFFFFF);
9516+
uint32_t Hi = Hi_32(APSplatBits.getZExtValue());
9517+
uint32_t Lo = Lo_32(APSplatBits.getZExtValue());
95209518
SDValue SplatNode = DAG.getUNDEF(MVT::v2i64);
95219519

95229520
if (!Hi || !Lo)
@@ -9660,8 +9658,7 @@ SDValue PPCTargetLowering::LowerBUILD_VECTOR(SDValue Op,
96609658
dl);
96619659

96629660
// If the sign extended value is in the range [-16,15], use VSPLTI[bhw].
9663-
int32_t SextVal= (int32_t(SplatBits << (32-SplatBitSize)) >>
9664-
(32-SplatBitSize));
9661+
int32_t SextVal = SignExtend32(SplatBits, SplatBitSize);
96659662
if (SextVal >= -16 && SextVal <= 15)
96669663
return getCanonicalConstSplat(SextVal, SplatSize, Op.getValueType(), DAG,
96679664
dl);

0 commit comments

Comments
 (0)