i965: Let brw_flag_reg() choose the flag reg and subreg.
authorEric Anholt <eric@anholt.net>
Thu, 6 Dec 2012 18:43:13 +0000 (10:43 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 11 Dec 2012 18:12:54 +0000 (10:12 -0800)
We're about to start using the f0.1 subregister.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
src/mesa/drivers/dri/i965/brw_eu.c
src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_fs_emit.cpp

index e8604e70195f6eae846b06dcc9ab97c5da0782ad..69dab75d2c6bbfa4b677e9a7f2b6c2835cefff37 100644 (file)
@@ -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));
 
index c60b16c3871825c46455a11cc452ad2d0caceb96..46ada8d995cc743ade7b9f04bc1605656a0bd3e1 100644 (file)
@@ -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);
       }
index c806e0bb5df5cea2c767bd7e55ab1fecd6896a14..e43b543dd96cde5fc8e298d0df80a4b32be3c1c1 100644 (file)
@@ -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);
 }
 
 
index 4e8b44e5684a8bbd615c0743089929b00fd35ca7..0750b86793cd9bd1c8828af77fe2c64450b2bd76 100644 (file)
@@ -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);