i965/fs: Determine partial writes based on the destination width
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 30 Aug 2014 00:18:42 +0000 (17:18 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 30 Sep 2014 17:29:14 +0000 (10:29 -0700)
Now that we track both halves of a 16-wide vgrf, we no longer need to worry
about force_sechalf or force_uncompressed.  The only real issue is if the
destination is too small.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp

index 9a9dbda4619068924756681e9d6388067a418c88..9f30b379e796f25afed20baffb09b05e24ddd6e9 100644 (file)
@@ -821,8 +821,8 @@ bool
 fs_inst::is_partial_write() const
 {
    return ((this->predicate && this->opcode != BRW_OPCODE_SEL) ||
-           this->force_uncompressed ||
-           this->force_sechalf || !this->dst.is_contiguous());
+           (this->dst.width * type_sz(this->dst.type)) < 32 ||
+           !this->dst.is_contiguous());
 }
 
 int
index 095b45c6c9af94833b904cbd777f1c34e9de4e6f..ef5720c5368a50d98f503e9004dd826d86931391 100644 (file)
@@ -787,11 +787,9 @@ fs_visitor::spill_reg(int spill_reg)
           * inst->regs_written(), then we need to unspill the destination
           * since we write back out all of the regs_written().
          */
-        if (inst->predicate || inst->force_uncompressed ||
-             inst->force_sechalf || inst->dst.subreg_offset) {
+        if (inst->is_partial_write())
             emit_unspill(block, inst, spill_src, subset_spill_offset,
                          inst->regs_written);
-        }
 
          emit_spill(block, inst, spill_src, subset_spill_offset,
                     inst->regs_written);