i965/vec4: Add ability to reswizzle arbitrary swizzles

Graphics / Mesa 3D Graphics Library / Mesa - Matt Turner [gmail.com] - 5 September 2014 12:22 UTC

Before commit 04895f5c we would only reswizzle dot product instructions (since they wrote the same value into all channels, and we didn't have to think about anything else). That commit extended reswizzling to cases when the swizzle was single valued -- i.e., writing the same result into all channels.

But allowing reswizzling of arbitrary things is actually really easy and is even less code. (Why didn't we do this in the first place?!)

total instructions in shared programs: 4266079 -> 4261000 (-0.12%) instructions in affected programs: 351933 -> 346854 (-1.44%)

e8df6a6 i965/vec4: Add ability to reswizzle arbitrary swizzles.
src/mesa/drivers/dri/i965/brw_vec4.cpp | 74 ++++++++------------------------
1 file changed, 18 insertions(+), 56 deletions(-)

Upstream: cgit.freedesktop.org


  • Share