mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
aco: Support s_cselect_b64 in SCC no-compare optimization.
This was simply left out by accident when I wrote this. Fossil DB stats on Navi 21: Totals from 70165 (52.01% of 134906) affected shaders: CodeSize: 246375656 -> 245814396 (-0.23%) Instrs: 46519773 -> 46379458 (-0.30%) Latency: 385159303 -> 385089261 (-0.02%); split: -0.02%, +0.00% InvThroughput: 66490172 -> 66487867 (-0.00%); split: -0.00%, +0.00% Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16266>
This commit is contained in:
parent
b0ef7c7c82
commit
e69de0f81d
1 changed files with 6 additions and 3 deletions
|
|
@ -327,11 +327,13 @@ try_optimize_scc_nocompare(pr_opt_ctx& ctx, aco_ptr<Instruction>& instr)
|
|||
: aco_opcode::s_cmp_lg_u32;
|
||||
} else if ((instr->format == Format::PSEUDO_BRANCH && instr->operands.size() == 1 &&
|
||||
instr->operands[0].physReg() == scc) ||
|
||||
instr->opcode == aco_opcode::s_cselect_b32) {
|
||||
instr->opcode == aco_opcode::s_cselect_b32 ||
|
||||
instr->opcode == aco_opcode::s_cselect_b64) {
|
||||
|
||||
/* For cselect, operand 2 is the SCC condition */
|
||||
unsigned scc_op_idx = 0;
|
||||
if (instr->opcode == aco_opcode::s_cselect_b32) {
|
||||
if (instr->opcode == aco_opcode::s_cselect_b32 ||
|
||||
instr->opcode == aco_opcode::s_cselect_b64) {
|
||||
scc_op_idx = 2;
|
||||
}
|
||||
|
||||
|
|
@ -359,7 +361,8 @@ try_optimize_scc_nocompare(pr_opt_ctx& ctx, aco_ptr<Instruction>& instr)
|
|||
if (instr->format == Format::PSEUDO_BRANCH)
|
||||
instr->opcode = instr->opcode == aco_opcode::p_cbranch_z ? aco_opcode::p_cbranch_nz
|
||||
: aco_opcode::p_cbranch_z;
|
||||
else if (instr->opcode == aco_opcode::s_cselect_b32)
|
||||
else if (instr->opcode == aco_opcode::s_cselect_b32 ||
|
||||
instr->opcode == aco_opcode::s_cselect_b64)
|
||||
std::swap(instr->operands[0], instr->operands[1]);
|
||||
else
|
||||
unreachable(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue