Mesa (master): nv50/ir: avoid folding immediates into imad operations
Ilia Mirkin
imirkin at kemper.freedesktop.org
Thu Apr 2 22:49:39 UTC 2015
Module: Mesa
Branch: master
Commit: 01d3b750b3682f3774f1bd01fa07a6b3c8baf28e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=01d3b750b3682f3774f1bd01fa07a6b3c8baf28e
Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date: Thu Apr 2 18:42:31 2015 -0400
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 <imirkin at alum.mit.edu>
---
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 dc048e6..87d9589 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();
More information about the mesa-commit
mailing list