From b59764a9fcb0a1535d948126ab0b74ca38aa0cbb Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Tue, 18 Jan 2022 13:29:59 +0000 Subject: [PATCH] aco: use p_extract for SGPR nir_op_unpack_half_2x16_split_y MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit fossil-db (Sienna Cichlid): Totals from 7264 (5.40% of 134627) affected shaders: VGPRs: 548152 -> 548184 (+0.01%) SpillSGPRs: 7615 -> 7607 (-0.11%) CodeSize: 71025152 -> 70993036 (-0.05%); split: -0.05%, +0.00% Instrs: 13386799 -> 13298580 (-0.66%); split: -0.66%, +0.00% Latency: 177464497 -> 177091693 (-0.21%); split: -0.21%, +0.00% InvThroughput: 32185148 -> 32151873 (-0.10%); split: -0.10%, +0.00% VClause: 233167 -> 233166 (-0.00%); split: -0.00%, +0.00% SClause: 468423 -> 468426 (+0.00%); split: -0.00%, +0.01% Copies: 950727 -> 942753 (-0.84%); split: -0.85%, +0.02% Branches: 455919 -> 455901 (-0.00%); split: -0.01%, +0.00% fossil-db (Vega): Totals from 7264 (5.39% of 134762) affected shaders: SGPRs: 738800 -> 738816 (+0.00%) VGPRs: 550264 -> 550344 (+0.01%) SpillSGPRs: 11149 -> 11157 (+0.07%) CodeSize: 67487104 -> 67466772 (-0.03%); split: -0.03%, +0.00% Instrs: 13142106 -> 13061767 (-0.61%) Latency: 209278575 -> 208438854 (-0.40%); split: -0.40%, +0.00% InvThroughput: 81486405 -> 81265773 (-0.27%); split: -0.27%, +0.00% VClause: 222293 -> 222291 (-0.00%); split: -0.00%, +0.00% SClause: 447783 -> 447800 (+0.00%); split: -0.00%, +0.01% Copies: 1243760 -> 1238842 (-0.40%); split: -0.43%, +0.03% Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 1857ede..9dd435d 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -3286,8 +3286,8 @@ visit_alu_instr(isel_context* ctx, nir_alu_instr* instr) case nir_op_unpack_half_2x16_split_y: { Temp src = get_alu_src(ctx, instr->src[0]); if (src.regClass() == s1) - src = - bld.sop2(aco_opcode::s_lshr_b32, bld.def(s1), bld.def(s1, scc), src, Operand::c32(16u)); + src = bld.pseudo(aco_opcode::p_extract, bld.def(s1), bld.def(s1, scc), src, + Operand::c32(1u), Operand::c32(16u), Operand::zero()); else src = bld.pseudo(aco_opcode::p_split_vector, bld.def(v2b), bld.def(v2b), src).def(1).getTemp(); -- 2.7.4