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@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12548>
(cherry picked from commit 46f3582c6f)
This commit is contained in:
Filip Gawin 2021-08-25 23:19:36 +02:00 committed by Dylan Baker
parent 1b9a3aa5d7
commit 64720c0a3c
2 changed files with 2 additions and 2 deletions

View file

@ -445,7 +445,7 @@
"description": "nir: fix ifind_msb_rev by using appropriate type",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "a5747f8ab357ff00c630b937b221e5fb59d90289"
},

View file

@ -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++) {