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:
82dd60d
)
ac/nir: handle more special cases in ac_nir_unpack_arg
author
Georg Lehmann
<dadschoorse@gmail.com>
Mon, 7 Aug 2023 09:32:04 +0000
(11:32 +0200)
committer
Marge Bot
<emma+marge@anholt.net>
Wed, 9 Aug 2023 10:04:53 +0000
(10:04 +0000)
Foz-DB Navi21:
Totals from 60972 (45.96% of 132657) affected shaders:
CodeSize:
158371336
->
158127376
(-0.15%)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24534>
src/amd/common/ac_nir.c
patch
|
blob
|
history
diff --git
a/src/amd/common/ac_nir.c
b/src/amd/common/ac_nir.c
index
bf58a79
..
63e73c5
100644
(file)
--- a/
src/amd/common/ac_nir.c
+++ b/
src/amd/common/ac_nir.c
@@
-40,10
+40,14
@@
ac_nir_unpack_arg(nir_builder *b, const struct ac_shader_args *ac_args, struct a
unsigned rshift, unsigned bitwidth)
{
nir_ssa_def *value = ac_nir_load_arg(b, ac_args, arg);
- if (rshift)
- return
nir_ubfe_imm(b, value, rshift, bitwidth)
;
- else
+ if (rshift
== 0 && bitwidth == 32
)
+ return
value
;
+ else
if (rshift == 0)
return nir_iand_imm(b, value, BITFIELD_MASK(bitwidth));
+ else if ((32 - rshift) <= bitwidth)
+ return nir_ushr_imm(b, value, rshift);
+ else
+ return nir_ubfe_imm(b, value, rshift, bitwidth);
}
static bool