diff options
author | Francisco Jerez <currojerez@riseup.net> | 2016-09-02 18:00:21 -0700 |
---|---|---|
committer | Francisco Jerez <currojerez@riseup.net> | 2016-09-14 14:50:53 -0700 |
commit | 69fdf13c215c2970feaca76f178a5c2c11ba8fec (patch) | |
tree | 6c7e0cca8aff841813b85d987da5882ff3e75847 /src/mesa/drivers/dri/i965/brw_vec4.cpp | |
parent | 69570bbad876bb9da609c3b651aacda28cecc542 (diff) | |
download | external_mesa3d-69fdf13c215c2970feaca76f178a5c2c11ba8fec.zip external_mesa3d-69fdf13c215c2970feaca76f178a5c2c11ba8fec.tar.gz external_mesa3d-69fdf13c215c2970feaca76f178a5c2c11ba8fec.tar.bz2 |
i965/vec4: Replace vec4_instruction::regs_written with ::size_written field in bytes.
The previous regs_written field can be recovered by rewriting each
rvalue reference of regs_written like 'x = i.regs_written' to 'x =
DIV_ROUND_UP(i.size_written, reg_unit)', and each lvalue reference
like 'i.regs_written = x' to 'i.size_written = x * reg_unit'.
For the same reason as in the previous patches, this doesn't attempt
to be particularly clever about simplifying the result in the interest
of keeping the rather lengthy patch as obvious as possible. I'll come
back later to clean up any ugliness introduced here.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vec4.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp index 3e57add..e54971f 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp @@ -1133,7 +1133,7 @@ vec4_visitor::opt_register_coalesce() 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. */ @@ -1169,7 +1169,7 @@ vec4_visitor::opt_register_coalesce() } /* 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. */ @@ -1197,7 +1197,7 @@ vec4_visitor::opt_register_coalesce() /* 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; } |