summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2014-08-10 07:06:36 -0700
committerKenneth Graunke <[email protected]>2014-08-12 13:39:25 -0700
commitd8ef0eab5a133ad9d8945a6b7f077fea000a87a6 (patch)
tree650894fc432a164a9feabc8aeed304b0004fc8c1
parentaafdf9eef481a77810258b828e2a0b4e3c0aa696 (diff)
i965/eu: Refactor brw_WHILE to share a bit more code on Gen6+.
We're going to add a Gen8+ case shortly, which would need to duplicate this code again. Instead, share it. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Matt Turner <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu_emit.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
index 4d1d6ce510b..11ae25a1d27 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
@@ -1704,25 +1704,21 @@ brw_WHILE(struct brw_compile *p)
brw_inst *insn, *do_insn;
unsigned br = brw_jump_scale(brw);
- if (brw->gen >= 7) {
- insn = next_insn(p, BRW_OPCODE_WHILE);
- do_insn = get_inner_do_insn(p);
-
- brw_set_dest(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
- brw_set_src0(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
- brw_set_src1(p, insn, brw_imm_ud(0));
- brw_inst_set_jip(brw, insn, br * (do_insn - insn));
-
- brw_inst_set_exec_size(brw, insn, p->compressed ? BRW_EXECUTE_16
- : BRW_EXECUTE_8);
- } else if (brw->gen == 6) {
+ if (brw->gen >= 6) {
insn = next_insn(p, BRW_OPCODE_WHILE);
do_insn = get_inner_do_insn(p);
- brw_set_dest(p, insn, brw_imm_w(0));
- brw_inst_set_gen6_jump_count(brw, insn, br * (do_insn - insn));
- brw_set_src0(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
- brw_set_src1(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
+ if (brw->gen == 7) {
+ brw_set_dest(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
+ brw_set_src0(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
+ brw_set_src1(p, insn, brw_imm_ud(0));
+ brw_inst_set_jip(brw, insn, br * (do_insn - insn));
+ } else {
+ brw_set_dest(p, insn, brw_imm_w(0));
+ brw_inst_set_gen6_jump_count(brw, insn, br * (do_insn - insn));
+ brw_set_src0(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
+ brw_set_src1(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
+ }
brw_inst_set_exec_size(brw, insn, p->compressed ? BRW_EXECUTE_16
: BRW_EXECUTE_8);