From 01d3b750b3682f3774f1bd01fa07a6b3c8baf28e Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Thu, 2 Apr 2015 18:42:31 -0400 Subject: [PATCH] nv50/ir: avoid folding immediates into imad operations 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 --- src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index dc048e605a5..87d95892326 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -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(); -- 2.30.2