intel/compiler: Use assume() instead of assert() for array bounds.
This should make both GCC and clang happy and make them believe that the array bounds are not exceeded. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9634>
This commit is contained in:
parent
84f91dfea5
commit
eb378e4cd0
|
@ -1273,8 +1273,8 @@ BRW_IA16_ADDR_IMM(send_dst, -1, -1, 62, 56, 52)
|
||||||
static inline uint64_t
|
static inline uint64_t
|
||||||
brw_inst_bits(const brw_inst *inst, unsigned high, unsigned low)
|
brw_inst_bits(const brw_inst *inst, unsigned high, unsigned low)
|
||||||
{
|
{
|
||||||
assert(high < 128);
|
assume(high < 128);
|
||||||
assert(high >= low);
|
assume(high >= low);
|
||||||
/* We assume the field doesn't cross 64-bit boundaries. */
|
/* We assume the field doesn't cross 64-bit boundaries. */
|
||||||
const unsigned word = high / 64;
|
const unsigned word = high / 64;
|
||||||
assert(word == low / 64);
|
assert(word == low / 64);
|
||||||
|
@ -1295,8 +1295,8 @@ brw_inst_bits(const brw_inst *inst, unsigned high, unsigned low)
|
||||||
static inline void
|
static inline void
|
||||||
brw_inst_set_bits(brw_inst *inst, unsigned high, unsigned low, uint64_t value)
|
brw_inst_set_bits(brw_inst *inst, unsigned high, unsigned low, uint64_t value)
|
||||||
{
|
{
|
||||||
assert(high < 128);
|
assume(high < 128);
|
||||||
assert(high >= low);
|
assume(high >= low);
|
||||||
const unsigned word = high / 64;
|
const unsigned word = high / 64;
|
||||||
assert(word == low / 64);
|
assert(word == low / 64);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue