Skip to content

Commit 3bd3fa6

Browse files
authored
[NFC][SystemZ] Use SExt for signed constants (#118803)
Use SExt instead of ZExt in XForms which produce a signed value. This is only to make it clear that the XForm handles a signed value.
1 parent 59a9e4d commit 3bd3fa6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Target/SystemZ/SystemZOperands.td

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def NEGLF32 : SDNodeXForm<imm, [{
220220

221221
// Truncate an immediate to a 8-bit signed quantity.
222222
def SIMM8 : SDNodeXForm<imm, [{
223-
return CurDAG->getSignedTargetConstant(int8_t(N->getZExtValue()), SDLoc(N),
223+
return CurDAG->getSignedTargetConstant(int8_t(N->getSExtValue()), SDLoc(N),
224224
MVT::i64);
225225
}]>;
226226

@@ -244,13 +244,13 @@ def UIMM12 : SDNodeXForm<imm, [{
244244

245245
// Truncate an immediate to a 16-bit signed quantity.
246246
def SIMM16 : SDNodeXForm<imm, [{
247-
return CurDAG->getSignedTargetConstant(int16_t(N->getZExtValue()), SDLoc(N),
247+
return CurDAG->getSignedTargetConstant(int16_t(N->getSExtValue()), SDLoc(N),
248248
MVT::i64);
249249
}]>;
250250

251251
// Negate and then truncate an immediate to a 16-bit signed quantity.
252252
def NEGSIMM16 : SDNodeXForm<imm, [{
253-
return CurDAG->getSignedTargetConstant(int16_t(-N->getZExtValue()), SDLoc(N),
253+
return CurDAG->getSignedTargetConstant(int16_t(-N->getSExtValue()), SDLoc(N),
254254
MVT::i64);
255255
}]>;
256256

@@ -262,13 +262,13 @@ def UIMM16 : SDNodeXForm<imm, [{
262262

263263
// Truncate an immediate to a 32-bit signed quantity.
264264
def SIMM32 : SDNodeXForm<imm, [{
265-
return CurDAG->getSignedTargetConstant(int32_t(N->getZExtValue()), SDLoc(N),
265+
return CurDAG->getSignedTargetConstant(int32_t(N->getSExtValue()), SDLoc(N),
266266
MVT::i64);
267267
}]>;
268268

269269
// Negate and then truncate an immediate to a 32-bit unsigned quantity.
270270
def NEGSIMM32 : SDNodeXForm<imm, [{
271-
return CurDAG->getSignedTargetConstant(int32_t(-N->getZExtValue()), SDLoc(N),
271+
return CurDAG->getSignedTargetConstant(int32_t(-N->getSExtValue()), SDLoc(N),
272272
MVT::i64);
273273
}]>;
274274

0 commit comments

Comments
 (0)