From 64720c0a3cb8c04864e33abdbbb26188d4f72bc0 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: (cherry picked from commit 46f3582c6fe607fa30d7ac24d3abd92128855c98) --- .pick_status.json | 2 +- src/compiler/nir/nir_opcodes.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 39020ea6294..d046eb75cf9 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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" }, diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py index f9330c0af2c..6745c6c9f4e 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++) {