From: Alyssa Rosenzweig Date: Sat, 12 Dec 2020 03:33:09 +0000 (-0500) Subject: pan/bi: Implement jumps with the builder X-Git-Tag: upstream/21.0.0~936 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=311d3d60156fbe76d3f9570eda1cf92b714ecc68;p=platform%2Fupstream%2Fmesa.git pan/bi: Implement jumps with the builder Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 34327fe..a826292 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -71,6 +71,26 @@ static bi_block *emit_cf_list(bi_context *ctx, struct exec_list *list); static bi_instruction *bi_emit_branch(bi_context *ctx); static void +bi_emit_jump(bi_builder *b, nir_jump_instr *instr) +{ + bi_instr *branch = bi_jump_to(b, bi_null(), bi_zero()); + + switch (instr->type) { + case nir_jump_break: + branch->branch_target = b->shader->break_block; + break; + case nir_jump_continue: + branch->branch_target = b->shader->continue_block; + break; + default: + unreachable("Unhandled jump type"); + } + + pan_block_add_successor(&b->shader->current_block->base, &branch->branch_target->base); + b->shader->current_block->base.unconditional_jumps = true; +} + +static void emit_jump(bi_context *ctx, nir_jump_instr *instr) { bi_instruction *branch = bi_emit_branch(ctx);