i965/fs: Use exec_size instead of dst.width for computing component size
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 18 Jun 2015 20:49:22 +0000 (13:49 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 30 Jun 2015 23:13:51 +0000 (16:13 -0700)
There are a variety of places where we use dst.width / 8 to compute the
size of a single logical channel.  Instead, we should be using exec_size.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Francisco Jerez <currojerez@riseup.net>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs_cse.cpp
src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp

index 3589bb92009176f1e7aba214216d1c33955a7954..be772ae547bdba9e2baf1654e99ac9b4babed3b7 100644 (file)
@@ -2280,12 +2280,12 @@ fs_visitor::opt_register_renaming()
 
       if (depth == 0 &&
           inst->dst.file == GRF &&
-          alloc.sizes[inst->dst.reg] == inst->dst.width / 8 &&
+          alloc.sizes[inst->dst.reg] == inst->exec_size / 8 &&
           !inst->is_partial_write()) {
          if (remap[dst] == -1) {
             remap[dst] = dst;
          } else {
-            remap[dst] = alloc.allocate(inst->dst.width / 8);
+            remap[dst] = alloc.allocate(inst->exec_size / 8);
             inst->dst.reg = remap[dst];
             progress = true;
          }
@@ -2416,7 +2416,7 @@ fs_visitor::compute_to_mrf()
             /* Things returning more than one register would need us to
              * understand coalescing out more than one MOV at a time.
              */
-            if (scan_inst->regs_written > scan_inst->dst.width / 8)
+            if (scan_inst->regs_written > scan_inst->exec_size / 8)
                break;
 
            /* SEND instructions can't have MRF as a destination. */
index 29d1f2a6a5766bff79a8c9e1e56474f303ef377a..29b46b96b8a676ffabd48a6c873c1c2597569286 100644 (file)
@@ -179,7 +179,7 @@ static void
 create_copy_instr(const fs_builder &bld, fs_inst *inst, fs_reg src, bool negate)
 {
    int written = inst->regs_written;
-   int dst_width = inst->dst.width / 8;
+   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);
    fs_inst *copy;
index 2ad7079bdf804e7b80fba55df0379bfc573b33b5..149c0f0e2173996a13a57d4d8550e1f659e17200 100644 (file)
@@ -196,7 +196,7 @@ fs_visitor::register_coalesce()
             continue;
          }
          reg_to_offset[offset] = inst->dst.reg_offset;
-         if (inst->src[0].width == 16)
+         if (inst->exec_size == 16)
             reg_to_offset[offset + 1] = inst->dst.reg_offset + 1;
          mov[offset] = inst;
          channels_remaining -= inst->regs_written;
index 9b91f47d264aa5224ed1859a5f6f0932d53f0da7..d5ff1be14147b24310a02a1071e05f8b3df818b7 100644 (file)
@@ -913,7 +913,7 @@ fs_visitor::emit_texture(ir_texture_opcode op,
       bld.emit(SHADER_OPCODE_INT_QUOTIENT, fixed_depth, depth, fs_reg(6));
 
       fs_reg *fixed_payload = ralloc_array(mem_ctx, fs_reg, inst->regs_written);
-      int components = inst->regs_written / (dst.width / 8);
+      int components = inst->regs_written / (inst->exec_size / 8);
       for (int i = 0; i < components; i++) {
          if (i == 2) {
             fixed_payload[i] = fixed_depth;
index ee0add5d765ada519c7e09d10e20bf1709caec33..b49961fff681cad8aec83227079adf66a06cc387 100644 (file)
@@ -1314,8 +1314,8 @@ fs_instruction_scheduler::choose_instruction_to_schedule()
                 * single-result send is probably actually reducing register
                 * pressure.
                 */
-               if (inst->regs_written <= inst->dst.width / 8 &&
-                   chosen_inst->regs_written > chosen_inst->dst.width / 8) {
+               if (inst->regs_written <= inst->exec_size / 8 &&
+                   chosen_inst->regs_written > chosen_inst->exec_size / 8) {
                   chosen = n;
                   continue;
                } else if (inst->regs_written > chosen_inst->regs_written) {