From e7485f129495f4ede91c2706bc472120194c4eaa Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Thu, 27 May 2021 00:21:31 +0200 Subject: [PATCH] nv50/ir: when constant folding shl(mul, a) we need to copy muls type Also clear subop while at it as we might convert a shl.wrap to mul. Signed-off-by: Karol Herbst Reviewed-by: Ilia Mirkin Part-of: --- src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 385cb024e66..3b85151939d 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -1502,6 +1502,9 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s) bld.setPosition(i, false); i->op = OP_MUL; + i->subOp = 0; + i->dType = si->dType; + i->sType = si->sType; i->setSrc(0, si->getSrc(!muls)); i->setSrc(1, bld.loadImm(NULL, imm1.reg.data.u32 << imm0.reg.data.u32)); break;