From 5b4813c4f0c931952f49eb0909c20f119c39c107 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 23 Apr 2025 16:28:15 +0100 Subject: [PATCH] aco/gfx12: use s_add_u64 fossil-db (gfx1201): Totals from 122 (0.15% of 79377) affected shaders: Instrs: 3640138 -> 3637577 (-0.07%); split: -0.07%, +0.00% CodeSize: 19133796 -> 19120080 (-0.07%); split: -0.08%, +0.01% SpillSGPRs: 666 -> 650 (-2.40%) SpillVGPRs: 2147 -> 2159 (+0.56%) Scratch: 254208 -> 255232 (+0.40%) Latency: 21529337 -> 21522317 (-0.03%); split: -0.04%, +0.00% InvThroughput: 4048519 -> 4047233 (-0.03%); split: -0.03%, +0.00% VClause: 90453 -> 90455 (+0.00%) SClause: 67846 -> 67674 (-0.25%); split: -0.28%, +0.03% Copies: 287449 -> 287476 (+0.01%); split: -0.04%, +0.05% Branches: 104526 -> 104530 (+0.00%); split: -0.00%, +0.01% PreSGPRs: 9795 -> 9723 (-0.74%); split: -0.78%, +0.04% VALU: 2004219 -> 2003031 (-0.06%); split: -0.06%, +0.00% SALU: 492651 -> 491737 (-0.19%); split: -0.19%, +0.00% VMEM: 161317 -> 161341 (+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 ace9af8f609..c607d8634f8 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -1732,6 +1732,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_add_u16, dst); break; + } else if (dst.regClass() == s2 && ctx->program->gfx_level >= GFX12) { + emit_sop2_instruction(ctx, instr, aco_opcode::s_add_u64, dst, false); + break; } Temp src0 = get_alu_src(ctx, instr->src[0]);