Module: Mesa Branch: staging/20.0 Commit: 787cecdb02f9345eeb28d3e13b96494c3d6dae61 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=787cecdb02f9345eeb28d3e13b96494c3d6dae61
Author: Ian Romanick <[email protected]> Date: Thu Apr 2 12:14:12 2020 -0700 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: 1f72857739b ("nir/algebraic: add some half packing optimizations") Reviewed-by: Rhys Perry <[email protected]> Reviewed-by: Matt Turner <[email protected]> Cc: Connor Abbott <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4515> (cherry picked from commit a2bf41ec6527fbedc2a75a8072d7222298bca347) --- .pick_status.json | 2 +- src/compiler/nir/nir_opt_algebraic.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index ae7bcd234c5..abd9f5b6a08 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -247,7 +247,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" }, diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index 94c8836cbf7..e870bff4868 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -936,7 +936,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))), _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
