[Mesa-dev] [PATCH 2/3] nv50/ir: avoid folding mul + add if the mul has a dnz

Samuel Pitoiset samuel.pitoiset at gmail.com
Sun Mar 13 11:45:58 UTC 2016


This doesn't seem crazy.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

On 03/13/2016 04:07 AM, Ilia Mirkin wrote:
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>   src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> index 6192c06..66e7b2e 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> @@ -1635,11 +1635,10 @@ AlgebraicOpt::tryADDToMADOrSAD(Instruction *add, operation toOp)
>      if (src->getUniqueInsn() && src->getUniqueInsn()->bb != add->bb)
>         return false;
>
> -   if (src->getInsn()->saturate)
> +   if (src->getInsn()->saturate || src->getInsn()->postFactor ||
> +       src->getInsn()->dnz)
>         return false;
>
> -   if (src->getInsn()->postFactor)
> -      return false;
>      if (toOp == OP_SAD) {
>         ImmediateValue imm;
>         if (!src->getInsn()->src(2).getImmediate(imm))
>


More information about the mesa-dev mailing list