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

Optimize _byteCount with compiler intrinsics #4830

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AZero13
Copy link
Contributor

@AZero13 AZero13 commented Sep 29, 2023

Use compiler intrinsics to make _byteCount faster

@AZero13 AZero13 force-pushed the popcount branch 2 times, most recently from bc35df0 to be2ce79 Compare September 29, 2023 00:12
@AZero13
Copy link
Contributor Author

AZero13 commented Sep 30, 2023

@bnbarham @DougGregor Thoughts on this?

@AZero13
Copy link
Contributor Author

AZero13 commented Sep 30, 2023

@FranzBusch Thoughts? Could you please run please test

@compnerd
Copy link
Member

compnerd commented Oct 2, 2023

There is no guarantee that this is faster. The loop idiom recognizers will often make the appropriate optimizations. This simply makes the code less portable - __builtin_ctz is not a valid directive for MSVC.

@AZero13
Copy link
Contributor Author

AZero13 commented Oct 2, 2023

There is no guarantee that this is faster. The loop idiom recognizers will often make the appropriate optimizations. This simply makes the code less portable - __builtin_ctz is not a valid directive for MSVC.

I can show you on compiler explorer.

Use compiler intrinsics to make _byteCount faster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants