First off, src2 was being given the wrong modifier, and secondly we were
forgetting to clear src0's modifier. Instead let's use the
ValueRef-based setter, which can also copy modifiers properly.

Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu>
---
 src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp 
b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index e1596d8..dea9197 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -2183,7 +2183,6 @@ LateAlgebraicOpt::tryADDToSHLADD(Instruction *add)
    Value *src1 = add->getSrc(1);
    ImmediateValue imm;
    Instruction *shl;
-   Modifier mod[2];
    Value *src;
    int s;
 
@@ -2208,14 +2207,9 @@ LateAlgebraicOpt::tryADDToSHLADD(Instruction *add)
    if (!shl->src(1).getImmediate(imm))
       return false;
 
-   mod[0] = add->src(0).mod;
-   mod[1] = add->src(1).mod;
-
    add->op = OP_SHLADD;
    add->setSrc(2, add->src(!s));
-   add->src(2).mod = mod[s];
-
-   add->setSrc(0, shl->getSrc(0));
+   add->setSrc(0, shl->src(0));
    add->setSrc(1, new_ImmediateValue(shl->bb->getProgram(), imm.reg.data.u32));
    add->src(1).mod = Modifier(0);
 
-- 
2.7.3

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to