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

implement __builtin_clrsb #21

Open
JordiChauzi opened this issue Jan 13, 2020 · 1 comment
Open

implement __builtin_clrsb #21

JordiChauzi opened this issue Jan 13, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@JordiChauzi
Copy link

This should be a direct match to the cls instruction.

@JordiChauzi JordiChauzi added the enhancement New feature or request label Jan 13, 2020
@JordiChauzi
Copy link
Author

It seems like clang directly transforms this implicit (cf clang/lib/CodeGen/CGBuiltin.cpp).
We could try to replace clz(x < 0 ? ~x : x) - 1 (this is how clang expands the builtin) by our instruction in the lowering phase?

JordiChauzi pushed a commit that referenced this issue Aug 5, 2020
__builtin_available() pulls in __isOSVersionAtLeast() from
compiler-rt. Comment it out so we don't have to figure out how
to pull in this symbol...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant