History log of /external/mesa3d/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
05974cb8c6cce68344b5622c5cb55adf3e51164c 25-Oct-2012 Kenneth Graunke <kenneth@whitecape.org> i965/vs: Preserve the type when copy propagating into an instruction.

Consider the following code, which reinterprets a register as a
different type:

mov(8) g6<1>F g1.4<0,4,1>.xF
and(8) g5<1>.xUD g6<4,4,1>.xUD 0x7fffffffUD

Copy propagation would notice that we can replace the use of g6 with
g1.4 and eliminate the MOV. Unfortunately, it failed to preserve the UD
type, incorrectly generating:

and(8) g5<1>.xUD g6<4,4,1>.xF 0x7fffffffUD

Found while debugging Ian's uncommitted ARB_vertex_program LOG opcode
test with my new Mesa IR -> Vec4 IR translator.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 03ea156f1b3e57ef223c0340afb49e513fa0b407)
/external/mesa3d/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
7ccf04ebcf6284a68ab6c571dabc5f3e0c6b740b 05-Jan-2012 Kenneth Graunke <kenneth@whitecape.org> i965/vs: Fix invalid array access in copy propagation.

Accessing virtual_grf_reg_map[inst->dst.reg] is invalid if
inst->dst.file != GRF. Since is_direct_copy already implies a GRF
destination, we can just move the check earlier.

Fixes a regression in commit 07ee9f374f2946f852896e9264c7fa83eafc3f16.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44302
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
07ee9f374f2946f852896e9264c7fa83eafc3f16 24-Dec-2011 Kenneth Graunke <kenneth@whitecape.org> i965/vs: Properly clear cur_value when propagating direct copies.

Consider the following code:

MOV A.x, B.x
MOV B.x, C.x

After the first line, cur_value[A][0] == B, indicating that A.x's
current value came from register B.

When processing the second line, we update cur_value[B][0] to C.
However, for drect copies, we fail to reset cur_value[A][0] to NULL.
This is necessary because the value of A is no longer the value of B.

Fixes Counter-Strike: Source in Wine (where the menu rendered completely
black in DX9 mode), completely white textures in Civilization V, and the
new Piglit test glsl-vs-copy-propagation-1.shader_test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42032
Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
443c8d1ab7ddad9392046e041e4e9a4fda7cd6e7 24-Dec-2011 Kenneth Graunke <kenneth@whitecape.org> i965/vs: Fix incorrect subscript when resetting copy propagation records.

In this code, 'i' loops over the number of virtual GRFs, while 'j' loops
over the number of vector components (0 <= j <= 3).

It can't possibly be correct to see if bit 'i' is set in the destination
writemask, as it will have values much larger than 3. Clearly this is
supposed to be 'j'.

Found by inspection.

Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
8fad0f99989866eeb72889a84f12f6f817334ddb 02-Nov-2011 Paul Berry <stereotype441@gmail.com> i965: Fix constant propagation into 32-bit integer MUL.

i965's MUL instruction can't take an immediate value as its first
argument. So normally, if constant propagation wants to propagate a
constant into the first argument of a MUL instruction, it swaps the
order of the two arguments.

This doesn't work for 32-bit integer (and unsigned integer)
multiplies, because the MUL operation is asymmetric in that case (it
multiplies 16 bits of one operand by 32 bits of the other).

Fixes piglit tests {vs,fs}-multiply-const-{ivec4,uvec4}.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
31874f074c2eaf2a9421c57f0798c79078d296c4 04-Oct-2011 Eric Anholt <eric@anholt.net> i965/vs: Fix comparisons with uint negation.

The condmod instruction ends up generating garbage condition codes,
because apparently the comparison happens on the accumulator value (33
bits for UD), not the truncated value that would be written.

Fixes vs-op-neg-*

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
39790b6450b770cd402bc08b9416cab67de3dedb 23-Sep-2011 Eric Anholt <eric@anholt.net> i965/vs: Fix access beyond array bounds for non-GRF operands.

Caught by valgrind. I never saw a segfault from it (probably because
it's hard to have much more of any other file than GRF).
/external/mesa3d/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
20da49b2677fcf6a721b8a46e037a01e842fee61 15-Sep-2011 Paul Berry <stereotype441@gmail.com> i965 new VS: Fix copy propagation of double negatives.

When copy propagating a value into an instruction that negates its
argument, we need to invert the sense of the value's "negate" flag, so
that -(+x) becomes -x and -(-x) becomes +x.

Previously, we were always setting the value's "negate" flag to true
in this circumstance, so that both -(+x) and -(-x) turned into -x.

Fixes Piglit test vs-double-negative.shader_test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
29361e14df8e5e92df747d52303da2c454e2cacc 02-Sep-2011 Eric Anholt <eric@anholt.net> i965/vs: Allow copy propagation on GRFs.

Further reduces instruction count by 4.0% in 40.7% of the vertex
shaders.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
6d0c018776977219e355c534eaafec53a30d993b 02-Sep-2011 Eric Anholt <eric@anholt.net> i965/vs: Clear tracked copy propagation values whose source gets overwritten.

This only occurs for GRFs, and hasn't mattered until now because we
only copy propagated non-GRFs.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
cc9eb936c220267b6130b705fc696d05906a31df 02-Sep-2011 Eric Anholt <eric@anholt.net> i965/vs: Add support for copy propagation of the UNIFORM and ATTR files.

Removes 2.0% of the instructions from 35.7% of vertex shaders in shader-db.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
42ce13195b94d0d51ca8e7fa5eed07fde8f37988 30-Aug-2011 Eric Anholt <eric@anholt.net> i965/vs: Add constant propagation to a few opcodes.

This differs from the FS in that we track constants in each
destination channel, and we we have to look at all the swizzled source
channels. Also, the instruction stream walk is done in an O(n) manner
instead of O(n^2).

Across shader-db, this reduces 8.0% of the instructions from 60.0% of
the vertex shaders, leaving us now behind the old backend by 11.1%
overall.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp