Skip to content

Optimize count-leading-zero routines#591

Merged
mateoconlechuga merged 4 commits into
masterfrom
ctlz-optimizations
Apr 27, 2025
Merged

Optimize count-leading-zero routines#591
mateoconlechuga merged 4 commits into
masterfrom
ctlz-optimizations

Conversation

@calc84maniac
Copy link
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

3 participants