diff options
Diffstat (limited to 'src/compiler/nir/nir_opt_algebraic.py')
-rw-r--r-- | src/compiler/nir/nir_opt_algebraic.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index 3b8836e6be8..434881f85bf 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -269,6 +269,10 @@ optimizations = [ (('ieq', 'a@bool', False), ('inot', 'a')), (('bcsel', a, True, False), a), (('bcsel', a, False, True), ('inot', a)), + (('bcsel@32', a, 1.0, 0.0), ('b2f', a)), + (('bcsel@32', a, 0.0, 1.0), ('b2f', ('inot', a))), + (('bcsel@32', a, -1.0, -0.0), ('fneg', ('b2f', a))), + (('bcsel@32', a, -0.0, -1.0), ('fneg', ('b2f', ('inot', a)))), (('bcsel', True, b, c), b), (('bcsel', False, b, c), c), # The result of this should be hit by constant propagation and, in the |