i965/fs: in MAD optimizations, switch last argument to be immediate
authorTapani Pälli <tapani.palli@intel.com>
Mon, 16 Mar 2015 08:08:08 +0000 (10:08 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Tue, 17 Mar 2015 05:59:30 +0000 (07:59 +0200)
commit627c68308683abbd6e563a09af6013a33938a790
treed24266b6bd8a788ce2198e8fe923f7c5d58e6666
parent60f77b22b1e3bbef7e4d1f10012acf830d81ed7b
i965/fs: in MAD optimizations, switch last argument to be immediate

Commit bb33a31 introduced optimizations that transform cases of MAD
in to simpler forms but it did not take in to account that src[0]
can not be immediate and did not report progress. Patch switches
src[0] and src[1] if src[0] is immediate and adds progress
reporting. If both sources are immediates, this is taken care of by
the same opt_algebraic pass on later run.

v2: Fix for all cases, use temporary fs_reg (Matt, Kenneth)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89569
Reviewed-by: Francisco Jerez <currojerez@riseup.net> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
src/mesa/drivers/dri/i965/brw_fs.cpp