diff options
author | Iago Toral Quiroga <[email protected]> | 2016-01-15 14:59:13 +0100 |
---|---|---|
committer | Samuel Iglesias Gonsálvez <[email protected]> | 2016-05-10 11:25:09 +0200 |
commit | 34ed61b33459c975074df0e83a2161fb76526621 (patch) | |
tree | 6c883436042b02c63d2986a3c89ebcf79da3acfe /src/mesa | |
parent | 9741cff1ec3bdc0edf4122bf20aa3447dd8cb741 (diff) |
i965/fs/lower_simd_width: Fix registers written for split instructions
When the original instruction had a stride > 1, the combined registers
written by the split instructions won't amount to the same register space
written by the original instruction because the split instructions will
use a stride of 1. The current code assumed otherwise and computed the
number of registers written by split instructions as an equal share based
on the relation between the lowered width and the original execution size
of the instruction.
It is only after the split, when we interleave the components of the result
from the lowered instructions back into the original dst register, that the
original stride takes effect and we write all the registers specified by
the original instruction.
Just make the number of register written the same as the vgrf space we
allocate for the dst of the split instruction.
Fixes crashes in fp64 tests produced as a result of assigning incorrectly the
number of registers written by split instructions, which led to incorrect
validation of the size of the writes against the allocated vgrf space.
Reviewed-by: Francisco Jerez <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 3d331d191b7..dcbb4bd8b84 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -4722,8 +4722,8 @@ fs_visitor::lower_simd_width() split_inst.dst = dsts[i] = lbld.vgrf(inst->dst.type, dst_size); split_inst.regs_written = - DIV_ROUND_UP(inst->regs_written * lower_width, - inst->exec_size); + DIV_ROUND_UP(type_sz(inst->dst.type) * dst_size * lower_width, + REG_SIZE); } lbld.emit(split_inst); |