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

Request LLVM to implement _CountLeadingZeros and _CountLeadingZeros64 when targeting ARM/ARM64 #1586

Closed
cbezault opened this issue Jan 24, 2021 · 5 comments · Fixed by #4947
Labels
ARM Related to the 32-bit ARM architecture ARM64 Related to the ARM64 architecture enhancement Something can be improved fixed Something works now, yay!

Comments

@cbezault
Copy link
Contributor

Currently LLVM does not define the MSVC builtins _CountLeadingZeros and _CountLeadingZeros64 when targeting ARM/ARM64. This forces us to maintain a parallel code path in <bit> for LLVM targeting ARM.

We should make a bug/feature request asking the LLVM devs to implement these builtins when targeting ARM/ARM64.

@cbezault cbezault added enhancement Something can be improved ARM Related to the 32-bit ARM architecture ARM64 Related to the ARM64 architecture labels Jan 24, 2021
@AraHaan
Copy link

AraHaan commented Feb 9, 2021

Why not request it now?

@AlexGuteniev
Copy link
Contributor

Can you use __builtin_clz / __builtin_clzll?

https://godbolt.org/z/G4cdsz

@AlexGuteniev
Copy link
Contributor

Ah, you use them already, but want to get rid of this separation

@AraHaan
Copy link

AraHaan commented Feb 16, 2021

Why not alias those as _ClountLeadingZeros and _CountLeadingZeros64 on clang when using ARM / ARM64 instead?

@frederick-vs-ja
Copy link
Contributor

LLVM-66554 added these intrinsics to Clang 18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM Related to the 32-bit ARM architecture ARM64 Related to the ARM64 architecture enhancement Something can be improved fixed Something works now, yay!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants