Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vectorize LeadingZeroCount & TrailingZeroCount. #98877

Merged
merged 4 commits into from
Feb 26, 2024

Conversation

eiriktsarpalis
Copy link
Member

Using code from #98275 and 1da8d2f. Contributes to #97193.

@ghost
Copy link

ghost commented Feb 23, 2024

Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.

Issue Details

Using code from #98275 and 1da8d2f. Contributes to #97193.

Author: eiriktsarpalis
Assignees: eiriktsarpalis
Labels:

area-System.Numerics

Milestone: -

@eiriktsarpalis eiriktsarpalis added this to the 9.0.0 milestone Feb 23, 2024
Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

if (sizeof(T) == 8) return Avx512CD.VL.LeadingZeroCount(x.AsUInt64()).As<ulong, T>();
}

Debug.Assert(AdvSimd.IsSupported);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want these to be explicit. It makes it work better with the trimmer for other platforms and matches the requirements we have for corelib around using intrinsics (this isn't in corelib, but its still good to follow those practices as its required for special crossgen handling to ever be usable for the assembly).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of TP is like this, as I'd previously addressed feedback around throws. I suggest this be merged as is, and if we want to change the approach, it be done across all operators en mass together.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants