summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Lejeune <vljn@ovi.com>2012-11-28 19:59:07 +0100
committerVincent Lejeune <vljn@ovi.com>2012-11-29 22:15:18 +0100
commit3fcb3fbf22063cabfec04700dcf5aa4a2f30760f (patch)
treedc23aaa90e8b920fd1eba36aaf32aa463b8f8ebc
parent5fda2990aa1a52a11a87eeb5ccf914588e0afe21 (diff)
r600g: mirror simplification of if/break opcodes
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
-rw-r--r--src/gallium/drivers/r600/r600_shader.c44
1 files changed, 12 insertions, 32 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 84821acb76f..72cb58582f2 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -361,16 +361,14 @@ static unsigned r600_alu_from_byte_stream(struct r600_shader_ctx *ctx,
return bytes_read;
}
-static void llvm_if(struct r600_shader_ctx *ctx, struct r600_bytecode_alu * alu,
- unsigned pred_inst)
+static void llvm_if(struct r600_shader_ctx *ctx)
{
r600_bytecode_add_cfinst(ctx->bc, CTX_INST(V_SQ_CF_WORD1_SQ_CF_INST_JUMP));
fc_pushlevel(ctx, FC_IF);
callstack_check_depth(ctx, FC_PUSH_VPM, 0);
}
-static void r600_break_from_byte_stream(struct r600_shader_ctx *ctx,
- struct r600_bytecode_alu *alu, unsigned compare_opcode)
+static void r600_break_from_byte_stream(struct r600_shader_ctx *ctx)
{
unsigned opcode = TGSI_OPCODE_BRK;
if (ctx->bc->chip_class == CAYMAN)
@@ -379,7 +377,7 @@ static void r600_break_from_byte_stream(struct r600_shader_ctx *ctx,
ctx->inst_info = &eg_shader_tgsi_instruction[opcode];
else
ctx->inst_info = &r600_shader_tgsi_instruction[opcode];
- llvm_if(ctx, alu, compare_opcode);
+ llvm_if(ctx);
tgsi_loop_brk_cont(ctx);
tgsi_endif(ctx);
}
@@ -393,35 +391,25 @@ static unsigned r600_fc_from_byte_stream(struct r600_shader_ctx *ctx,
bytes_read = r600_src_from_byte_stream(bytes, bytes_read, &alu, 0);
inst = bytes[bytes_read++];
switch (inst) {
- case 0: /* FC_IF */
- llvm_if(ctx, &alu,
- CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE));
+ case 0: /* IF_PREDICATED */
+ llvm_if(ctx);
break;
- case 1: /* FC_IF_INT */
- llvm_if(ctx, &alu,
- CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE_INT));
- break;
- case 2: /* FC_ELSE */
+ case 1: /* ELSE */
tgsi_else(ctx);
break;
- case 3: /* FC_ENDIF */
+ case 2: /* ENDIF */
tgsi_endif(ctx);
break;
- case 4: /* FC_BGNLOOP */
+ case 3: /* BGNLOOP */
tgsi_bgnloop(ctx);
break;
- case 5: /* FC_ENDLOOP */
+ case 4: /* ENDLOOP */
tgsi_endloop(ctx);
break;
- case 6: /* FC_BREAK */
- r600_break_from_byte_stream(ctx, &alu,
- CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETE_INT));
- break;
- case 7: /* FC_BREAK_NZ_INT */
- r600_break_from_byte_stream(ctx, &alu,
- CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE_INT));
+ case 5: /* PREDICATED_BREAK */
+ r600_break_from_byte_stream(ctx);
break;
- case 8: /* FC_CONTINUE */
+ case 6: /* CONTINUE */
{
unsigned opcode = TGSI_OPCODE_CONT;
if (ctx->bc->chip_class == CAYMAN) {
@@ -437,14 +425,6 @@ static unsigned r600_fc_from_byte_stream(struct r600_shader_ctx *ctx,
tgsi_loop_brk_cont(ctx);
}
break;
- case 9: /* FC_BREAK_Z_INT */
- r600_break_from_byte_stream(ctx, &alu,
- CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETE_INT));
- break;
- case 10: /* FC_BREAK_NZ */
- r600_break_from_byte_stream(ctx, &alu,
- CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE));
- break;
}
return bytes_read;