nir/lower_int64: allow 64-bit comparisons when lowering minmax

RADV doesn't need these to be lowered.

fossil-db (navi31):
Totals from 1 (0.00% of 79242) affected shaders:
Instrs: 28 -> 26 (-7.14%)
CodeSize: 140 -> 128 (-8.57%)
Latency: 605 -> 604 (-0.17%)
Copies: 5 -> 6 (+20.00%)
VALU: 14 -> 13 (-7.14%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27335>
This commit is contained in:
Rhys Perry 2024-01-26 20:33:26 +00:00 committed by Marge Bot
parent b37804c8de
commit a93bd52f4f

View file

@ -377,25 +377,25 @@ lower_int64_compare(nir_builder *b, nir_op op, nir_def *x, nir_def *y)
static nir_def *
lower_umax64(nir_builder *b, nir_def *x, nir_def *y)
{
return nir_bcsel(b, lower_int64_compare(b, nir_op_ult, x, y), y, x);
return nir_bcsel(b, COND_LOWER_CMP(b, ult, x, y), y, x);
}
static nir_def *
lower_imax64(nir_builder *b, nir_def *x, nir_def *y)
{
return nir_bcsel(b, lower_int64_compare(b, nir_op_ilt, x, y), y, x);
return nir_bcsel(b, COND_LOWER_CMP(b, ilt, x, y), y, x);
}
static nir_def *
lower_umin64(nir_builder *b, nir_def *x, nir_def *y)
{
return nir_bcsel(b, lower_int64_compare(b, nir_op_ult, x, y), x, y);
return nir_bcsel(b, COND_LOWER_CMP(b, ult, x, y), x, y);
}
static nir_def *
lower_imin64(nir_builder *b, nir_def *x, nir_def *y)
{
return nir_bcsel(b, lower_int64_compare(b, nir_op_ilt, x, y), x, y);
return nir_bcsel(b, COND_LOWER_CMP(b, ilt, x, y), x, y);
}
static nir_def *