aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2018-02-26 14:49:47 -0800
committerIan Romanick <[email protected]>2018-03-06 11:17:14 -0800
commit380136e998f8d89380adba7d071249d6469339db (patch)
tree724746fc978e81f94be3ee9f4f8c1f1c7fcfa24a
parent4addd34b0477cf87787afbcea989b3391a81d0a1 (diff)
nir: Mark bcsel-to-fmin (or fmax) transformations as inexact
These transformations are inexact because section 4.7.1 (Range and Precision) says: Operations and built-in functions that operate on a NaN are not required to return a NaN as the result. The fmin or fmax might not return NaN in cases where the original expression would be required to return NaN. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r--src/compiler/nir/nir_opt_algebraic.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index ef240ae0e91..43b29484319 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -168,8 +168,8 @@ optimizations = [
(('flt(is_not_used_by_conditional)', ('fadd(is_used_once)', a, ('fneg', b)), 0.0), ('flt', a, b)),
(('fge', ('fneg', ('fabs', a)), 0.0), ('feq', a, 0.0)),
- (('bcsel', ('flt', b, a), b, a), ('fmin', a, b)),
- (('bcsel', ('flt', a, b), b, a), ('fmax', a, b)),
+ (('~bcsel', ('flt', b, a), b, a), ('fmin', a, b)),
+ (('~bcsel', ('flt', a, b), b, a), ('fmax', a, b)),
(('~bcsel', ('fge', a, b), b, a), ('fmin', a, b)),
(('~bcsel', ('fge', b, a), b, a), ('fmax', a, b)),
(('bcsel', ('inot', a), b, c), ('bcsel', a, c, b)),