diff options
author | Francisco Jerez <currojerez@riseup.net> | 2016-09-07 17:00:07 -0700 |
---|---|---|
committer | Francisco Jerez <currojerez@riseup.net> | 2016-09-14 14:50:53 -0700 |
commit | e1a918ba7be6b21303caa2d81671f2d3f17dd692 (patch) | |
tree | 19e1a7927355fb25ca96ce7adec637a767ce8c9d /src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp | |
parent | 27cb6b081eaffcf786686136f7961c4d78cc5586 (diff) | |
download | external_mesa3d-e1a918ba7be6b21303caa2d81671f2d3f17dd692.zip external_mesa3d-e1a918ba7be6b21303caa2d81671f2d3f17dd692.tar.gz external_mesa3d-e1a918ba7be6b21303caa2d81671f2d3f17dd692.tar.bz2 |
i965/fs: Replace fs_inst::regs_read with ::size_read using byte units.
The previous regs_read value can be recovered by rewriting each
reference of regs_read() like 'x = i.regs_read(j)' to 'x =
DIV_ROUND_UP(i.size_read(j), 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_fs_copy_propagation.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp index 0e239d2..f8238aa 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp @@ -44,7 +44,7 @@ struct acp_entry : public exec_node { fs_reg dst; fs_reg src; uint8_t size_written; - uint8_t regs_read; + uint8_t size_read; enum opcode opcode; bool saturate; }; @@ -367,7 +367,8 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry) /* Bail if inst is reading a range that isn't contained in the range * that entry is writing. */ - if (!region_contained_in(inst->src[arg], inst->regs_read(arg), + if (!region_contained_in(inst->src[arg], DIV_ROUND_UP(inst->size_read(arg), + REG_SIZE), entry->dst, DIV_ROUND_UP(entry->size_written, REG_SIZE))) return false; @@ -524,7 +525,8 @@ fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry) /* Bail if inst is reading a range that isn't contained in the range * that entry is writing. */ - if (!region_contained_in(inst->src[i], inst->regs_read(i), + if (!region_contained_in(inst->src[i], DIV_ROUND_UP(inst->size_read(i), + REG_SIZE), entry->dst, DIV_ROUND_UP(entry->size_written, REG_SIZE))) continue; @@ -785,7 +787,7 @@ fs_visitor::opt_copy_propagate_local(void *copy_prop_ctx, bblock_t *block, /* Make sure we kill the entry if this instruction overwrites * _any_ of the registers that it reads */ - if (regions_overlap(entry->src, entry->regs_read * REG_SIZE, + if (regions_overlap(entry->src, entry->size_read, inst->dst, inst->size_written)) entry->remove(); } @@ -800,7 +802,7 @@ fs_visitor::opt_copy_propagate_local(void *copy_prop_ctx, bblock_t *block, entry->dst = inst->dst; entry->src = inst->src[0]; entry->size_written = inst->size_written; - entry->regs_read = inst->regs_read(0); + entry->size_read = inst->size_read(0); entry->opcode = inst->opcode; entry->saturate = inst->saturate; acp[entry->dst.nr % ACP_HASH_SIZE].push_tail(entry); @@ -818,7 +820,7 @@ fs_visitor::opt_copy_propagate_local(void *copy_prop_ctx, bblock_t *block, entry->dst.offset += offset * REG_SIZE; entry->src = inst->src[i]; entry->size_written = size_written; - entry->regs_read = inst->regs_read(i); + entry->size_read = inst->size_read(i); entry->opcode = inst->opcode; if (!entry->dst.equals(inst->src[i])) { acp[entry->dst.nr % ACP_HASH_SIZE].push_tail(entry); |