On SM35 this gives:
total instructions in shared programs : 6185058 -> 6181090 (-0.06%)
total gprs used in shared programs : 910722 -> 910722 (0.00%)
total local used in shared programs : 39072 -> 39072 (0.00%)
local gpr inst bytes
helped 0 0 2137 2137
hurt 0 0 0 0
Signed-off-by: Ilia Mirkin <[email protected]>
---
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 6dec208..9760128 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -1191,6 +1191,14 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue
&imm0, int s)
i->setSrc(1, bld.loadImm(NULL, imm0.reg.data.u32 +
imm1.reg.data.u32));
}
break;
+ case OP_MUL:
+ if (!isFloatType(si->dType) && si->src(1).getImmediate(imm1)) {
+ bld.setPosition(i, false);
+ i->op = OP_MUL;
+ i->setSrc(0, si->getSrc(0));
+ i->setSrc(1, bld.loadImm(NULL, (1 << imm0.reg.data.u32) *
imm1.reg.data.u32));
+ }
+ break;
case OP_SUB:
case OP_ADD:
int adds;
--
2.4.10
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev