From 2eac571d614015c1fbbb2b507211a25efe57cdf9 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Fri, 28 Oct 2022 16:32:12 +0200 Subject: [PATCH] aco: Use opsel for the third operand. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Foz-DB Navi21: Totals from 2 (0.00% of 134913) affected shaders: CodeSize: 7788 -> 7772 (-0.21%) Instrs: 1305 -> 1303 (-0.15%) Latency: 7175 -> 7163 (-0.17%) InvThroughput: 2082 -> 2078 (-0.19%) Copies: 57 -> 55 (-3.51%) Signed-off-by: Georg Lehmann Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_optimizer.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 3c78e7eeefb..a79af92048a 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -1062,9 +1062,6 @@ parse_insert(Instruction* instr) bool can_apply_extract(opt_ctx& ctx, aco_ptr& instr, unsigned idx, ssa_info& info) { - if (idx >= 2) - return false; - Temp tmp = info.instr->operands[0].getTemp(); SubdwordSel sel = parse_extract(info.instr); @@ -1074,7 +1071,7 @@ can_apply_extract(opt_ctx& ctx, aco_ptr& instr, unsigned idx, ssa_i return true; } else if (instr->opcode == aco_opcode::v_cvt_f32_u32 && sel.size() == 1 && !sel.sign_extend()) { return true; - } else if (can_use_SDWA(ctx.program->gfx_level, instr, true) && + } else if (idx < 2 && can_use_SDWA(ctx.program->gfx_level, instr, true) && (tmp.type() == RegType::vgpr || ctx.program->gfx_level >= GFX9)) { if (instr->isSDWA() && instr->sdwa().sel[idx] != SubdwordSel::dword) return false;