aco: use p_extract for SGPR nir_op_unpack_half_2x16_split_y
authorRhys Perry <pendingchaos02@gmail.com>
Tue, 18 Jan 2022 13:29:59 +0000 (13:29 +0000)
committerMarge Bot <emma+marge@anholt.net>
Wed, 19 Jan 2022 12:41:48 +0000 (12:41 +0000)
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 <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14592>

src/amd/compiler/aco_instruction_selection.cpp

index 1857ede..9dd435d 100644 (file)
@@ -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();