nv50/ir: attempt to do more constant folding on mad -> add conversion
authorIlia Mirkin <imirkin@alum.mit.edu>
Mon, 7 Dec 2015 04:49:48 +0000 (23:49 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Wed, 30 Dec 2015 17:29:07 +0000 (12:29 -0500)
commitd50e6128b815595f7918d6818e8a9cd20d53efd1
tree0ea53709665e534c3d0cdcdfa71e6d7e863f473e
parent97685ff10e0f866d809fc1e8f115fb6e92ce717c
nv50/ir: attempt to do more constant folding on mad -> add conversion

The add might actually have a 0 as an argument, which would convert it
into a mov. Make sure to detect that. Also avoid the hack of putting the
immediate directly into the instruction, instead use a mov to put it
into place and let the later LoadPropagation pass place it if possible.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp