i965/fs: Simplify and fix register offset calculation of try_copy_propagate().
authorFrancisco Jerez <currojerez@riseup.net>
Tue, 10 May 2016 23:01:56 +0000 (16:01 -0700)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Mon, 16 May 2016 07:55:32 +0000 (09:55 +0200)
commit0fb19806c069cbf34aaf02e77f5ae37a9e4cf3b0
treeeea210f9ae3636572d9ac5f596f9b89d202d9ece
parent7aa53cd725cc2287fc206033120e08cde74cde2a
i965/fs: Simplify and fix register offset calculation of try_copy_propagate().

try_copy_propagate() was special-casing UNIFORM registers (the
BAD_FILE, ARF and FIXED_GRF cases are dead, see the assertion at the
top of the function) and then failing to take into account the
possibility of the instruction reading from a non-zero offset of the
destination of the copy.  The VGRF/ATTR handling takes it into account
correctly, and there is no reason we couldn't use the exact same logic
for the UNIFORM file aside from the fact that uniforms represent
reg_offset in different units.  We can work around that easily by
defining an additional constant with the right unit reg_offset is
expressed in.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp