nir/algebraic: a & ~(a >> 31) -> imax(a, 0)
authorRhys Perry <pendingchaos02@gmail.com>
Tue, 10 Dec 2019 16:20:56 +0000 (16:20 +0000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 14 Jan 2020 17:54:40 +0000 (17:54 +0000)
commitcc3ef3643a6d05f2f08b20828934807e3c49f5af
tree66328c37c37ed9600abce60a7a00f6bbadf2d399
parent1607123ae7504ead15129b2a90506811d9e26b6d
nir/algebraic: a & ~(a >> 31) -> imax(a, 0)

Found in some Doom shaders

Totals from affected shaders:
SGPRS: 30056 -> 30064 (0.03 %)
VGPRS: 28024 -> 28024 (0.00 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Code Size: 4278648 -> 4270852 (-0.18 %) bytes
Max Waves: 1476 -> 1476 (0.00 %)
Instructions: 835287 -> 833338 (-0.23 %)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3089>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3089>
src/compiler/nir/nir_opt_algebraic.py