Mesa (main): r600/sb: Don't optimize float GT and GE

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 27 00:31:42 UTC 2022


Module: Mesa
Branch: main
Commit: 6cb510156ef47abb155b02d447684083df7d30b5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6cb510156ef47abb155b02d447684083df7d30b5

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Sun Apr 24 13:24:44 2022 +0200

r600/sb: Don't optimize float GT and GE

Sine NAN's can be involved the result can't be deducted like this.
Also with NTT inplace now we can assume that most possible
arithmetic optimizations have already been applied.

Piglit: spec at glsl-1.30@execution at range_analysis_fsat_of_nan

Fixes: a4840e15ab77b44a72cabd7d503172e8357477eb
  r600: Use nir-to-tgsi instead of TGSI when the NIR debug opt is disabled.

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16130>

---

 src/gallium/drivers/r600/ci/r600-rv770-fails.txt |  1 -
 src/gallium/drivers/r600/ci/r600-turks-fails.txt |  1 -
 src/gallium/drivers/r600/sb/sb_expr.cpp          | 20 ++++----------------
 3 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/src/gallium/drivers/r600/ci/r600-rv770-fails.txt b/src/gallium/drivers/r600/ci/r600-rv770-fails.txt
index 6a8ac0c7509..851d9cc2c7e 100644
--- a/src/gallium/drivers/r600/ci/r600-rv770-fails.txt
+++ b/src/gallium/drivers/r600/ci/r600-rv770-fails.txt
@@ -384,7 +384,6 @@ shaders at glsl-max-varyings >max_varying_components,Fail
 
 spec@!opengl 1.0 at gl-1.0-dlist-bitmap,Fail
 spec@!opengl 1.0 at gl-1.0-no-op-paths,Fail
-spec@!opengl 1.0 at gl-1.0-spot-light,Fail
 spec@!opengl 1.0 at gl-1.0-swapbuffers-behavior,Fail
 spec@!opengl 1.0 at gl-1.0-user-clip-all-planes,Fail
 
diff --git a/src/gallium/drivers/r600/ci/r600-turks-fails.txt b/src/gallium/drivers/r600/ci/r600-turks-fails.txt
index d3a843c3ffd..fc839f80cc8 100644
--- a/src/gallium/drivers/r600/ci/r600-turks-fails.txt
+++ b/src/gallium/drivers/r600/ci/r600-turks-fails.txt
@@ -1497,7 +1497,6 @@ spec at oes_shader_io_blocks@compiler at layout-location-aliasing.vert,Fail
 
 spec@!opengl 1.0 at gl-1.0-dlist-bitmap,Fail
 spec@!opengl 1.0 at gl-1.0-no-op-paths,Fail
-spec@!opengl 1.0 at gl-1.0-spot-light,Fail
 spec@!opengl 1.0 at gl-1.0-user-clip-all-planes,Fail
 spec@!opengl 1.1 at linestipple,Fail
 spec@!opengl 1.1 at linestipple@Factor 2x,Fail
diff --git a/src/gallium/drivers/r600/sb/sb_expr.cpp b/src/gallium/drivers/r600/sb/sb_expr.cpp
index 091037ce367..cabe6a13b90 100644
--- a/src/gallium/drivers/r600/sb/sb_expr.cpp
+++ b/src/gallium/drivers/r600/sb/sb_expr.cpp
@@ -221,18 +221,12 @@ bool expr_handler::fold_setcc(alu_node &n) {
 	} else if (isc1) {
 		if (cmp_type == AF_FLOAT_CMP) {
 			if (n.bc.src[0].abs && !n.bc.src[0].neg) {
-				if (cv1.f < 0.0f && (cc == AF_CC_GT || cc == AF_CC_NE)) {
-					cond_result = true;
-					have_result = true;
-				} else if (cv1.f <= 0.0f && cc == AF_CC_GE) {
+				if (cv1.f < 0.0f && cc == AF_CC_NE) {
 					cond_result = true;
 					have_result = true;
 				}
 			} else if (n.bc.src[0].abs && n.bc.src[0].neg) {
-				if (cv1.f > 0.0f && (cc == AF_CC_GE || cc == AF_CC_E)) {
-					cond_result = false;
-					have_result = true;
-				} else if (cv1.f >= 0.0f && cc == AF_CC_GT) {
+				if (cv1.f > 0.0f && cc == AF_CC_E) {
 					cond_result = false;
 					have_result = true;
 				}
@@ -244,18 +238,12 @@ bool expr_handler::fold_setcc(alu_node &n) {
 	} else if (isc0) {
 		if (cmp_type == AF_FLOAT_CMP) {
 			if (n.bc.src[1].abs && !n.bc.src[1].neg) {
-				if (cv0.f <= 0.0f && cc == AF_CC_GT) {
-					cond_result = false;
-					have_result = true;
-				} else if (cv0.f < 0.0f && (cc == AF_CC_GE || cc == AF_CC_E)) {
+				if (cv0.f < 0.0f && (cc == AF_CC_E)) {
 					cond_result = false;
 					have_result = true;
 				}
 			} else if (n.bc.src[1].abs && n.bc.src[1].neg) {
-				if (cv0.f >= 0.0f && cc == AF_CC_GE) {
-					cond_result = true;
-					have_result = true;
-				} else if (cv0.f > 0.0f && (cc == AF_CC_GT || cc == AF_CC_NE)) {
+				if (cv0.f > 0.0f && cc == AF_CC_NE) {
 					cond_result = true;
 					have_result = true;
 				}



More information about the mesa-commit mailing list