i965/gs: Allow src0 immediates in GS_OPCODE_SET_WRITE_OFFSET.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 25 Sep 2015 06:47:29 +0000 (23:47 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 26 Sep 2015 19:02:31 +0000 (12:02 -0700)
commit08fe5799e61e9251dec163d000709ff33434216d
treef68270587ceee0dd9a2b1ab7228a417a5d97d5d5
parentf0a618ee7c26a3dd54292fbc2bfd914b0d680ed9
i965/gs: Allow src0 immediates in GS_OPCODE_SET_WRITE_OFFSET.

GS_OPCODE_SET_WRITE_OFFSET is a MUL with a constant src[1] and special
strides.  We can easily make the generator handle constant src[0]
arguments by instead generating a MOV with the product of both operands.

This isn't necessarily a win in and of itself - instead of a MUL, we
generate a MOV, which should be basically the same cost.  However, we
can probably avoid the earlier MOV to put src[0] into a register.

shader-db statistics for geometry shaders only:

total instructions in shared programs: 3207 -> 3173 (-1.06%)
instructions in affected programs:     3207 -> 3173 (-1.06%)
helped:                                11

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp