diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index 34eec399ef1..9817f477e32 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -1676,6 +1676,8 @@ optimizations.extend([ (('~fmul', ('bcsel(is_used_once)', c, 1.0, -1.0), b), ('bcsel', c, b, ('fneg', b))), (('~fmulz', ('bcsel(is_used_once)', c, -1.0, 1.0), b), ('bcsel', c, ('fneg', b), b)), (('~fmulz', ('bcsel(is_used_once)', c, 1.0, -1.0), b), ('bcsel', c, b, ('fneg', b))), + (('fabs', ('bcsel(is_used_once)', b, ('fneg', a), a)), ('fabs', a)), + (('fabs', ('bcsel(is_used_once)', b, a, ('fneg', a))), ('fabs', a)), (('~bcsel', ('flt', a, 0.0), ('fneg', a), a), ('fabs', a)), (('bcsel', a, ('bcsel', b, c, d), d), ('bcsel', ('iand', a, b), c, d)),