i965/fs: Relax fs_builder channel group assertion when force_writemask_all is on.
authorFrancisco Jerez <currojerez@riseup.net>
Tue, 30 Jun 2015 12:15:44 +0000 (15:15 +0300)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 1 Jul 2015 16:24:46 +0000 (09:24 -0700)
This assertion was meant to catch code inadvertently escaping the
control flow jail determined by the group of channel enable signals
selected by some caller, however it seems useful to be able to
increase the default execution size as long as force_writemask_all is
enabled, because force_writemask_all is an explicit indication that
there is no longer a one-to-one correspondence between channels and
SIMD components so the restriction doesn't apply.

In addition reorder the calls to fs_builder::group and ::exec_all in a
couple of places to make sure that we don't temporarily break this
invariant in the future for instructions with exec_size higher than
the dispatch width.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs_builder.h
src/mesa/drivers/dri/i965/brw_fs_cse.cpp

index a19ea664e3f404ad245375041e1d03691a841105..189da1d553e2b54aa21addcbd307e5a4c1cc7bf3 100644 (file)
@@ -2915,7 +2915,7 @@ fs_visitor::lower_load_payload()
       if (dst.file == MRF)
          dst.reg = dst.reg & ~BRW_MRF_COMPR4;
 
-      const fs_builder hbld = bld.group(8, 0).exec_all().at(block, inst);
+      const fs_builder hbld = bld.exec_all().group(8, 0).at(block, inst);
 
       for (uint8_t i = 0; i < inst->header_size; i++) {
          if (inst->src[i].file != BAD_FILE) {
@@ -2926,8 +2926,8 @@ fs_visitor::lower_load_payload()
          dst = offset(dst, hbld, 1);
       }
 
-      const fs_builder ibld = bld.group(inst->exec_size, inst->force_sechalf)
-                                 .exec_all(inst->force_writemask_all)
+      const fs_builder ibld = bld.exec_all(inst->force_writemask_all)
+                                 .group(inst->exec_size, inst->force_sechalf)
                                  .at(block, inst);
 
       if (inst->dst.file == MRF && (inst->dst.reg & BRW_MRF_COMPR4) &&
index 2c36e071f54cc642624887710d18e8ca72ccb8b1..34646d7fd74589eb431a5c9dc3309f0b15afc7c0 100644 (file)
@@ -99,8 +99,8 @@ namespace brw {
       fs_builder
       group(unsigned n, unsigned i) const
       {
-         assert(n <= dispatch_width() &&
-                i < dispatch_width() / n);
+         assert(force_writemask_all ||
+                (n <= dispatch_width() && i < dispatch_width() / n));
          fs_builder bld = *this;
          bld._dispatch_width = n;
          bld._group += i * n;
index 291feb3ec0c7c8cfcce6b2a2f333bd3a53b278da..e33fe6a98024b512b96f0d44cf9586da1aff72e6 100644 (file)
@@ -180,8 +180,8 @@ create_copy_instr(const fs_builder &bld, fs_inst *inst, fs_reg src, bool negate)
 {
    int written = inst->regs_written;
    int dst_width = inst->exec_size / 8;
-   const fs_builder ubld = bld.group(inst->exec_size, inst->force_sechalf)
-                              .exec_all(inst->force_writemask_all);
+   const fs_builder ubld = bld.exec_all(inst->force_writemask_all)
+                              .group(inst->exec_size, inst->force_sechalf);
    fs_inst *copy;
 
    if (written > dst_width) {