mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 19:58:09 +02:00
nir: Fix C UB in imad24_ir3 evaluation.
Same fix as imul24, technically you can't shift into the top bit of the int32, but the util helper does it right. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
This commit is contained in:
parent
5409d872f7
commit
ce7ad2639a
1 changed files with 1 additions and 1 deletions
|
|
@ -1361,7 +1361,7 @@ dst = (((int32_t)(((uint32_t)src0 & 0x0000ffff) << 16) * (src1 & 0xffff0000)) >>
|
|||
#
|
||||
# 24b multiply into 32b result (with sign extension) plus 32b int
|
||||
triop("imad24_ir3", tint32, _2src_commutative,
|
||||
"(((int32_t)src0 << 8) >> 8) * (((int32_t)src1 << 8) >> 8) + src2")
|
||||
"util_mask_sign_extend(src0, 24) * util_mask_sign_extend(src1, 24) + src2")
|
||||
|
||||
def triop_shift_ir3(name, shift_op, bit_op):
|
||||
opcode(name, 0, tuint, [0, 0, 0], [tuint, tuint32, tuint], False, "",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue