mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-20 14:20:36 +02:00
nir/lower_bit_size: fix bitz/bitnz
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Fixes:6585209cdd("nir/lower_bit_size: mask bitz/bitnz src1 like shifts") Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35770> (cherry picked from commit08859cbe50)
This commit is contained in:
parent
dd65919d84
commit
a20567eead
2 changed files with 4 additions and 3 deletions
|
|
@ -844,7 +844,7 @@
|
|||
"description": "nir/lower_bit_size: fix bitz/bitnz",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "6585209cdd938b24418b606b1c4de68753f89dc7",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -69,8 +69,9 @@ lower_alu_instr(nir_builder *bld, nir_alu_instr *alu, unsigned bit_size)
|
|||
op == nir_op_bitz || op == nir_op_bitz8 || op == nir_op_bitz16 ||
|
||||
op == nir_op_bitz32 || op == nir_op_bitnz || op == nir_op_bitnz8 ||
|
||||
op == nir_op_bitnz16 || op == nir_op_bitnz32)) {
|
||||
assert(util_is_power_of_two_nonzero(dst_bit_size));
|
||||
src = nir_iand(bld, src, nir_imm_int(bld, dst_bit_size - 1));
|
||||
unsigned src0_bit_size = alu->src[0].src.ssa->bit_size;
|
||||
assert(util_is_power_of_two_nonzero(src0_bit_size));
|
||||
src = nir_iand(bld, src, nir_imm_int(bld, src0_bit_size - 1));
|
||||
}
|
||||
|
||||
srcs[i] = src;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue