mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
nir/lower_bit_size: optimize usub_sat lowering
The result should never be larger than uint_max. This doesn't need a special path. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19473>
This commit is contained in:
parent
e19584db2b
commit
8a4f9a874b
1 changed files with 1 additions and 1 deletions
|
|
@ -94,7 +94,7 @@ lower_alu_instr(nir_builder *bld, nir_alu_instr *alu, unsigned bit_size)
|
|||
lowered_dst = nir_iclamp(bld, lowered_dst,
|
||||
nir_imm_intN_t(bld, int_min, bit_size),
|
||||
nir_imm_intN_t(bld, int_max, bit_size));
|
||||
} else if (op == nir_op_uadd_sat || op == nir_op_usub_sat) {
|
||||
} else if (op == nir_op_uadd_sat) {
|
||||
const uint64_t uint_max = u_uintN_max(dst_bit_size);
|
||||
|
||||
lowered_dst = nir_umin(bld, lowered_dst,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue