projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac3b73a
)
nir/opcodes: Fix constant-folding of ufind_msb
author
Jason Ekstrand
<jason.ekstrand@intel.com>
Mon, 28 Aug 2017 22:05:11 +0000
(15:05 -0700)
committer
Jason Ekstrand
<jason.ekstrand@intel.com>
Fri, 13 Oct 2017 05:39:29 +0000
(22:39 -0700)
We didn't fold correctly in the case of 0x1 because we never let the
loop counter hit 0. Switching it to bit >= 0 solves this problem.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
src/compiler/nir/nir_opcodes.py
patch
|
blob
|
history
diff --git
a/src/compiler/nir/nir_opcodes.py
b/src/compiler/nir/nir_opcodes.py
index 06ae820c3e88a73132716afdca3eb152323ee216..28a04672285e58209ef2ba3e0a3e09d2b13f7c53 100644
(file)
--- a/
src/compiler/nir/nir_opcodes.py
+++ b/
src/compiler/nir/nir_opcodes.py
@@
-308,7
+308,7
@@
for (unsigned bit = 0; bit < 32; bit++) {
unop_convert("ufind_msb", tint32, tuint32, """
dst = -1;
-for (int bit = 31; bit > 0; bit--) {
+for (int bit = 31; bit >
=
0; bit--) {
if ((src0 >> bit) & 1) {
dst = bit;
break;