[Mesa-dev] Fix negation source modifer when used with logical instructions on Broadwell
Abdiel Janulgue
abdiel.janulgue at linux.intel.com
Tue Jun 3 15:59:20 PDT 2014
The negation source modifer for logical instructions changed its meaning on Broadwell that
can cause the source bits to be inverted. This patch series addresses a current issue in
our Broadwell driver where a shader could cause the negation source modifier to be set on
logical operations and produce wrong results.
A piglit test demonstrates this issue[1].
For example:
and dst, src0, -src1
actually does
dst = src0 & ~src1
Conversely, since the logical source modifier is now logical, this capability
allows expressions like a and (not b) to be calculated with one instruction.
No regressions observed on existing piglit tests. Shader-db did not report any gains
or loses as well.
Thanks to Matt Turner for initial feeback and advice.
Abdiel Janulgue (6):
i965/fs: Refactor check for potential copy propagated instructions.
i965/fs: copy propagate 'NOT' instruction when used with logical operation
i965/fs: skip copy-propate for negated logical instructions and 'NOT' src registers
i965/vec4: copy propagate 'NOT' instruction when used with logical operation
i965/vec4: skip copy-propate for negated logical instructions and 'NOT' src registers
i965/disasm: Properly debug negate source modifier for logical instructions
src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp | 48 +++++++++++++++++++++++-------
src/mesa/drivers/dri/i965/brw_vec4.h | 4 ++-
src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp | 76 ++++++++++++++++++++++++++++++++----------------
src/mesa/drivers/dri/i965/gen8_disasm.c | 24 +++++++++++++--
4 files changed, 113 insertions(+), 39 deletions(-)
--
[1] http://lists.freedesktop.org/archives/piglit/2014-June/011002.html
More information about the mesa-dev
mailing list