[Mesa-dev] [PATCH 2/5] glsl: Propagate negates through multiplication chains.

Matt Turner mattst88 at gmail.com
Thu Apr 9 09:22:59 PDT 2015


On Wed, Apr 8, 2015 at 4:38 PM, Ian Romanick <idr at freedesktop.org> wrote:
> From: Matt Turner <mattst88 at gmail.com>
>
> We propagate negations to the right-most leaves of the multiplication
> expression trees:
>
>  - mul(neg(x), neg(y)) -> mul(x, y)
>  - mul(neg(x), y) -> neg(mul(x, y))
>  - mul(x, neg(y)) -> neg(mul(x, y))

I've had an updated version of this patch that propagates negates up
multiplication trees. I've thought that would be better, but I've
never gotten the changes to be profitable with NIR.

This is an improvement as-is though, so let's do it.


More information about the mesa-dev mailing list