diff options
author | Matt Turner <[email protected]> | 2016-02-01 16:35:41 -0800 |
---|---|---|
committer | Matt Turner <[email protected]> | 2016-02-08 20:38:17 -0800 |
commit | 2d0d9755da92f7153c1390728fa448b9978e9135 (patch) | |
tree | 1afbc4d80b153a341ccb16575537ee1b16ddcba9 /src/gtest | |
parent | 7be8d07732295bd546130d9c8c8fb8ff64490686 (diff) |
nir: Handle large unsigned values in opt_algebraic.
The next patch adds an algebraic rule that uses the constant 0xff00ff00.
Without this change, the build fails with
return hex(struct.unpack('I', struct.pack('i', self.value))[0])
struct.error: 'i' format requires -2147483648 <= number <= 2147483647
The hex() function handles integers of any size, and assigning a
negative value to an unsigned does what we want in C. The pack/unpack is
unnecessary (and as we see, buggy).
Reviewed-by: Dylan Baker <[email protected]>
Diffstat (limited to 'src/gtest')
0 files changed, 0 insertions, 0 deletions