Re: [Mesa-dev] [PATCH 1/2] nir: Add is_divergent_vector search helper

2019-05-07 Thread Alyssa Rosenzweig
Makes sense, thank you for the clarification. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 1/2] nir: Add is_divergent_vector search helper

2019-05-07 Thread Jason Ekstrand
They aren't. It's just a function pointer. We could add support for it but it doesn't seem worth the effort. On May 7, 2019 17:42:23 Alyssa Rosenzweig wrote: Gotcha. I wasn't sure negations in the NIR search rule were possible...? ___ mesa-dev maili

Re: [Mesa-dev] [PATCH 1/2] nir: Add is_divergent_vector search helper

2019-05-07 Thread Alyssa Rosenzweig
D'oh. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 1/2] nir: Add is_divergent_vector search helper

2019-05-07 Thread Ilia Mirkin
Sigh ... given that there's both "is_used_by_if" and "is_not_used_by_if" ... gonna go with "no". On Tue, May 7, 2019 at 6:42 PM Alyssa Rosenzweig wrote: > > Gotcha. I wasn't sure negations in the NIR search rule were possible...? ___ mesa-dev mailing li

Re: [Mesa-dev] [PATCH 1/2] nir: Add is_divergent_vector search helper

2019-05-07 Thread Alyssa Rosenzweig
Gotcha. I wasn't sure negations in the NIR search rule were possible...? ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 1/2] nir: Add is_divergent_vector search helper

2019-05-07 Thread Ilia Mirkin
On Tue, May 7, 2019 at 5:45 PM Alyssa Rosenzweig wrote: > > > IMO better names might be is_scalar_swizzle or something. > > Ah, yes, that would be a better name! is_not_scalar_swizzle in this case > (logic is flipped). > > > Can num_components be 1? If so, then this will return false, whereas > >

Re: [Mesa-dev] [PATCH 1/2] nir: Add is_divergent_vector search helper

2019-05-07 Thread Alyssa Rosenzweig
> IMO better names might be is_scalar_swizzle or something. Ah, yes, that would be a better name! is_not_scalar_swizzle in this case (logic is flipped). > Can num_components be 1? If so, then this will return false, whereas > you probably wanted it to return true. I think that's the correct beha

Re: [Mesa-dev] [PATCH 1/2] nir: Add is_divergent_vector search helper

2019-05-07 Thread Jason Ekstrand
On Tue, May 7, 2019 at 9:28 AM Ilia Mirkin wrote: > Divergence is generally when multiple parallel "lanes" go in different > directions -- a jump that some lanes take and others don't, which > requires the GPU to execute some lanes first, and then the rest, > separately. > > IMO better names migh

Re: [Mesa-dev] [PATCH 1/2] nir: Add is_divergent_vector search helper

2019-05-07 Thread Ilia Mirkin
Divergence is generally when multiple parallel "lanes" go in different directions -- a jump that some lanes take and others don't, which requires the GPU to execute some lanes first, and then the rest, separately. IMO better names might be is_scalar_swizzle or something. On Mon, May 6, 2019 at 11

[Mesa-dev] [PATCH 1/2] nir: Add is_divergent_vector search helper

2019-05-06 Thread Alyssa Rosenzweig
This allows algebraic optimizations to check if the argument accesses multiple distinct components of a vector. So a swizzle like "xyz" will return true, but "yyy" will return false, as will a scalar. This can be useful for optimizations on vector processors, where a convergent swizzle can be done