mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-27 04:04:23 +08:00
nir/opt_algebraic: optimize convert_uint_sat(ulong)
I wrote this in my query copy shader, it didn't get the codegen I expected, so I investigated. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32208>
This commit is contained in:
parent
07ba9335ae
commit
61862b209e
@ -1976,6 +1976,12 @@ optimizations.extend([
|
||||
|
||||
(('u2f32', ('u2u64', 'a@32')), ('u2f32', a)),
|
||||
|
||||
# UINT32_MAX < a just checks the high half of a 64-bit value. This occurs
|
||||
# when lowering convert_uint_sat(ulong). Although the replacement is more
|
||||
# instructions, it replaces a 64-bit instruction with a 32-bit instruction
|
||||
# and a move that will likely be coalesced.
|
||||
(('ult', 0xffffffff, 'a@64'), ('ine', ('unpack_64_2x32_split_y', a), 0)),
|
||||
|
||||
# Redundant trip through 8-bit
|
||||
(('i2i16', ('u2u8', ('iand', 'a@16', 1))), ('iand', 'a@16', 1)),
|
||||
(('u2u16', ('u2u8', ('iand', 'a@16', 1))), ('iand', 'a@16', 1)),
|
||||
|
Loading…
Reference in New Issue
Block a user