aco: implement last_invocation

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/6558>
This commit is contained in:
Rhys Perry
2020-09-01 16:31:02 +01:00
committed by Marge Bot
parent 1a912a550f
commit bb5c0ba0d2
@@ -8232,6 +8232,13 @@ void visit_intrinsic(isel_context *ctx, nir_intrinsic_instr *instr)
get_ssa_temp(ctx, &instr->dest.ssa));
break;
}
case nir_intrinsic_last_invocation: {
Temp flbit = bld.sop1(Builder::s_flbit_i32, bld.def(s1), Operand(exec, bld.lm));
Temp last = bld.sop2(aco_opcode::s_sub_i32, bld.def(s1), bld.def(s1, scc),
Operand(ctx->program->wave_size - 1u), flbit);
emit_wqm(ctx, last, get_ssa_temp(ctx, &instr->dest.ssa));
break;
}
case nir_intrinsic_elect: {
Temp first = bld.sop1(Builder::s_ff1_i32, bld.def(s1), Operand(exec, bld.lm));
emit_wqm(ctx, bld.sop2(Builder::s_lshl, bld.def(bld.lm), bld.def(s1, scc), Operand(1u), first),