i965/fs: Allow flipping cond mod for negated arguments.
authorMatt Turner <mattst88@gmail.com>
Tue, 30 Dec 2014 20:18:57 +0000 (12:18 -0800)
committerMatt Turner <mattst88@gmail.com>
Sat, 24 Jan 2015 01:57:40 +0000 (17:57 -0800)
commit9a3a2942240065d85e197e04d9612af696b9ea99
tree553b89976da6f065c5edc401cd5d3aaff00a2799
parentd6317beb463e1e362562fd0353a99b4b080c136c
i965/fs: Allow flipping cond mod for negated arguments.

This allows us to apply the optimization in cases where the CMP's
argument is negated, by flipping the conditional mod. For example, it
allows us to optimize this:

   add(8)       temp   a      b
   cmp.l.f0(8)  null   -temp  0.0

into

   add.g.f0(8)  temp   a      b

total instructions in shared programs: 5958360 -> 5955701 (-0.04%)
instructions in affected programs:     466880 -> 464221 (-0.57%)
GAINED:                                0
LOST:                                  1

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp
src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp