From: Ilia Mirkin Date: Wed, 20 Jan 2016 22:59:34 +0000 (-0500) Subject: nv50/ir: don't flip SHL(ADD) into ADD(SHL) if ADD sources have modifiers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dc3ac418bf889620c93f50c68ef55b9e9de3afd3;p=mesa.git 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 --- 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