summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2019-08-27 11:35:00 +0200
committerDylan Baker <dylan@pnwbakers.com>2019-09-04 16:25:49 -0700
commit3ef013f0e986652bedbe7b2b8f9904113c866105 (patch)
treedfc9898721de7777804ab62b8e465f52081eb3da
parentb84cbdfd4da9607100e5a6ae0d2fc0ee707953b2 (diff)
downloadmesa-3ef013f0e986652bedbe7b2b8f9904113c866105.tar.gz
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 <samuel.pitoiset@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit 966a455bb912cc9fd22580c6cf9b74e27faa4491) (conflicts resolved by Dylan Baker)
-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 28ed8ac846e..114dedb49c1 100644
--- a/src/compiler/nir/nir_range_analysis.c
+++ b/src/compiler/nir/nir_range_analysis.c
@@ -463,6 +463,7 @@ analyze_expression(const nir_alu_instr *instr, unsigned src,
r = analyze_expression(alu, 0, ht);
+ r.is_integral = r.is_integral && is_not_negative(r.range);
r.range = table[r.range];
break;
}