nv50/ir: we can't do the add to mad conversion when the mul saturates
authorKarol Herbst <nouveau@karolherbst.de>
Thu, 28 Jan 2016 15:45:58 +0000 (16:45 +0100)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 16 Feb 2016 23:20:10 +0000 (18:20 -0500)
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp

index 35b1fa7795e230eda6aa38279bf810fde7c3e205..6192c0665e4756fa1191e2dc82bd66132cf18a73 100644 (file)
@@ -1635,6 +1635,9 @@ AlgebraicOpt::tryADDToMADOrSAD(Instruction *add, operation toOp)
    if (src->getUniqueInsn() && src->getUniqueInsn()->bb != add->bb)
       return false;
 
+   if (src->getInsn()->saturate)
+      return false;
+
    if (src->getInsn()->postFactor)
       return false;
    if (toOp == OP_SAD) {