mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-21 23:50:22 +01:00
nir: Avoid UB of (int)0xff << 24 evaluating usadd_4x8_vc4.
Caught by UBSan on introduction of nir_opt_algebraic_pattern_test. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39184>
This commit is contained in:
parent
a8224e3e00
commit
feffd0e445
1 changed files with 1 additions and 1 deletions
|
|
@ -1502,7 +1502,7 @@ if (!isnormal(dst))
|
|||
binop("usadd_4x8_vc4", tint32, _2src_commutative + associative, """
|
||||
dst = 0;
|
||||
for (int i = 0; i < 32; i += 8) {
|
||||
dst |= MIN2(((src0 >> i) & 0xff) + ((src1 >> i) & 0xff), 0xff) << i;
|
||||
dst |= (uint32_t)MIN2(((src0 >> i) & 0xff) + ((src1 >> i) & 0xff), 0xff) << i;
|
||||
}
|
||||
""")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue