freedreno/isa: Fix branch/jump offset encoding

When cross compiling with clang, `1ul` would end up 32b instead of 64b,
resulting in 32b fields (like branch/jump offsets) being encoded as
zero.  Which results in infinite loops.

Fixes: e7630ec278 ("freedreno/hw: Add isaspec mechanism for documenting/defining an ISA")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8528>
This commit is contained in:
Rob Clark 2021-01-15 08:51:39 -08:00 committed by Marge Bot
parent c27347b2e1
commit bfe5ac89b2

View file

@ -345,7 +345,7 @@ struct bitset_params;
static uint64_t
pack_field(unsigned low, unsigned high, uint64_t val)
{
val &= ((1ul << (1 + high - low)) - 1);
val &= ((UINT64_C(1) << (1 + high - low)) - 1);
return val << low;
}