[Mesa-dev,v2,3/4] Revert "i965: Move brw_land_fwd_jump() to compilation unit of its use."

Submitted by Iago Toral Quiroga on June 5, 2014, 1:03 p.m.

Details

Message ID 1401973388-4627-4-git-send-email-itoral@igalia.com
State Accepted
Commit 8873120f9fb0c82cfd46cd15c39e66c38076cb0d
Headers show

Not browsing as part of any series.

Commit Message

Iago Toral Quiroga June 5, 2014, 1:03 p.m.
This reverts commit f3cb2e6ed7059b22752a6b7d7a98c07ba6b5552e.

brw_land_fwd_jump() is convenient wherever we produce JMPI instructions
and we will use JMPI to implement framebuffer writes that involve line
antialiasing in gen < 6.
---
 src/mesa/drivers/dri/i965/brw_eu.h      |  4 ++++
 src/mesa/drivers/dri/i965/brw_eu_emit.c | 17 +++++++++++++++++
 src/mesa/drivers/dri/i965/brw_sf_emit.c | 16 ----------------
 3 files changed, 21 insertions(+), 16 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h
index c9e5a4b..5aaaad4 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_eu.h
@@ -340,6 +340,10 @@  struct brw_instruction *brw_CONT(struct brw_compile *p);
 struct brw_instruction *gen6_CONT(struct brw_compile *p);
 struct brw_instruction *gen6_HALT(struct brw_compile *p);
 
+/* Forward jumps:
+ */
+void brw_land_fwd_jump(struct brw_compile *p, int jmp_insn_idx);
+
 struct brw_instruction *brw_JMPI(struct brw_compile *p, struct brw_reg index,
                                  unsigned predicate_control);
 
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
index b89070b..9d7cbd9 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
@@ -1777,6 +1777,23 @@  struct brw_instruction *brw_WHILE(struct brw_compile *p)
    return insn;
 }
 
+/* FORWARD JUMPS:
+ */
+void brw_land_fwd_jump(struct brw_compile *p, int jmp_insn_idx)
+{
+   struct brw_context *brw = p->brw;
+   struct brw_instruction *jmp_insn = &p->store[jmp_insn_idx];
+   unsigned jmpi = 1;
+
+   if (brw->gen >= 5)
+      jmpi = 2;
+
+   assert(jmp_insn->header.opcode == BRW_OPCODE_JMPI);
+   assert(jmp_insn->bits1.da1.src1_reg_file == BRW_IMMEDIATE_VALUE);
+
+   jmp_insn->bits3.ud = jmpi * (p->nr_insn - jmp_insn_idx - 1);
+}
+
 /* To integrate with the above, it makes sense that the comparison
  * instruction should populate the flag register.  It might be simpler
  * just to use the flag reg for most WM tasks?
diff --git a/src/mesa/drivers/dri/i965/brw_sf_emit.c b/src/mesa/drivers/dri/i965/brw_sf_emit.c
index b526a5c..693627c 100644
--- a/src/mesa/drivers/dri/i965/brw_sf_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_sf_emit.c
@@ -729,22 +729,6 @@  void brw_emit_point_setup(struct brw_sf_compile *c, bool allocate)
    brw_set_default_predicate_control(p, BRW_PREDICATE_NONE);
 }
 
-static void
-brw_land_fwd_jump(struct brw_compile *p, int jmp_insn_idx)
-{
-   struct brw_context *brw = p->brw;
-   struct brw_instruction *jmp_insn = &p->store[jmp_insn_idx];
-   unsigned jmpi = 1;
-
-   if (brw->gen >= 5)
-      jmpi = 2;
-
-   assert(jmp_insn->header.opcode == BRW_OPCODE_JMPI);
-   assert(jmp_insn->bits1.da1.src1_reg_file == BRW_IMMEDIATE_VALUE);
-
-   jmp_insn->bits3.ud = jmpi * (p->nr_insn - jmp_insn_idx - 1);
-}
-
 void brw_emit_anyprim_setup( struct brw_sf_compile *c )
 {
    struct brw_compile *p = &c->func;