i965/eu: Merge brw_CONT and gen6_CONT.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 4 Aug 2014 21:26:26 +0000 (14:26 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 8 Aug 2014 07:51:44 +0000 (00:51 -0700)
The only difference is setting PopCount on Gen4-5.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_eu_emit.c
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp

index 63cb20b1a55968a48acfde823b9bc0d9e2bd3755..7efc02816c9069a430c672a2e0fe03c16bbd5811 100644 (file)
@@ -334,7 +334,6 @@ brw_inst *brw_WHILE(struct brw_compile *p);
 
 brw_inst *brw_BREAK(struct brw_compile *p);
 brw_inst *brw_CONT(struct brw_compile *p);
-brw_inst *gen6_CONT(struct brw_compile *p);
 brw_inst *gen6_HALT(struct brw_compile *p);
 
 /* Forward jumps:
index 845bcd4847467ac4f882998c093f3b14a317f952..3be4449b4e0384d76d90a751187691eefa6566cc 100644 (file)
@@ -1532,7 +1532,7 @@ brw_BREAK(struct brw_compile *p)
 }
 
 brw_inst *
-gen6_CONT(struct brw_compile *p)
+brw_CONT(struct brw_compile *p)
 {
    const struct brw_context *brw = p->brw;
    brw_inst *insn;
@@ -1542,25 +1542,13 @@ gen6_CONT(struct brw_compile *p)
    brw_set_src0(p, insn, brw_ip_reg());
    brw_set_src1(p, insn, brw_imm_d(0x0));
 
-   brw_inst_set_qtr_control(brw, insn, BRW_COMPRESSION_NONE);
-   brw_inst_set_exec_size(brw, insn, BRW_EXECUTE_8);
-   return insn;
-}
+   if (brw->gen < 6) {
+      brw_inst_set_gen4_pop_count(brw, insn,
+                                  p->if_depth_in_loop[p->loop_stack_depth]);
+   }
 
-brw_inst *
-brw_CONT(struct brw_compile *p)
-{
-   const struct brw_context *brw = p->brw;
-   brw_inst *insn;
-   insn = next_insn(p, BRW_OPCODE_CONTINUE);
-   brw_set_dest(p, insn, brw_ip_reg());
-   brw_set_src0(p, insn, brw_ip_reg());
-   brw_set_src1(p, insn, brw_imm_d(0x0));
    brw_inst_set_qtr_control(brw, insn, BRW_COMPRESSION_NONE);
    brw_inst_set_exec_size(brw, insn, BRW_EXECUTE_8);
-   /* insn->header.mask_control = BRW_MASK_DISABLE; */
-   brw_inst_set_gen4_pop_count(brw, insn,
-                               p->if_depth_in_loop[p->loop_stack_depth]);
    return insn;
 }
 
index 8a7fa92738dbd7f88e94c9c45e3e96c3cec46589..ac2f1b44f2cef8c917c6845d0069979021c891c4 100644 (file)
@@ -1582,11 +1582,7 @@ fs_generator::generate_code(exec_list *instructions)
         brw_set_default_predicate_control(p, BRW_PREDICATE_NONE);
         break;
       case BRW_OPCODE_CONTINUE:
-        /* FINISHME: We need to write the loop instruction support still. */
-        if (brw->gen >= 6)
-           gen6_CONT(p);
-        else
-           brw_CONT(p);
+         brw_CONT(p);
         brw_set_default_predicate_control(p, BRW_PREDICATE_NONE);
         break;
 
index c328f349bc979f50b47a8e3aef7e8507019c6392..2129007f988126b16ae6622e3f4ebe76f5c1aae3 100644 (file)
@@ -1085,11 +1085,7 @@ vec4_generator::generate_vec4_instruction(vec4_instruction *instruction,
       brw_set_default_predicate_control(p, BRW_PREDICATE_NONE);
       break;
    case BRW_OPCODE_CONTINUE:
-      /* FINISHME: We need to write the loop instruction support still. */
-      if (brw->gen >= 6)
-         gen6_CONT(p);
-      else
-         brw_CONT(p);
+      brw_CONT(p);
       brw_set_default_predicate_control(p, BRW_PREDICATE_NONE);
       break;