Mesa (main): nir: fix ifind_msb_rev by using appropriate type

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 26 18:56:51 UTC 2021


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

Author: Filip Gawin <filip.gawin at zoho.com>
Date:   Wed Aug 25 23:19:36 2021 +0200

nir: fix ifind_msb_rev by using appropriate type

As you can see comparion "x < 0" doesn't make
sense if x is unsigned.

Fixes: a5747f8a ("nir: add opcodes for *find_msb_rev and lowering ")

Reviewed-by: Gert Wollny <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12548>

---

 src/compiler/nir/nir_opcodes.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py
index 527cf6bb56a..a46ff8f41e7 100644
--- a/src/compiler/nir/nir_opcodes.py
+++ b/src/compiler/nir/nir_opcodes.py
@@ -487,7 +487,7 @@ for (int bit = 31; bit >= 0; bit--) {
 }
 """)
 
-unop_convert("ifind_msb_rev", tint32, tuint, """
+unop_convert("ifind_msb_rev", tint32, tint, """
 dst = -1;
 if (src0 != 0 && src0 != -1) {
    for (int bit = 0; bit < 31; bit++) {



More information about the mesa-commit mailing list