diff options
author | Christoph Bumiller <christoph.bumiller@speed.at> | 2014-05-17 01:20:16 +0200 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2014-06-02 12:49:03 +0200 |
commit | 6544a4a3425ffab6004918ee1299d4e63ed71755 (patch) | |
tree | ccf5bfe46d70b0716b22160b0052d3adf899a542 /src/gallium/drivers/r600 | |
parent | 822ac968024b1f1aacb729e25b811908237e3beb (diff) |
r600g: implement TGSI_OPCODE_BREAKC
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r-- | src/gallium/drivers/r600/r600_shader.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index a397f0e75e7..5823ba2e857 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -6265,6 +6265,29 @@ static int tgsi_endloop(struct r600_shader_ctx *ctx) return 0; } +static int tgsi_loop_breakc(struct r600_shader_ctx *ctx) +{ + int r; + unsigned int fscp; + + for (fscp = ctx->bc->fc_sp; fscp > 0; fscp--) + { + if (FC_LOOP == ctx->bc->fc_stack[fscp].type) + break; + } + if (fscp == 0) { + R600_ERR("BREAKC not inside loop/endloop pair\n"); + return -EINVAL; + } + + r = emit_logic_pred(ctx, ALU_OP2_PRED_SETE_INT, CF_OP_ALU_BREAK); + if (r) + return r; + fc_set_mid(ctx, fscp); + + return 0; +} + static int tgsi_loop_brk_cont(struct r600_shader_ctx *ctx) { unsigned int fscp; @@ -6496,7 +6519,7 @@ static struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction[] = { {TGSI_OPCODE_CALLNZ, 0, ALU_OP0_NOP, tgsi_unsupported}, /* gap */ {114, 0, ALU_OP0_NOP, tgsi_unsupported}, - {TGSI_OPCODE_BREAKC, 0, ALU_OP0_NOP, tgsi_unsupported}, + {TGSI_OPCODE_BREAKC, 0, ALU_OP0_NOP, tgsi_loop_breakc}, {TGSI_OPCODE_KILL_IF, 0, ALU_OP2_KILLGT, tgsi_kill}, /* conditional kill */ {TGSI_OPCODE_END, 0, ALU_OP0_NOP, tgsi_end}, /* aka HALT */ /* gap */ |