Skip to content

Optimize count-leading-zero routines #591

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

Merged
merged 4 commits into from
Apr 27, 2025
Merged

Conversation

calc84maniac
Copy link
Contributor

Use a logarithmic search to count leading zeros instead of using shift loops, dramatically reducing runtime when there are many leading zeros. Consolidated the routines for each integer type into a single source file due to their interdependencies.

Also, fix ez80_builtin function definitions to provide the same return type as their corresponding compiler built-ins, and optimize some routines to use count-leading-zeros instead of popcount.

@mateoconlechuga mateoconlechuga merged commit dc85d6a into master Apr 27, 2025
9 checks passed
@mateoconlechuga mateoconlechuga deleted the ctlz-optimizations branch April 27, 2025 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants