Skip to content

Commit 3699931

Browse files
committed
[M68k] Use getSignedConstant() where necessary
1 parent 4715dec commit 3699931

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

llvm/lib/Target/M68k/M68kISelDAGToDAG.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,17 +289,17 @@ class M68kDAGToDAGISel : public SelectionDAGISel {
289289

290290
/// Return a target constant with the specified value of type i8.
291291
inline SDValue getI8Imm(int64_t Imm, const SDLoc &DL) {
292-
return CurDAG->getTargetConstant(Imm, DL, MVT::i8);
292+
return CurDAG->getSignedTargetConstant(Imm, DL, MVT::i8);
293293
}
294294

295295
/// Return a target constant with the specified value of type i8.
296296
inline SDValue getI16Imm(int64_t Imm, const SDLoc &DL) {
297-
return CurDAG->getTargetConstant(Imm, DL, MVT::i16);
297+
return CurDAG->getSignedTargetConstant(Imm, DL, MVT::i16);
298298
}
299299

300300
/// Return a target constant with the specified value, of type i32.
301301
inline SDValue getI32Imm(int64_t Imm, const SDLoc &DL) {
302-
return CurDAG->getTargetConstant(Imm, DL, MVT::i32);
302+
return CurDAG->getSignedTargetConstant(Imm, DL, MVT::i32);
303303
}
304304

305305
/// Return a reference to the TargetInstrInfo, casted to the target-specific

llvm/lib/Target/M68k/M68kISelLowering.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2947,7 +2947,7 @@ void M68kTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
29472947
llvm_unreachable("Unhandled constant constraint");
29482948
}
29492949

2950-
Result = DAG.getTargetConstant(Val, SDLoc(Op), Op.getValueType());
2950+
Result = DAG.getSignedTargetConstant(Val, SDLoc(Op), Op.getValueType());
29512951
break;
29522952
}
29532953
default:
@@ -2983,7 +2983,7 @@ void M68kTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
29832983
llvm_unreachable("Unhandled constant constraint");
29842984
}
29852985

2986-
Result = DAG.getTargetConstant(Val, SDLoc(Op), Op.getValueType());
2986+
Result = DAG.getSignedTargetConstant(Val, SDLoc(Op), Op.getValueType());
29872987
break;
29882988
}
29892989
default:
@@ -3415,7 +3415,7 @@ SDValue M68kTargetLowering::LowerDYNAMIC_STACKALLOC(SDValue Op,
34153415
Result = DAG.getNode(ISD::SUB, DL, VT, SP, Size); // Value
34163416
if (Align > StackAlign)
34173417
Result = DAG.getNode(ISD::AND, DL, VT, Result,
3418-
DAG.getConstant(-(uint64_t)Align, DL, VT));
3418+
DAG.getSignedConstant(-(uint64_t)Align, DL, VT));
34193419
Chain = DAG.getCopyToReg(Chain, DL, SPReg, Result); // Output chain
34203420
}
34213421

@@ -3442,7 +3442,7 @@ SDValue M68kTargetLowering::LowerShiftLeftParts(SDValue Op,
34423442

34433443
SDValue Zero = DAG.getConstant(0, DL, VT);
34443444
SDValue One = DAG.getConstant(1, DL, VT);
3445-
SDValue MinusRegisterSize = DAG.getConstant(-32, DL, VT);
3445+
SDValue MinusRegisterSize = DAG.getSignedConstant(-32, DL, VT);
34463446
SDValue RegisterSizeMinus1 = DAG.getConstant(32 - 1, DL, VT);
34473447
SDValue ShamtMinusRegisterSize =
34483448
DAG.getNode(ISD::ADD, DL, VT, Shamt, MinusRegisterSize);
@@ -3494,7 +3494,7 @@ SDValue M68kTargetLowering::LowerShiftRightParts(SDValue Op, SelectionDAG &DAG,
34943494

34953495
SDValue Zero = DAG.getConstant(0, DL, VT);
34963496
SDValue One = DAG.getConstant(1, DL, VT);
3497-
SDValue MinusRegisterSize = DAG.getConstant(-32, DL, VT);
3497+
SDValue MinusRegisterSize = DAG.getSignedConstant(-32, DL, VT);
34983498
SDValue RegisterSizeMinus1 = DAG.getConstant(32 - 1, DL, VT);
34993499
SDValue ShamtMinusRegisterSize =
35003500
DAG.getNode(ISD::ADD, DL, VT, Shamt, MinusRegisterSize);

0 commit comments

Comments
 (0)