unsigned sol_vertex; /**< gen6: used for setting dst index in SVB header */
bool is_send_from_grf();
- unsigned regs_read(unsigned arg) const;
+ unsigned size_read(unsigned arg) const;
bool can_reswizzle(const struct gen_device_info *devinfo, int dst_writemask,
int swizzle, int swizzle_mask);
void reswizzle(int dst_writemask, int swizzle);
regs_read(const vec4_instruction *inst, unsigned i)
{
/* XXX - Take into account register-misaligned offsets correctly. */
- return inst->regs_read(i);
+ const unsigned reg_size =
+ inst->src[i].file == UNIFORM || inst->src[i].file == IMM ? 16 : REG_SIZE;
+ return DIV_ROUND_UP(inst->size_read(i), reg_size);
}
} /* namespace brw */
}
unsigned
-vec4_instruction::regs_read(unsigned arg) const
+vec4_instruction::size_read(unsigned arg) const
{
- if (src[arg].file == BAD_FILE)
- return 0;
-
switch (opcode) {
case SHADER_OPCODE_SHADER_TIME_ADD:
case SHADER_OPCODE_UNTYPED_ATOMIC:
case SHADER_OPCODE_TYPED_SURFACE_READ:
case SHADER_OPCODE_TYPED_SURFACE_WRITE:
case TCS_OPCODE_URB_WRITE:
- return arg == 0 ? mlen : 1;
-
+ if (arg == 0)
+ return mlen * REG_SIZE;
+ break;
case VS_OPCODE_PULL_CONSTANT_LOAD_GEN7:
- return arg == 1 ? mlen : 1;
+ if (arg == 1)
+ return mlen * REG_SIZE;
+ break;
+ default:
+ break;
+ }
+ switch (src[arg].file) {
+ case BAD_FILE:
+ return 0;
+ case IMM:
+ case UNIFORM:
+ return 4 * type_sz(src[arg].type);
default:
- return 1;
+ /* XXX - Represent actual execution size and vertical stride. */
+ return 8 * type_sz(src[arg].type);
}
}
bool interfered = false;
for (int i = 0; i < 3; i++) {
if (inst->src[0].in_range(scan_inst->src[i],
- scan_inst->regs_read(i)))
+ DIV_ROUND_UP(scan_inst->size_read(i), REG_SIZE)))
interfered = true;
}
if (interfered)
} else {
for (int i = 0; i < 3; i++) {
if (inst->dst.in_range(scan_inst->src[i],
- scan_inst->regs_read(i)))
+ DIV_ROUND_UP(scan_inst->size_read(i), REG_SIZE)))
interfered = true;
}
if (interfered)