Mesa (master): gallium: Remove loop register file.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Mon May 3 11:59:29 UTC 2010


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

Author: José Fonseca <jfonseca at vmware.com>
Date:   Mon May  3 10:53:32 2010 +0100

gallium: Remove loop register file.

It was only used for D3D's REP/END/BGNFOR/ENDFOR. D3D's aL register is
just like another address register now.

---

 src/gallium/auxiliary/tgsi/tgsi_dump.c     |    1 -
 src/gallium/auxiliary/tgsi/tgsi_exec.c     |    7 -------
 src/gallium/auxiliary/tgsi/tgsi_exec.h     |    4 ----
 src/gallium/auxiliary/tgsi/tgsi_sanity.c   |    4 ++--
 src/gallium/auxiliary/tgsi/tgsi_text.c     |    1 -
 src/gallium/auxiliary/tgsi/tgsi_ureg.c     |   22 ----------------------
 src/gallium/auxiliary/tgsi/tgsi_ureg.h     |    3 ---
 src/gallium/drivers/i965/brw_wm_debug.c    |    3 ++-
 src/gallium/include/pipe/p_shader_tokens.h |    5 ++---
 9 files changed, 6 insertions(+), 44 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c
index 8300020..de54a49 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_dump.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c
@@ -100,7 +100,6 @@ static const char *file_names[TGSI_FILE_COUNT] =
    "SAMP",
    "ADDR",
    "IMM",
-   "LOOP",
    "PRED",
    "SV"
 };
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 82eac05..9b1ca7f 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -1346,13 +1346,6 @@ store_dest(struct tgsi_exec_machine *mach,
       dst = &mach->Addrs[index].xyzw[chan_index];
       break;
 
-   case TGSI_FILE_LOOP:
-      assert(reg->Register.Index == 0);
-      assert(mach->LoopCounterStackTop > 0);
-      assert(chan_index == CHAN_X);
-      dst = &mach->LoopCounterStack[mach->LoopCounterStackTop - 1].xyzw[chan_index];
-      break;
-
    case TGSI_FILE_PREDICATE:
       index = reg->Register.Index;
       assert(index < TGSI_EXEC_NUM_PREDS);
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.h b/src/gallium/auxiliary/tgsi/tgsi_exec.h
index a22873e..11bbaf6 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.h
@@ -299,10 +299,6 @@ struct tgsi_exec_machine
    uint LoopLabelStack[TGSI_EXEC_MAX_LOOP_NESTING];
    int LoopLabelStackTop;
 
-   /** Loop counter stack (x = index, y = counter, z = step) */
-   struct tgsi_exec_vector LoopCounterStack[TGSI_EXEC_MAX_LOOP_NESTING];
-   int LoopCounterStackTop;
-   
    /** Loop continue mask stack (see comments in tgsi_exec.c) */
    uint ContStack[TGSI_EXEC_MAX_LOOP_NESTING];
    int ContStackTop;
diff --git a/src/gallium/auxiliary/tgsi/tgsi_sanity.c b/src/gallium/auxiliary/tgsi/tgsi_sanity.c
index 76b7564..ce0a92f 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_sanity.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_sanity.c
@@ -235,8 +235,8 @@ static const char *file_names[TGSI_FILE_COUNT] =
    "SAMP",
    "ADDR",
    "IMM",
-   "LOOP",
-   "PRED"
+   "PRED",
+   "SV"
 };
 
 static boolean
diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c
index 0b468a9..f3b1783 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_text.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
@@ -278,7 +278,6 @@ static const char *file_names[TGSI_FILE_COUNT] =
    "SAMP",
    "ADDR",
    "IMM",
-   "LOOP",
    "PRED",
    "SV"
 };
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index f725405..49b854b 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -74,7 +74,6 @@ struct ureg_tokens {
 #define UREG_MAX_IMMEDIATE 32
 #define UREG_MAX_TEMP 256
 #define UREG_MAX_ADDR 2
-#define UREG_MAX_LOOP 1
 #define UREG_MAX_PRED 1
 
 struct const_decl {
@@ -151,7 +150,6 @@ struct ureg_program
 
    unsigned nr_addrs;
    unsigned nr_preds;
-   unsigned nr_loops;
    unsigned nr_instructions;
 
    struct ureg_tokens domain[2];
@@ -537,19 +535,6 @@ struct ureg_dst ureg_DECL_address( struct ureg_program *ureg )
    return ureg_dst_register( TGSI_FILE_ADDRESS, 0 );
 }
 
-/* Allocate a new loop register.
- */
-struct ureg_dst
-ureg_DECL_loop(struct ureg_program *ureg)
-{
-   if (ureg->nr_loops < UREG_MAX_LOOP) {
-      return ureg_dst_register(TGSI_FILE_LOOP, ureg->nr_loops++);
-   }
-
-   assert(0);
-   return ureg_dst_register(TGSI_FILE_LOOP, 0);
-}
-
 /* Allocate a new predicate register.
  */
 struct ureg_dst
@@ -1356,13 +1341,6 @@ static void emit_decls( struct ureg_program *ureg )
                        0, ureg->nr_addrs );
    }
 
-   if (ureg->nr_loops) {
-      emit_decl_range(ureg,
-                      TGSI_FILE_LOOP,
-                      0,
-                      ureg->nr_loops);
-   }
-
    if (ureg->nr_preds) {
       emit_decl_range(ureg,
                       TGSI_FILE_PREDICATE,
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
index 0130a77..f32420d 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
@@ -231,9 +231,6 @@ struct ureg_dst
 ureg_DECL_address( struct ureg_program * );
 
 struct ureg_dst
-ureg_DECL_loop( struct ureg_program * );
-
-struct ureg_dst
 ureg_DECL_predicate(struct ureg_program *);
 
 /* Supply an index to the sampler declaration as this is the hook to
diff --git a/src/gallium/drivers/i965/brw_wm_debug.c b/src/gallium/drivers/i965/brw_wm_debug.c
index 3d11fa0..e276726 100644
--- a/src/gallium/drivers/i965/brw_wm_debug.c
+++ b/src/gallium/drivers/i965/brw_wm_debug.c
@@ -202,7 +202,8 @@ static const char *file_strings[TGSI_FILE_COUNT+1] = {
    "SAMPLER",
    "ADDR",
    "IMM",
-   "LOOP",
+   "PRED",
+   "SV",
    "PAYLOAD"
 };
 
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index e21aaac..0a70237 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -73,9 +73,8 @@ enum tgsi_file_type {
    TGSI_FILE_SAMPLER      =5,
    TGSI_FILE_ADDRESS      =6,
    TGSI_FILE_IMMEDIATE    =7,
-   TGSI_FILE_LOOP         =8,
-   TGSI_FILE_PREDICATE    =9,
-   TGSI_FILE_SYSTEM_VALUE =10,
+   TGSI_FILE_PREDICATE    =8,
+   TGSI_FILE_SYSTEM_VALUE =9,
    TGSI_FILE_COUNT      /**< how many TGSI_FILE_ types */
 };
 




More information about the mesa-commit mailing list