i965/fs: Constant-fold immediates in src0 of SEL instructions.
authorEric Anholt <eric@anholt.net>
Sat, 9 Apr 2011 18:29:59 +0000 (08:29 -1000)
committerEric Anholt <eric@anholt.net>
Thu, 14 Apr 2011 00:57:53 +0000 (17:57 -0700)
commit4847f802c28e595130bda14055cd52c9b1f51cd7
treeba3193d017e5ded507c65dc8809e12dcd3ec6e15
parent811c147220d2630b769e505ce4d40ef9108fe034
i965/fs: Constant-fold immediates in src0 of SEL instructions.

This is like what we do for add/mul, but we have to invert the
predicate to choose the other source instead.

This removes 5 extra moves of constants in nexuiz shaders.  No
statistically significant performance difference on my Sandybridge
laptop (n=5).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_eu.c
src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h