Skip to content

Introduce IR UnaryOps for numberOfLeadingZeros (clz). #5181

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 1 commit into from
May 29, 2025

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented May 27, 2025

This particular operation is used by a number of our core numerical algorithms. It makes sense for it to receive a dedicated opcode.

The dedicated opcode lets the optimizer reason about its purity.


Another benefit is that we avoid the $uI() call around Math.clz32 in fastLinkJS. For a core function like this, it's not entirely useless.

@sjrd sjrd requested a review from gzm0 May 27, 2025 08:57
This particular operation is used by a number of our core numerical
algorithms. It makes sense for it to receive a dedicated opcode.

The dedicated opcode lets the optimizer reason about its purity.
@sjrd sjrd merged commit a2ee9df into scala-js:main May 29, 2025
3 checks passed
@sjrd sjrd deleted the ir-clz branch May 29, 2025 19:20
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