[Mesa-dev] [PATCH 5/8] i965: Let brw_flag_reg() choose the flag reg and subreg.

Eric Anholt eric at anholt.net
Fri Dec 7 14:08:08 PST 2012


We're about to start using the f0.1 subregister.
---
 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp |    2 +-
 src/mesa/drivers/dri/i965/brw_eu.c           |    2 +-
 src/mesa/drivers/dri/i965/brw_eu.h           |    6 +++---
 src/mesa/drivers/dri/i965/brw_fs_emit.cpp    |    4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index e8604e7..69dab75 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -1175,7 +1175,7 @@ brw_blorp_blit_program::decode_msaa(unsigned num_samples,
 void
 brw_blorp_blit_program::kill_if_outside_dst_rect()
 {
-   struct brw_reg f0 = brw_flag_reg();
+   struct brw_reg f0 = brw_flag_reg(0, 0);
    struct brw_reg g1 = retype(brw_vec1_grf(1, 7), BRW_REGISTER_TYPE_UW);
    struct brw_reg null16 = vec16(retype(brw_null_reg(), BRW_REGISTER_TYPE_UW));
 
diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c
index c60b16c..46ada8d 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.c
+++ b/src/mesa/drivers/dri/i965/brw_eu.c
@@ -70,7 +70,7 @@ void brw_set_predicate_control_flag_value( struct brw_compile *p, GLuint value )
    if (value != 0xff) {
       if (value != p->flag_value) {
 	 brw_push_insn_state(p);
-	 brw_MOV(p, brw_flag_reg(), brw_imm_uw(value));
+	 brw_MOV(p, brw_flag_reg(0, 0), brw_imm_uw(value));
 	 p->flag_value = value;
 	 brw_pop_insn_state(p);
       }
diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h
index c806e0b..e43b543 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_eu.h
@@ -568,11 +568,11 @@ static INLINE struct brw_reg brw_notification_1_reg(void)
 }
 
 
-static INLINE struct brw_reg brw_flag_reg( void )
+static INLINE struct brw_reg brw_flag_reg(int reg, int subreg)
 {
    return brw_uw1_reg(BRW_ARCHITECTURE_REGISTER_FILE,
-		      BRW_ARF_FLAG,
-		      0);
+		      BRW_ARF_FLAG + reg,
+		      subreg);
 }
 
 
diff --git a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
index 4e8b44e..0750b86 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
@@ -516,7 +516,7 @@ fs_generator::generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src
 void
 fs_generator::generate_discard(fs_inst *inst)
 {
-   struct brw_reg f0 = brw_flag_reg();
+   struct brw_reg f0 = brw_flag_reg(0, 0);
 
    if (intel->gen >= 6) {
       struct brw_reg g1 = retype(brw_vec1_grf(1, 7), BRW_REGISTER_TYPE_UW);
@@ -744,7 +744,7 @@ fs_generator::generate_varying_pull_constant_load_gen7(fs_inst *inst,
 void
 fs_generator::generate_mov_dispatch_to_flags()
 {
-   struct brw_reg f0 = brw_flag_reg();
+   struct brw_reg f0 = brw_flag_reg(0, 0);
    struct brw_reg g1 = retype(brw_vec1_grf(1, 7), BRW_REGISTER_TYPE_UW);
 
    assert (intel->gen >= 6);
-- 
1.7.10.4



More information about the mesa-dev mailing list