i965: Don't treat IF or WHILE with cmod as writing the flag.
authorMatt Turner <mattst88@gmail.com>
Tue, 11 Nov 2014 23:56:58 +0000 (15:56 -0800)
committerMatt Turner <mattst88@gmail.com>
Tue, 2 Dec 2014 00:42:12 +0000 (16:42 -0800)
Sandybridge's IF and WHILE instructions can do an embedded comparison
with conditional mod.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_vec4.h

index 028eff23efaaa436258b1e4a91ade37f5c0c21ab..37015ec607b39b09a246f524e761b9dac939c512 100644 (file)
@@ -933,7 +933,9 @@ fs_inst::reads_flag() const
 bool
 fs_inst::writes_flag() const
 {
-   return (conditional_mod && opcode != BRW_OPCODE_SEL) ||
+   return (conditional_mod && (opcode != BRW_OPCODE_SEL &&
+                               opcode != BRW_OPCODE_IF &&
+                               opcode != BRW_OPCODE_WHILE)) ||
           opcode == FS_OPCODE_MOV_DISPATCH_TO_FLAGS;
 }
 
index 7d814ca65bdd6b8197999521739fe0fca8f3a7a6..abdab993be9bb356f0452f8e305691b4a9e0045a 100644 (file)
@@ -234,7 +234,9 @@ public:
 
    bool writes_flag()
    {
-      return conditional_mod && opcode != BRW_OPCODE_SEL;
+      return (conditional_mod && (opcode != BRW_OPCODE_SEL &&
+                                  opcode != BRW_OPCODE_IF &&
+                                  opcode != BRW_OPCODE_WHILE));
    }
 };