summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2015-07-27 19:27:30 +0300
committerFrancisco Jerez <currojerez@riseup.net>2015-07-29 14:14:49 +0300
commite1f4724097d1074ec9afdc9ce9ad024add125923 (patch)
tree79ad708db48feaef81ec157c9d3956cd758c7625
parentff463af436bcf07430807512c9f0bf0f627288ce (diff)
i965/fs: Set execution controls explicitly in opt_peephole_sel().
Emit the SELs and MOVs with the same execution controls as the original MOVs, and the CMP with the same execution controls as the IF. Also explicitly check that the execution controls of any pair of MOVs being folded into a SEL are compatible (which is almost always going to be the case), since otherwise it would seem wrong to initialize the builder object below from the then_mov instruction only. Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp12
1 files changed, 9 insertions, 3 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 8660ec08b8..d190d8eb6b 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp
@@ -174,6 +174,9 @@ fs_visitor::opt_peephole_sel()
/* Check that the MOVs are the right form. */
if (!then_mov[i]->dst.equals(else_mov[i]->dst) ||
+ then_mov[i]->exec_size != else_mov[i]->exec_size ||
+ then_mov[i]->force_sechalf != else_mov[i]->force_sechalf ||
+ then_mov[i]->force_writemask_all != else_mov[i]->force_writemask_all ||
then_mov[i]->is_partial_write() ||
else_mov[i]->is_partial_write() ||
then_mov[i]->conditional_mod != BRW_CONDITIONAL_NONE ||
@@ -192,14 +195,17 @@ fs_visitor::opt_peephole_sel()
if (movs == 0)
continue;
- const fs_builder ibld = bld.at(block, if_inst);
-
/* Emit a CMP if our IF used the embedded comparison */
- if (devinfo->gen == 6 && if_inst->conditional_mod)
+ if (devinfo->gen == 6 && if_inst->conditional_mod) {
+ const fs_builder ibld(this, block, if_inst);
ibld.CMP(ibld.null_reg_d(), if_inst->src[0], if_inst->src[1],
if_inst->conditional_mod);
+ }
for (int i = 0; i < movs; i++) {
+ const fs_builder ibld = fs_builder(this, then_block, then_mov[i])
+ .at(block, if_inst);
+
if (then_mov[i]->src[0].equals(else_mov[i]->src[0])) {
ibld.MOV(then_mov[i]->dst, then_mov[i]->src[0]);
} else {