OSDN Git Service

i965/vs: Avoid the MUL/MACH/MOV sequence for small integer multiplies.
authorEric Anholt <eric@anholt.net>
Sat, 8 Jun 2013 01:29:50 +0000 (18:29 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 10 Jun 2013 21:04:24 +0000 (14:04 -0700)
commit9a0bd682f958b642519709b879d4ceb39efbcaff
treeaef2a574074dc5055c0a8f628badeeefd22d22ff
parentd28e285d41bbb482384fb2174c92b9f63aa1175f
i965/vs: Avoid the MUL/MACH/MOV sequence for small integer multiplies.

We do a lot of multiplies by 3 or 4 for skinning shaders, and we can avoid
the sequence if we just move them into the right argument of the MUL.

On pre-IVB, this means reliably putting a constant in a position where it
can't be constant folded, but that's still better than MUL/MACH/MOV.

Improves GLB 2.7 trex performance by 0.788648% +/- 0.23865% (n=29/30)

v2: Fix test for pre-sandybridge.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp