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

Kai Nacke via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 05:34:45 PST 2024


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

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

>From 5b9884d2021855fe13b02e2a649326f671df98e0 Mon Sep 17 00:00:00 2001
From: Kai Nacke <kai.peter.nacke at ibm.com>
Date: Wed, 4 Dec 2024 08:33:56 -0500
Subject: [PATCH] [SystemZ] SIMM32 is a signed constant

A follow-up to PR #117181: SIMM32 must use getSignedTargetConstant(), too.
---
 llvm/lib/Target/SystemZ/SystemZOperands.td | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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.



More information about the llvm-commits mailing list