From f390893a64e57c34ee959b17a7b301909627236b Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 23 Apr 2025 16:28:57 +0100 Subject: [PATCH] aco/gfx12: use s_sub_u64 fossil-db (gfx1201): Totals from 2 (0.00% of 79377) affected shaders: Instrs: 243999 -> 243993 (-0.00%) CodeSize: 1288176 -> 1288152 (-0.00%) Latency: 1894093 -> 1894091 (-0.00%) InvThroughput: 378819 -> 378818 (-0.00%) SALU: 33048 -> 33044 (-0.01%) Signed-off-by: Rhys Perry Reviewed-by: Georg Lehmann Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index c607d8634f8..bcd3895b3cc 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -1934,6 +1934,9 @@ visit_alu_instr(isel_context* ctx, nir_alu_instr* instr) } else if (dst.regClass() == v1 && instr->def.bit_size == 16) { emit_vop3p_instruction(ctx, instr, aco_opcode::v_pk_sub_u16, dst); break; + } else if (dst.regClass() == s2 && ctx->program->gfx_level >= GFX12) { + emit_sop2_instruction(ctx, instr, aco_opcode::s_sub_u64, dst, false); + break; } Temp src0 = get_alu_src(ctx, instr->src[0]);