@@ -1613,7 +1613,7 @@ SDValue DAGTypeLegalizer::PromoteIntRes_FunnelShift(SDNode *N) {
1613
1613
// fshr(x,y,z) -> (((aext(x) << bw) | zext(y)) >> (z % bw)).
1614
1614
if (NewBits >= (2 * OldBits) && !isa<ConstantSDNode>(Amt) &&
1615
1615
!TLI.isOperationLegalOrCustom (Opcode, VT)) {
1616
- SDValue HiShift = DAG.getConstant (OldBits, DL, VT );
1616
+ SDValue HiShift = DAG.getShiftAmountConstant (OldBits, VT, DL );
1617
1617
Hi = DAG.getNode (ISD::SHL, DL, VT, Hi, HiShift);
1618
1618
Lo = DAG.getZeroExtendInReg (Lo, DL, OldVT);
1619
1619
SDValue Res = DAG.getNode (ISD::OR, DL, VT, Hi, Lo);
@@ -1624,13 +1624,14 @@ SDValue DAGTypeLegalizer::PromoteIntRes_FunnelShift(SDNode *N) {
1624
1624
}
1625
1625
1626
1626
// Shift Lo up to occupy the upper bits of the promoted type.
1627
- SDValue ShiftOffset = DAG.getConstant (NewBits - OldBits , DL, AmtVT);
1628
- Lo = DAG.getNode (ISD::SHL, DL , VT, Lo, ShiftOffset );
1627
+ Lo = DAG.getNode (ISD::SHL , DL, VT, Lo,
1628
+ DAG.getShiftAmountConstant (NewBits - OldBits , VT, DL) );
1629
1629
1630
1630
// Increase Amount to shift the result into the lower bits of the promoted
1631
1631
// type.
1632
1632
if (IsFSHR)
1633
- Amt = DAG.getNode (ISD::ADD, DL, AmtVT, Amt, ShiftOffset);
1633
+ Amt = DAG.getNode (ISD::ADD, DL, AmtVT, Amt,
1634
+ DAG.getConstant (NewBits - OldBits, DL, VT));
1634
1635
1635
1636
return DAG.getNode (Opcode, DL, VT, Hi, Lo, Amt);
1636
1637
}
0 commit comments