From 30db807f790fb13747c1cff5bbed117131e2d78e Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 28 Jun 2024 07:17:13 -0400 Subject: [PATCH] nir/algebraic: explicitly suffix constants Make our intentions super duper clear. Signed-off-by: Alyssa Rosenzweig Suggested-by: Faith Ekstrand Reviewed-by: Faith Ekstrand Part-of: --- src/compiler/nir/nir_algebraic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/nir/nir_algebraic.py b/src/compiler/nir/nir_algebraic.py index b7efcf93c91..75f7390aa77 100644 --- a/src/compiler/nir/nir_algebraic.py +++ b/src/compiler/nir/nir_algebraic.py @@ -258,11 +258,11 @@ class Constant(Value): # Explicitly sign-extend negative integers to 64-bit, ensuring correct # handling of -INT32_MIN which is not representable in 32-bit. if self.value < 0: - return hex(struct.unpack('Q', struct.pack('q', self.value))[0]) + return hex(struct.unpack('Q', struct.pack('q', self.value))[0]) + 'ull' else: - return hex(self.value) + return hex(self.value) + 'ull' elif isinstance(self.value, float): - return hex(struct.unpack('Q', struct.pack('d', self.value))[0]) + return hex(struct.unpack('Q', struct.pack('d', self.value))[0]) + 'ull' else: assert False