From dc3ac418bf889620c93f50c68ef55b9e9de3afd3 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Wed, 20 Jan 2016 17:59:34 -0500 Subject: [PATCH] nv50/ir: don't flip SHL(ADD) into ADD(SHL) if ADD sources have modifiers Fixes: 31fde8fa (nv50/ir: flip shl(add, imm) into add(shl, imm)) Signed-off-by: Ilia Mirkin --- src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 75773553840..95e9fdfc57d 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -1229,6 +1229,8 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s) adds = 1; else return; + if (si->src(!adds).mod != Modifier(0)) + return; // SHL(ADD(x, y), z) = ADD(SHL(x, z), SHL(y, z)) // This is more operations, but if one of x, y is an immediate, then -- 2.30.2