diff --git a/.pick_status.json b/.pick_status.json index de0605b72707..b193c123ae6f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -8254,7 +8254,7 @@ "description": "panfrost: upcast uint8/uint16 before shifting them beyond their range", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/panfrost/compiler/compiler.h b/src/panfrost/compiler/compiler.h index f70a4d2d0763..61d5e557f9c4 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: