From bfe5ac89b2ddcc18bbf1ea64e92a0a0efecba436 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 15 Jan 2021 08:51:39 -0800 Subject: [PATCH] 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: e7630ec278f ("freedreno/hw: Add isaspec mechanism for documenting/defining an ISA") Signed-off-by: Rob Clark Part-of: --- src/freedreno/isa/encode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedreno/isa/encode.py b/src/freedreno/isa/encode.py index 576fef626ac..699d5c9b660 100644 --- a/src/freedreno/isa/encode.py +++ b/src/freedreno/isa/encode.py @@ -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; }