i965/vs: Extend opt_compute_to_mrf to handle limited "reswizzling"
authorEric Anholt <eric@anholt.net>
Sat, 1 Dec 2012 06:29:26 +0000 (22:29 -0800)
committerEric Anholt <eric@anholt.net>
Sat, 15 Dec 2012 00:06:30 +0000 (16:06 -0800)
commit471af25fc57dc43a8277b4b17ec82547287621d0
tree9ae9b8d4136083af11b830b4e1459c1c097d1639
parenta76a03f437df3c6458da5b0e9e70fd4d986fbdae
i965/vs: Extend opt_compute_to_mrf to handle limited "reswizzling"

The way our visitor works, scalar expression/swizzle results that get
stored in channels other than .x will have an intermediate MOV from
their result in the .x channel to the real .y (or whatever) channel, and
similarly for vec2/vec3 results.

By knowing how to adjust DP4-type instructions for optimizing out a
swizzled MOV, we can reduce instructions in common matrix multiplication
cases.

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