From bb5c0ba0d2e90064935fc801d0ee62db164b71c0 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Tue, 1 Sep 2020 16:31:02 +0100 Subject: [PATCH] aco: implement last_invocation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 50efb2e8543..6d3e1ca52c3 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -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),