[Mesa-dev] [PATCH] nv50/ir: make sure to erase src2 after optimizing to MOV

Ilia Mirkin imirkin at alum.mit.edu
Wed Nov 9 14:58:23 UTC 2016


On Wed, Nov 9, 2016 at 9:20 AM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> For all instructions with 3 sources (like OP_SLCT), src2 needs
> to be destroyed because srcExists(2) will return true although
> it's actually undefined.
>
> Spotted with my ADD3 series.

Sounds like the ADD3 series' addition to this function doesn't handle
this scenario. It's already properly handled by FMA/MAD, for example.

>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> index 9cf6ddc..ef31436 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> @@ -772,6 +772,7 @@ ConstantFolding::expr(Instruction *i,
>        break;
>     default:
>        i->op = i->saturate ? OP_SAT : OP_MOV; /* SAT handled by unary() */
> +      i->setSrc(2, NULL);
>        break;
>     }
>     i->subOp = 0;
> --
> 2.10.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list