diff --git a/src/panfrost/compiler/compiler.h b/src/panfrost/compiler/compiler.h index f1d98a8463c..835450e824f 100644 --- a/src/panfrost/compiler/compiler.h +++ b/src/panfrost/compiler/compiler.h @@ -79,8 +79,10 @@ bi_apply_swizzle(uint32_t value, enum bi_swizzle swz) const uint16_t *h = (const uint16_t *)&value; const uint8_t *b = (const uint8_t *)&value; -#define H(h0, h1) (h[h0] | (h[h1] << 16)) -#define B(b0, b1, b2, b3) (b[b0] | (b[b1] << 8) | (b[b2] << 16) | (b[b3] << 24)) +#define H(h0, h1) (h[h0] | ((uint32_t)h[h1] << 16)) +#define B(b0, b1, b2, b3) \ + (b[b0] | ((uint32_t)b[b1] << 8) | ((uint32_t)b[b2] << 16) | \ + ((uint32_t)b[b3] << 24)) switch (swz) { case BI_SWIZZLE_H00: