mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
nir/algebraic: Optimize ushr of pack_half, not ishr
When a = -1.0, pack_half_2x16(vec2(0x0000, 0xBC00)) will produce 0xBC000000. The ishr will produce 0xFFFFBC00. The replacement pack_half_2x16(vec2(0xBC00, 0x0000)) will produce 0x0000BC00. Fixes:1f72857739("nir/algebraic: add some half packing optimizations") Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Cc: Connor Abbott <cwabbott0@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4515> (cherry picked from commita2bf41ec65)
This commit is contained in:
parent
fa01a9397f
commit
750a0125df
2 changed files with 2 additions and 2 deletions
|
|
@ -661,7 +661,7 @@
|
|||
"description": "nir/algebraic: Optimize ushr of pack_half, not ishr",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "1f72857739beed55276f263f49b3802c336b8c58"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -998,7 +998,7 @@ optimizations.extend([
|
|||
|
||||
# Optimize half packing
|
||||
(('ishl', ('pack_half_2x16', ('vec2', a, 0)), 16), ('pack_half_2x16', ('vec2', 0, a))),
|
||||
(('ishr', ('pack_half_2x16', ('vec2', 0, a)), 16), ('pack_half_2x16', ('vec2', a, 0))),
|
||||
(('ushr', ('pack_half_2x16', ('vec2', 0, a)), 16), ('pack_half_2x16', ('vec2', a, 0))),
|
||||
|
||||
(('iadd', ('pack_half_2x16', ('vec2', a, 0)), ('pack_half_2x16', ('vec2', 0, b))),
|
||||
('pack_half_2x16', ('vec2', a, b))),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue