Mesa (staging/19.2): nir: do not assume that the result of fexp2(a) is always an integral

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Sep 4 23:32:20 UTC 2019


Module: Mesa
Branch: staging/19.2
Commit: 3ef013f0e986652bedbe7b2b8f9904113c866105
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3ef013f0e986652bedbe7b2b8f9904113c866105

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Tue Aug 27 11:35:00 2019 +0200

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 at gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
(cherry picked from commit 966a455bb912cc9fd22580c6cf9b74e27faa4491)
(conflicts resolved by Dylan Baker)

---

 src/compiler/nir/nir_range_analysis.c | 1 +
 1 file changed, 1 insertion(+)

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;
    }




More information about the mesa-commit mailing list