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

AtariDreams
Copy link
Contributor

Use compiler intrinsics to make _byteCount faster

@AtariDreams
Copy link
Contributor Author

@bnbarham @DougGregor Thoughts on this?

@AtariDreams
Copy link
Contributor Author

@FranzBusch Thoughts? Could you please run please test

@compnerd
Copy link
Collaborator

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.

@AtariDreams
Copy link
Contributor Author

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.

None yet

2 participants