i965/fs: Skip emitting MACH/MOV for small integers.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 7 Apr 2014 01:38:46 +0000 (18:38 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 8 Apr 2014 07:01:55 +0000 (00:01 -0700)
commit4311f9878d0d43a4214d6716eacf85e3443acd45
tree3259236c292129fa4bef168a9a0dfbf7a92c7ff3
parent7540be22d16bce68163a6478fa2d7a5aa1d9844d
i965/fs: Skip emitting MACH/MOV for small integers.

The vector backend already implemented this optimization, but
surprisingly, we never bothered to implement it in the scalar backend.

In addition to saving two instructions, this eliminates a use of the
accumulator as an explicit source, which is unsupported in SIMD16 mode
on Gen7+, which could help us gain SIMD16 programs.

Cuts 19.23% of the instructions in dolphin/efb2ram.shader_test.

v2: Rebase on is_16bit_integer_constant -> is_uint16_constant rename.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp