projects
/
platform
/
upstream
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
28311f9
)
nir/builder: Do not generate 8- or 16-bit find_msb
author
Ian Romanick
<ian.d.romanick@intel.com>
Wed, 8 Mar 2023 17:35:07 +0000
(09:35 -0800)
committer
Marge Bot
<emma+marge@anholt.net>
Fri, 10 Mar 2023 15:27:17 +0000
(15:27 +0000)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
src/compiler/nir/nir_builtin_builder.h
patch
|
blob
|
history
diff --git
a/src/compiler/nir/nir_builtin_builder.h
b/src/compiler/nir/nir_builtin_builder.h
index
ca28dd1
..
acbf0c6
100644
(file)
--- a/
src/compiler/nir/nir_builtin_builder.h
+++ b/
src/compiler/nir/nir_builtin_builder.h
@@
-237,7
+237,8
@@
static inline nir_ssa_def *
nir_clz_u(nir_builder *b, nir_ssa_def *a)
{
nir_ssa_def *val;
- val = nir_isub(b, nir_imm_intN_t(b, a->bit_size - 1, 32), nir_ufind_msb(b, a));
+ val = nir_isub(b, nir_imm_intN_t(b, a->bit_size - 1, 32),
+ nir_ufind_msb(b, nir_u2uN(b, a, MAX2(a->bit_size, 32))));
return nir_u2uN(b, val, a->bit_size);
}