mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
aco: Optimize load_subgroup_id to one bit field extract instruction.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
This commit is contained in:
parent
753670e902
commit
dd9dad731b
1 changed files with 2 additions and 3 deletions
|
|
@ -5654,9 +5654,8 @@ void visit_intrinsic(isel_context *ctx, nir_intrinsic_instr *instr)
|
|||
}
|
||||
case nir_intrinsic_load_subgroup_id: {
|
||||
if (ctx->stage == compute_cs) {
|
||||
Temp tg_num = bld.sop2(aco_opcode::s_and_b32, bld.def(s1), bld.def(s1, scc), Operand(0xfc0u),
|
||||
get_arg(ctx, ctx->args->ac.tg_size));
|
||||
bld.sop2(aco_opcode::s_lshr_b32, Definition(get_ssa_temp(ctx, &instr->dest.ssa)), bld.def(s1, scc), tg_num, Operand(0x6u));
|
||||
bld.sop2(aco_opcode::s_bfe_u32, Definition(get_ssa_temp(ctx, &instr->dest.ssa)), bld.def(s1, scc),
|
||||
get_arg(ctx, ctx->args->ac.tg_size), Operand(0x6u | (0x6u << 16)));
|
||||
} else {
|
||||
bld.sop1(aco_opcode::s_mov_b32, Definition(get_ssa_temp(ctx, &instr->dest.ssa)), Operand(0x0u));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue