regs_written(const vec4_instruction *inst)
{
/* XXX - Take into account register-misaligned offsets correctly. */
- return inst->regs_written;
+ assert(inst->dst.file != UNIFORM && inst->dst.file != IMM);
+ return DIV_ROUND_UP(inst->size_written, REG_SIZE);
}
/**
inst) {
_scan_inst = scan_inst;
- if (inst->src[0].in_range(scan_inst->dst, scan_inst->regs_written)) {
+ if (inst->src[0].in_range(scan_inst->dst, DIV_ROUND_UP(scan_inst->size_written, REG_SIZE))) {
/* Found something writing to the reg we want to coalesce away. */
if (to_mrf) {
/* SEND instructions can't have MRF as a destination. */
}
/* This doesn't handle coalescing of multiple registers. */
- if (scan_inst->regs_written > 1)
+ if (scan_inst->size_written > REG_SIZE)
break;
/* Mark which channels we found unconditional writes for. */
/* If somebody else writes the same channels of our destination here,
* we can't coalesce before that.
*/
- if (inst->dst.in_range(scan_inst->dst, scan_inst->regs_written) &&
+ if (inst->dst.in_range(scan_inst->dst, DIV_ROUND_UP(scan_inst->size_written, REG_SIZE)) &&
(inst->dst.writemask & scan_inst->dst.writemask) != 0) {
break;
}
bool read_flag = false;
foreach_inst_in_block_reverse_starting_from(vec4_instruction, scan_inst, inst) {
if (inst->src[0].in_range(scan_inst->dst,
- scan_inst->regs_written)) {
+ DIV_ROUND_UP(scan_inst->size_written, REG_SIZE))) {
if ((scan_inst->predicate && scan_inst->opcode != BRW_OPCODE_SEL) ||
scan_inst->dst.offset / REG_SIZE != inst->src[0].offset / REG_SIZE ||
(scan_inst->dst.writemask != WRITEMASK_X &&
if (!src || src->file != VGRF)
return false;
- return (src->in_range(inst->dst, inst->regs_written) &&
+ return (src->in_range(inst->dst, DIV_ROUND_UP(inst->size_written, REG_SIZE)) &&
inst->dst.writemask & (1 << BRW_GET_SWZ(src->swizzle, ch)));
}
a->shadow_compare == b->shadow_compare &&
a->dst.writemask == b->dst.writemask &&
a->force_writemask_all == b->force_writemask_all &&
- a->regs_written == b->regs_written &&
+ a->size_written == b->size_written &&
operands_match(a, b);
}
vec4_builder(this).at_end().annotate(current_annotation, base_ir);
const dst_reg tmp = bld.vgrf(BRW_REGISTER_TYPE_UD, 2);
bld.emit(SHADER_OPCODE_MEMORY_FENCE, tmp)
- ->regs_written = 2;
+ ->size_written = 2 * REG_SIZE;
break;
}
vec4_instruction *inst =
bld.emit(op, dst, src_reg(payload), usurface, brw_imm_ud(arg));
inst->mlen = sz;
- inst->regs_written = ret_sz;
+ inst->size_written = ret_sz * REG_SIZE;
inst->header_size = header_sz;
inst->predicate = pred;
this->predicate = BRW_PREDICATE_NONE;
this->predicate_inverse = false;
this->target = 0;
- this->regs_written = (dst.file == BAD_FILE ? 0 : 1);
+ this->size_written = (dst.file == BAD_FILE ? 0 : REG_SIZE);
this->shadow_compare = false;
this->ir = NULL;
this->urb_write_flags = BRW_URB_WRITE_NO_FLAGS;
src_reg zero(brw_imm_f(0.0f));
bld.ADD(offset(dest, 2), src0, src1);
bld.emit(SHADER_OPCODE_TEX, dest, src2)
- ->regs_written = 4;
+ ->size_written = 4 * REG_SIZE;
bld.CMP(bld.null_reg_f(), offset(src_reg(dest), 2), zero, BRW_CONDITIONAL_GE);
/* = Before =