-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Treat TZCNT/POPCNT/LZCNT as never negative #64951
Conversation
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsCheck for population count, trailing zero count, and leading zero count intrinsics when determining integral rage. Closes #64909
|
Looks like this PR found a couple of improvements 👍
these functionf are pretty perf sensitive + we won't have to uglify code with uint casts, you can probably even remove some existing uint casts (e.g. I put it in IndexOf) if you want 🙂 |
@EgorBo, Are you referring to this, for instance? runtime/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs Lines 529 to 530 in 3fc8b09
|
no, I meant this: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs#L612 |
I'd defer it to a new PR, due to lack of time on my part. |
@trympet thanks! |
Thanks @trympet for your first contribution to JIT. |
I didn't realize I forgot to merge :-) |
Check for population count, trailing zero count, and leading zero count intrinsics when determining integral rage.
This change makes most of these casts redundant:
Closes #64909