i965/vec4: Add and use vec4_instruction::writes_flag().
authorMatt Turner <mattst88@gmail.com>
Wed, 12 Mar 2014 07:14:07 +0000 (00:14 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 24 Mar 2014 18:06:25 +0000 (11:06 -0700)
To be consistent with the fs backend. Also the instruction scheduler
incorrectly considered SEL with a conditional modifier to read the flag
register.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
src/mesa/drivers/dri/i965/brw_vec4.h

index 5449c1bd7bcbb850876018b269b0fae5cd99626c..e86c258cc5e06d6d720c85a8d3ae901cb7bc8526 100644 (file)
@@ -1060,7 +1060,7 @@ vec4_instruction_scheduler::calculate_deps()
          }
       }
 
-      if (inst->conditional_mod) {
+      if (inst->writes_flag()) {
          add_dep(last_conditional_mod, n, 0);
          last_conditional_mod = n;
       }
@@ -1129,7 +1129,7 @@ vec4_instruction_scheduler::calculate_deps()
          }
       }
 
-      if (inst->conditional_mod) {
+      if (inst->writes_flag()) {
          last_conditional_mod = n;
       }
    }
index 52cc0582acb85ae793926715b0ae79a20b1752a9..6ea3ca4de94ad6bea5b729f603402266da7034a6 100644 (file)
@@ -271,6 +271,11 @@ public:
    {
       return predicate || opcode == VS_OPCODE_UNPACK_FLAGS_SIMD4X2;
    }
+
+   bool writes_flag()
+   {
+      return conditional_mod && opcode != BRW_OPCODE_SEL;
+   }
 };
 
 /**