[Mesa-dev] [PATCH] tgsi: Actually care what check_soa_dependencies says

Jakob Bornecrantz wallbraker at gmail.com
Sat Sep 18 07:26:01 PDT 2010


Looking over some of the piglit failings that Vinsons have posted running
on softpipe (we are down to 3005/3048). At first I was just going to make
the output not turn into a warn, but looking at the function it looks like
it actually should return the status and fail.

This fixes both.

Cheers Jakob.
---
 src/gallium/auxiliary/tgsi/tgsi_sse2.c |   39 ++++++++++++++++++--------------
 1 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_sse2.c b/src/gallium/auxiliary/tgsi/tgsi_sse2.c
index 13e2e8e..37c79e8 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_sse2.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_sse2.c
@@ -2830,31 +2830,36 @@ static void soa_to_aos( struct x86_function *func,
  * Check if the instructions dst register is the same as any src
  * register and warn if there's a posible SOA dependency.
  */
-static void
+static boolean
 check_soa_dependencies(const struct tgsi_full_instruction *inst)
 {
-   switch (inst->Instruction.Opcode) {
+   uint opcode = inst->Instruction.Opcode;
+
+   switch (opcode) {
    case TGSI_OPCODE_ADD:
    case TGSI_OPCODE_MOV:
    case TGSI_OPCODE_MUL:
    case TGSI_OPCODE_XPD:
       /* OK - these opcodes correctly handle SOA dependencies */
-      break;
+      return TRUE;
    default:
-      if (tgsi_check_soa_dependencies(inst)) {
-         uint opcode = inst->Instruction.Opcode;
+      if (!tgsi_check_soa_dependencies(inst))
+         return TRUE;
 
-         /* XXX: we only handle src/dst aliasing in a few opcodes
-          * currently.  Need to use an additional temporay to hold
-          * the result in the cases where the code is too opaque to
-          * fix.
-          */
-         if (opcode != TGSI_OPCODE_MOV) {
-            debug_printf("Warning: src/dst aliasing in instruction"
-                         " is not handled:\n");
-            tgsi_dump_instruction(inst, 1);
-         }
-      }
+      /* XXX: we only handle src/dst aliasing in a few opcodes
+       * currently.  Need to use an additional temporay to hold
+       * the result in the cases where the code is too opaque to
+       * fix.
+       */
+      if (opcode == TGSI_OPCODE_MOV)
+         return TRUE;
+
+      debug_printf("Warning: src/dst aliasing in instruction"
+                   " is not handled:\n");
+      debug_printf("Warning: ");
+      tgsi_dump_instruction(inst, 1);
+
+      return FALSE;
    }
 }
 
@@ -2954,7 +2959,7 @@ tgsi_emit_sse2(
                          tgsi_get_processor_name(proc));
 	 }
 
-         check_soa_dependencies(&parse.FullToken.FullInstruction);
+         ok = check_soa_dependencies(&parse.FullToken.FullInstruction);
          break;
 
       case TGSI_TOKEN_TYPE_IMMEDIATE:
-- 
1.7.0.4



More information about the mesa-dev mailing list