nv50/ir: avoid folding immediates into imad operations
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 2 Apr 2015 22:42:31 +0000 (18:42 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 2 Apr 2015 22:42:31 +0000 (18:42 -0400)
Commit 09ee907266 added logic to fold immediates into mad operations,
but the emission code is only there for fmad. Only allow it on float
types.

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

index dc048e605a50c46e468aeb77e11c667b5c573975..87d95892326fdbe645cd92273a88393d93376030 100644 (file)
@@ -2315,7 +2315,8 @@ NV50PostRaConstantFolding::visit(BasicBlock *bb)
              i->src(0).getFile() != FILE_GPR ||
              i->src(1).getFile() != FILE_GPR ||
              i->src(2).getFile() != FILE_GPR ||
-             i->getDef(0)->reg.data.id != i->getSrc(2)->reg.data.id)
+             i->getDef(0)->reg.data.id != i->getSrc(2)->reg.data.id ||
+             !isFloatType(i->dType))
             break;
 
          def = i->getSrc(1)->getInsn();