Re: [Mesa-dev] [RFC PATCH] nir/algebraic: Simplify max(abs(a), 0.0) -> abs(a)

2019-05-24 Thread Ilia Mirkin
On Fri, May 24, 2019 at 2:46 PM Alyssa Rosenzweig wrote: > > > I /think/ that should be adequate here too. > > Do inexact values not need to handle NaNs strictly, then? I'm not sure > what this corresponds to in the various GLs/CLs/Vulkan specs, hence > labeling this RFC. I don't know about Vulka

Re: [Mesa-dev] [RFC PATCH] nir/algebraic: Simplify max(abs(a), 0.0) -> abs(a)

2019-05-24 Thread Alyssa Rosenzweig
> I /think/ that should be adequate here too. Do inexact values not need to handle NaNs strictly, then? I'm not sure what this corresponds to in the various GLs/CLs/Vulkan specs, hence labeling this RFC. ___ mesa-dev mailing list mesa-dev@lists.freedeskt

Re: [Mesa-dev] [RFC PATCH] nir/algebraic: Simplify max(abs(a), 0.0) -> abs(a)

2019-05-24 Thread Ian Romanick
On 5/23/19 7:54 PM, Ilia Mirkin wrote: > How does max(NaN, 0) work? IIRC there's some provision that this > becomes 0, while abs(NaN) = NaN. That is correct. There are a couple other algebraic patterns that have the same potential problem (e.g., the min(max()) -> sat() patterns), and we just make

Re: [Mesa-dev] [RFC PATCH] nir/algebraic: Simplify max(abs(a), 0.0) -> abs(a)

2019-05-24 Thread Elie Tournier
On Thu, May 23, 2019 at 10:54:38PM -0400, Ilia Mirkin wrote: > How does max(NaN, 0) work? IIRC there's some provision that this > becomes 0, while abs(NaN) = NaN. Yes max(NaN, 0) should return 0. At least it's what we do with i965. See https://gitlab.freedesktop.org/mesa/mesa/blob/a42163cbbc1abe0

Re: [Mesa-dev] [RFC PATCH] nir/algebraic: Simplify max(abs(a), 0.0) -> abs(a)

2019-05-23 Thread Ilia Mirkin
How does max(NaN, 0) work? IIRC there's some provision that this becomes 0, while abs(NaN) = NaN. On Thu, May 23, 2019 at 10:47 PM Alyssa Rosenzweig wrote: > > I noticed this pattern in glmark's jellyfish scene. > > Assuming this is correct (it should be...?), could someone do a > shader-db run?

[Mesa-dev] [RFC PATCH] nir/algebraic: Simplify max(abs(a), 0.0) -> abs(a)

2019-05-23 Thread Alyssa Rosenzweig
I noticed this pattern in glmark's jellyfish scene. Assuming this is correct (it should be...?), could someone do a shader-db run? Thank you! Signed-off-by: Alyssa Rosenzweig Cc: Ian Romanick --- src/compiler/nir/nir_opt_algebraic.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/comp