mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
panfrost: fix UB caused by shifting signed int too far
Fixes: 13d7ca1300 ("pan/va: Optimize add with imm to ADD_IMM")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27437>
This commit is contained in:
parent
2085d60438
commit
6250885640
1 changed files with 2 additions and 2 deletions
|
|
@ -106,9 +106,9 @@ va_fuse_add_imm(bi_instr *I)
|
|||
/* If the constant is negated, flip the sign bit */
|
||||
if (I->src[s].neg) {
|
||||
if (I->op == BI_OPCODE_FADD_IMM_F32)
|
||||
I->index ^= (1 << 31);
|
||||
I->index ^= (1u << 31);
|
||||
else if (I->op == BI_OPCODE_FADD_IMM_V2F16)
|
||||
I->index ^= (1 << 31) | (1 << 15);
|
||||
I->index ^= (1u << 31) | (1u << 15);
|
||||
else
|
||||
unreachable("unexpected .neg");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue