aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-11-11 15:56:58 -0800
committerMatt Turner <[email protected]>2014-12-01 16:42:12 -0800
commitf1e5418f402c7ac087b1c127cb4476d0d02e0073 (patch)
tree286947149bf16a44b966170131aa8a8ea3255373
parent937ddb419da28992eb7cc516459281758ff6b720 (diff)
i965: Don't treat IF or WHILE with cmod as writing the flag.
Sandybridge's IF and WHILE instructions can do an embedded comparison with conditional mod. Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp4
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4.h4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 028eff23efa..37015ec607b 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -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;
}
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h
index 7d814ca65bd..abdab993be9 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4.h
@@ -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));
}
};