From a93bd52f4f54fdf8e2ee82548bf0802b8973f829 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 26 Jan 2024 20:33:26 +0000 Subject: [PATCH] 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 Reviewed-by: Faith Ekstrand Reviewed-by: Georg Lehmann Part-of: --- src/compiler/nir/nir_lower_int64.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/nir/nir_lower_int64.c b/src/compiler/nir/nir_lower_int64.c index 9f805a95a9c..b729e1eeefe 100644 --- a/src/compiler/nir/nir_lower_int64.c +++ b/src/compiler/nir/nir_lower_int64.c @@ -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 *