[Mesa-dev] [PATCH] nvc0/ir: be more careful about preserving modifiers in SHLADD creation
Samuel Pitoiset
samuel.pitoiset at gmail.com
Wed Oct 12 17:40:12 UTC 2016
I think we could also use those copy modifiers in some other places.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
On 10/12/2016 07:32 PM, Ilia Mirkin wrote:
> 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 <imirkin at 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);
>
>
More information about the mesa-dev
mailing list