aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-02-11 13:12:07 -0800
committerMatt Turner <[email protected]>2014-07-24 11:27:44 -0700
commit2a33510f1649f2ef5c5b2d693aa89ef0efc5dcfb (patch)
treeefb0abb9c829d9d0d109065999ad139c1d032abd /src
parent96128d134be82cd5a8cda2c473c1242c18409029 (diff)
i965/fs: Decide predicate/predicate_inverse outside of the for loop.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp b/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp
index c0bba8e7ced..03c7ee64538 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp
@@ -156,6 +156,18 @@ fs_visitor::opt_peephole_sel()
fs_inst *sel_inst[MAX_MOVS] = { NULL };
fs_inst *mov_imm_inst[MAX_MOVS] = { NULL };
+ enum brw_predicate predicate;
+ bool predicate_inverse;
+ if (brw->gen == 6 && if_inst->conditional_mod) {
+ /* For Sandybridge with IF with embedded comparison */
+ predicate = BRW_PREDICATE_NORMAL;
+ predicate_inverse = false;
+ } else {
+ /* Separate CMP and IF instructions */
+ predicate = if_inst->predicate;
+ predicate_inverse = if_inst->predicate_inverse;
+ }
+
/* Generate SEL instructions for pairs of MOVs to a common destination. */
for (int i = 0; i < movs; i++) {
if (!then_mov[i] || !else_mov[i])
@@ -190,15 +202,8 @@ fs_visitor::opt_peephole_sel()
}
sel_inst[i] = SEL(then_mov[i]->dst, src0, else_mov[i]->src[0]);
-
- if (brw->gen == 6 && if_inst->conditional_mod) {
- /* For Sandybridge with IF with embedded comparison */
- sel_inst[i]->predicate = BRW_PREDICATE_NORMAL;
- } else {
- /* Separate CMP and IF instructions */
- sel_inst[i]->predicate = if_inst->predicate;
- sel_inst[i]->predicate_inverse = if_inst->predicate_inverse;
- }
+ sel_inst[i]->predicate = predicate;
+ sel_inst[i]->predicate_inverse = predicate_inverse;
}
}