diff options
author | Mark Janes <[email protected]> | 2016-02-01 14:28:00 -0800 |
---|---|---|
committer | Mark Janes <[email protected]> | 2016-02-01 14:52:22 -0800 |
commit | ac0589b213f21f22dc330d2e8fb8dceda3960ddc (patch) | |
tree | b6b68145bc85879046c479b1c0db1b1abe081ad9 /src/vulkan/gen75_pack.h | |
parent | 8776d3cb8e86d4999613590a7eeac2322acdd99f (diff) |
i965: fix unsigned long overflows for i386
bit-shifts on 32 bit unsigned longs overflow in several places. The
intention was for 64 bit integers to be used.
Diffstat (limited to 'src/vulkan/gen75_pack.h')
-rw-r--r-- | src/vulkan/gen75_pack.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vulkan/gen75_pack.h b/src/vulkan/gen75_pack.h index b012032190e..7b098894ee2 100644 --- a/src/vulkan/gen75_pack.h +++ b/src/vulkan/gen75_pack.h @@ -47,7 +47,7 @@ union __gen_value { static inline uint64_t __gen_mbo(uint32_t start, uint32_t end) { - return (~0ul >> (64 - (end - start + 1))) << start; + return (~0ull >> (64 - (end - start + 1))) << start; } static inline uint64_t @@ -56,7 +56,7 @@ __gen_field(uint64_t v, uint32_t start, uint32_t end) __gen_validate_value(v); #if DEBUG if (end - start + 1 < 64) - assert(v < 1ul << (end - start + 1)); + assert(v < 1ull << (end - start + 1)); #endif return v << start; @@ -97,7 +97,7 @@ __gen_offset(uint64_t v, uint32_t start, uint32_t end) { __gen_validate_value(v); #if DEBUG - uint64_t mask = (~0ul >> (64 - (end - start + 1))) << start; + uint64_t mask = (~0ull >> (64 - (end - start + 1))) << start; assert((v & ~mask) == 0); #endif |