Mesa (master): i965: Make brw_CONT and brw_BREAK take the pop count.

Eric Anholt anholt at kemper.freedesktop.org
Mon Aug 30 17:34:40 UTC 2010


Module: Mesa
Branch: master
Commit: 352dff62f8005add9e71e6b5ba3b3321cb953d73
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=352dff62f8005add9e71e6b5ba3b3321cb953d73

Author: Eric Anholt <eric at anholt.net>
Date:   Sat Aug 28 23:18:18 2010 -0700

i965: Make brw_CONT and brw_BREAK take the pop count.

We always need to set it, so pass it in.

---

 src/mesa/drivers/dri/i965/brw_eu.h      |    4 ++--
 src/mesa/drivers/dri/i965/brw_eu_emit.c |    6 ++++--
 src/mesa/drivers/dri/i965/brw_vs_emit.c |    7 ++-----
 src/mesa/drivers/dri/i965/brw_wm_glsl.c |    7 ++-----
 4 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h
index 6e9e210..c63db16 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_eu.h
@@ -931,8 +931,8 @@ struct brw_instruction *brw_DO(struct brw_compile *p,
 struct brw_instruction *brw_WHILE(struct brw_compile *p, 
 	       struct brw_instruction *patch_insn);
 
-struct brw_instruction *brw_BREAK(struct brw_compile *p);
-struct brw_instruction *brw_CONT(struct brw_compile *p);
+struct brw_instruction *brw_BREAK(struct brw_compile *p, int pop_count);
+struct brw_instruction *brw_CONT(struct brw_compile *p, int pop_count);
 /* Forward jumps:
  */
 void brw_land_fwd_jump(struct brw_compile *p, 
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
index a6ca030..0906150 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
@@ -777,7 +777,7 @@ void brw_ENDIF(struct brw_compile *p,
    }
 }
 
-struct brw_instruction *brw_BREAK(struct brw_compile *p)
+struct brw_instruction *brw_BREAK(struct brw_compile *p, int pop_count)
 {
    struct brw_instruction *insn;
    insn = next_insn(p, BRW_OPCODE_BREAK);
@@ -788,10 +788,11 @@ struct brw_instruction *brw_BREAK(struct brw_compile *p)
    insn->header.execution_size = BRW_EXECUTE_8;
    /* insn->header.mask_control = BRW_MASK_DISABLE; */
    insn->bits3.if_else.pad0 = 0;
+   insn->bits3.if_else.pop_count = pop_count;
    return insn;
 }
 
-struct brw_instruction *brw_CONT(struct brw_compile *p)
+struct brw_instruction *brw_CONT(struct brw_compile *p, int pop_count)
 {
    struct brw_instruction *insn;
    insn = next_insn(p, BRW_OPCODE_CONTINUE);
@@ -802,6 +803,7 @@ struct brw_instruction *brw_CONT(struct brw_compile *p)
    insn->header.execution_size = BRW_EXECUTE_8;
    /* insn->header.mask_control = BRW_MASK_DISABLE; */
    insn->bits3.if_else.pad0 = 0;
+   insn->bits3.if_else.pop_count = pop_count;
    return insn;
 }
 
diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c
index 700e5ab..720a656 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c
@@ -1654,7 +1654,6 @@ void brw_vs_emit(struct brw_vs_compile *c )
       const struct prog_instruction *inst = &c->vp->program.Base.Instructions[insn];
       struct brw_reg args[3], dst;
       GLuint i;
-      struct brw_instruction *temp;
 
 #if 0
       printf("%d: ", insn);
@@ -1841,14 +1840,12 @@ void brw_vs_emit(struct brw_vs_compile *c )
          break;
       case OPCODE_BRK:
 	 brw_set_predicate_control(p, get_predicate(inst));
-	 temp = brw_BREAK(p);
-	 temp->bits3.if_else.pop_count = if_depth_in_loop[loop_depth];
+	 brw_BREAK(p, if_depth_in_loop[loop_depth]);
 	 brw_set_predicate_control(p, BRW_PREDICATE_NONE);
          break;
       case OPCODE_CONT:
 	 brw_set_predicate_control(p, get_predicate(inst));
-	 temp = brw_CONT(p);
-	 temp->bits3.if_else.pop_count = if_depth_in_loop[loop_depth];
+	 brw_CONT(p, if_depth_in_loop[loop_depth]);
          brw_set_predicate_control(p, BRW_PREDICATE_NONE);
          break;
       case OPCODE_ENDLOOP: 
diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c
index d72bd08..c1083c5 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c
@@ -1822,7 +1822,6 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c)
 	struct brw_reg args[3][4], dst[4];
 	int j;
 	int mark = mark_tmps( c );
-	struct brw_instruction *temp;
 
         c->cur_inst = i;
 
@@ -2071,13 +2070,11 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c)
 		if_depth_in_loop[loop_depth] = 0;
 		break;
 	    case OPCODE_BRK:
-		temp = brw_BREAK(p);
-		temp->bits3.if_else.pop_count = if_depth_in_loop[loop_depth];
+		brw_BREAK(p, if_depth_in_loop[loop_depth]);
 		brw_set_predicate_control(p, BRW_PREDICATE_NONE);
 		break;
 	    case OPCODE_CONT:
-		temp = brw_CONT(p);
-		temp->bits3.if_else.pop_count = if_depth_in_loop[loop_depth];
+		brw_CONT(p, if_depth_in_loop[loop_depth]);
 		brw_set_predicate_control(p, BRW_PREDICATE_NONE);
 		break;
 	    case OPCODE_ENDLOOP: 




More information about the mesa-commit mailing list