From 46f3582c6fe607fa30d7ac24d3abd92128855c98 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Wed, 25 Aug 2021 23:19:36 +0200 Subject: [PATCH] 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 Part-of: --- 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++) {