summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-08-27 11:35:00 +0200
committerSamuel Pitoiset <[email protected]>2019-09-02 09:00:37 +0200
commit966a455bb912cc9fd22580c6cf9b74e27faa4491 (patch)
treec0fe2ad1cb26d345a9b266bbb58ee8e836cda92f /src/compiler
parent6775a524004ba15ab281c1391fb24cbf621fe859 (diff)
nir: do not assume that the result of fexp2(a) is always an integral
It's only correct when 'a' is an integral greater or equal to 0. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111493 Fixes: 5544b2cbbd2 ("nir/algebraic: Use value range analysis to eliminate useless unary ops") Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_range_analysis.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_range_analysis.c b/src/compiler/nir/nir_range_analysis.c
index a313087e056..6fec5fcd7ab 100644
--- a/src/compiler/nir/nir_range_analysis.c
+++ b/src/compiler/nir/nir_range_analysis.c
@@ -580,6 +580,7 @@ analyze_expression(const nir_alu_instr *instr, unsigned src,
ASSERT_UNION_OF_DISJOINT_MATCHES_UNKNOWN_1_SOURCE(table);
ASSERT_UNION_OF_EQ_AND_STRICT_INEQ_MATCHES_NONSTRICT_1_SOURCE(table);
+ r.is_integral = r.is_integral && is_not_negative(r.range);
r.range = table[r.range];
break;
}