[llvm] [SystemZ] SIMM32 is a signed constant (PR #118634)

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 05:35:19 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-systemz

Author: Kai Nacke (redstar)

<details>
<summary>Changes</summary>

A follow-up to PR #<!-- -->117181: SIMM32 must use getSignedTargetConstant(), too.

---
Full diff: https://github.com/llvm/llvm-project/pull/118634.diff


1 Files Affected:

- (modified) llvm/lib/Target/SystemZ/SystemZOperands.td (+2-2) 


``````````diff
diff --git a/llvm/lib/Target/SystemZ/SystemZOperands.td b/llvm/lib/Target/SystemZ/SystemZOperands.td
index 64345ca3a1394e..5349e0d9a8512c 100644
--- a/llvm/lib/Target/SystemZ/SystemZOperands.td
+++ b/llvm/lib/Target/SystemZ/SystemZOperands.td
@@ -262,8 +262,8 @@ def UIMM16 : SDNodeXForm<imm, [{
 
 // Truncate an immediate to a 32-bit signed quantity.
 def SIMM32 : SDNodeXForm<imm, [{
-  return CurDAG->getTargetConstant(int32_t(N->getZExtValue()), SDLoc(N),
-                                   MVT::i64);
+  return CurDAG->getSignedTargetConstant(int32_t(N->getZExtValue()), SDLoc(N),
+                                         MVT::i64);
 }]>;
 
 // Negate and then truncate an immediate to a 32-bit unsigned quantity.

``````````

</details>


https://github.com/llvm/llvm-project/pull/118634


More information about the llvm-commits mailing list