By: Jan Wassenberg (jan.wassenberg.delete@this.gmail.com), June 4, 2022 11:14 pm
Room: Moderated Discussions
Eric Fink (eric.delete@this.anon.com) on June 4, 2022 5:59 am wrote:
> Two reasons. First - the geometric tests I am doing usually involve a bunch of data-parallel
> computations and then picking an extremum of some sort (e.g. intersect a segment against
> eight lines and find which intersection point is the “furthest”). Horizontal reduction
> in neon gives me the result directly and immediately in such cases. Second - NEON offers
> you more options when working with NaNs, which simplifies dealing with edge cases.
I see, thanks - with movmskb you still have to separately look up the 'winning' lane, whereas reduction gets it immediately. FWIW there is also _mm_minpos_epu16 but that's far too limited and also wasn't ported to AVX2.
> Thinking about it, you are probably right. I am not doing enough isolated operations for them
> to be a meaningful optimization. And the actually performance-critical parts would definitely
> benefit from a redesign. Thanks, you certainly gave me something to think about :)
:)
> Two reasons. First - the geometric tests I am doing usually involve a bunch of data-parallel
> computations and then picking an extremum of some sort (e.g. intersect a segment against
> eight lines and find which intersection point is the “furthest”). Horizontal reduction
> in neon gives me the result directly and immediately in such cases. Second - NEON offers
> you more options when working with NaNs, which simplifies dealing with edge cases.
I see, thanks - with movmskb you still have to separately look up the 'winning' lane, whereas reduction gets it immediately. FWIW there is also _mm_minpos_epu16 but that's far too limited and also wasn't ported to AVX2.
> Thinking about it, you are probably right. I am not doing enough isolated operations for them
> to be a meaningful optimization. And the actually performance-critical parts would definitely
> benefit from a redesign. Thanks, you certainly gave me something to think about :)
:)