nir: fix shfr constant folding with zero src2
No fossil-db changes.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: 08903bbe89 ("nir: add mqsad_4x8, shfr and nir_opt_mqsad")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31808>
This commit is contained in:
@@ -885,8 +885,8 @@ opcode("uror", 0, tuint, [0, 0], [tuint, tuint32], False, "", """
|
||||
|
||||
opcode("shfr", 0, tuint32, [0, 0, 0], [tuint32, tuint32, tuint32], False, "", """
|
||||
uint32_t rotate_mask = sizeof(src0) * 8 - 1;
|
||||
dst = (src1 >> (src2 & rotate_mask)) |
|
||||
(src0 << (-src2 & rotate_mask));
|
||||
uint64_t src = src1 | ((uint64_t)src0 << 32);
|
||||
dst = src >> (src2 & rotate_mask);
|
||||
""")
|
||||
|
||||
bitwise_description = """
|
||||
|
||||
Reference in New Issue
Block a user