nir/algebraic: explicitly suffix constants
Make our intentions super duper clear. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Suggested-by: Faith Ekstrand <faith.ekstrand@collabora.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29952>
This commit is contained in:

committed by
Marge Bot

parent
270446ee21
commit
30db807f79
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user