mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
aco: introduce aco_opcode::p_boolean_phi
This opcode is only used during instruction selection and immediately lowered to linear phis afterwards. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28661>
This commit is contained in:
parent
3b832fe2ab
commit
6e3446422f
3 changed files with 12 additions and 7 deletions
|
|
@ -10037,6 +10037,10 @@ visit_phi(isel_context* ctx, nir_phi_instr* instr)
|
|||
bool logical = !dst.is_linear() || instr->def.divergent;
|
||||
logical |= (ctx->block->kind & block_kind_merge) != 0;
|
||||
aco_opcode opcode = logical ? aco_opcode::p_phi : aco_opcode::p_linear_phi;
|
||||
if (instr->def.bit_size == 1) {
|
||||
logical = true;
|
||||
opcode = aco_opcode::p_boolean_phi;
|
||||
}
|
||||
|
||||
/* we want a sorted list of sources, since the predecessor list is also sorted */
|
||||
std::map<unsigned, nir_def*> phi_src;
|
||||
|
|
@ -10432,7 +10436,7 @@ visit_loop(isel_context* ctx, nir_loop* loop)
|
|||
else
|
||||
instr->operands.back() =
|
||||
create_continue_phis(ctx, loop_header_idx, ctx->block->index, instr, vals);
|
||||
} else if (!is_phi(instr)) {
|
||||
} else if (!is_phi(instr) && instr->opcode != aco_opcode::p_boolean_phi) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -367,12 +367,12 @@ lower_phis(Program* program)
|
|||
|
||||
for (Block& block : program->blocks) {
|
||||
for (aco_ptr<Instruction>& phi : block.instructions) {
|
||||
if (phi->opcode == aco_opcode::p_phi) {
|
||||
assert(program->wave_size == 64 ? phi->definitions[0].regClass() != s1
|
||||
: phi->definitions[0].regClass() != s2);
|
||||
if (phi->definitions[0].regClass() == program->lane_mask)
|
||||
lower_divergent_bool_phi(program, &state, &block, phi);
|
||||
else if (phi->definitions[0].regClass().is_subdword())
|
||||
if (phi->opcode == aco_opcode::p_boolean_phi) {
|
||||
assert(program->wave_size == 64 ? phi->definitions[0].regClass() == s2
|
||||
: phi->definitions[0].regClass() == s1);
|
||||
lower_divergent_bool_phi(program, &state, &block, phi);
|
||||
} else if (phi->opcode == aco_opcode::p_phi) {
|
||||
if (phi->definitions[0].regClass().is_subdword())
|
||||
lower_subdword_phis(program, &block, phi);
|
||||
} else if (!is_phi(phi)) {
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -329,6 +329,7 @@ insn("p_startpgm")
|
|||
insn("p_return")
|
||||
insn("p_phi")
|
||||
insn("p_linear_phi")
|
||||
insn("p_boolean_phi")
|
||||
insn("p_as_uniform")
|
||||
insn("p_unit_test")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue