Skip to content

nu_bsf was returning a wrong value in the LDC path#27

Merged
LunaTheFoxgirl merged 1 commit into
Inochi2D:mainfrom
p0nce:fix_nu_bsf
Jun 19, 2026
Merged

nu_bsf was returning a wrong value in the LDC path#27
LunaTheFoxgirl merged 1 commit into
Inochi2D:mainfrom
p0nce:fix_nu_bsf

Conversation

@p0nce

@p0nce p0nce commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Explanation: The 'llvm.cttz' intrinsic counts the trailing (least significant) zeros in a variable. This number of zeroes is already the index of the first least significant set bit. Since nu_bsf(0) is UB, no edge case.

This helps getting the intel-intrinsics test suite working on nurt+wasm32

Explanation: The 'llvm.cttz' intrinsic counts the trailing (least significant) zeros in a variable.
This number of zeroes is already the index of the first least significant set bit.
Since nu_bsf(0) is UB, no edge case.
@LunaTheFoxgirl LunaTheFoxgirl merged commit 9a0679a into Inochi2D:main Jun 19, 2026
24 of 35 checks passed
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