summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2015-05-08 18:54:08 -0400
committerIlia Mirkin <[email protected]>2015-05-08 18:56:56 -0400
commitc4ac09e30e2520b0ac6d403eb6c77f23e7f24f49 (patch)
treefd5bc998e5bc326b10d4306eaad026e447041bd7 /src/gallium/drivers/nouveau
parent3bdbc1e436828606d0b549b9480e7cc28b42d159 (diff)
nv50/ir: only propagate saturate up if some actual folding took place
The former logic would copy the saturate up to any mul with an immediate if there was a subsequent mul with a saturate. However we only want to do that if we collapsed 2 muls by multiplying their immediates (or were able to put the immediate in as a post-multiplier). Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected]
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 87d95892326..14446b6b53f 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -705,6 +705,7 @@ ConstantFolding::tryCollapseChainedMULs(Instruction *mul2,
mul1->setSrc(s1, bld.loadImm(NULL, f * imm1.reg.data.f32));
mul1->src(s1).mod = Modifier(0);
mul2->def(0).replace(mul1->getDef(0), false);
+ mul1->saturate = mul2->saturate;
} else
if (prog->getTarget()->isPostMultiplySupported(OP_MUL, f, e)) {
// c = mul a, b
@@ -713,8 +714,8 @@ ConstantFolding::tryCollapseChainedMULs(Instruction *mul2,
mul2->def(0).replace(mul1->getDef(0), false);
if (f < 0)
mul1->src(0).mod *= Modifier(NV50_IR_MOD_NEG);
+ mul1->saturate = mul2->saturate;
}
- mul1->saturate = mul2->saturate;
return;
}
}