-
Notifications
You must be signed in to change notification settings - Fork 152
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
gu: Add clang-friendly codepath #149
Conversation
Can you not use Edit: Since you're using zig you could just export the zig-ified version of this function and use the |
I was able to use And my zig PSP SDK is trying to re-use as much of the C SDK as possible (since i dont have nearly as much time/resources/experience). Which is why im re-using the pspsdk C implementations of |
@davidgfnet could you take a look at this change? |
Can you please use __builtin_clz for both gcc and clang? gcc should generate the CLZ instruction natively. clang won't since it doesn't support it (AFAIK). In any case, should work for most compilers and gcc should still emit the faster asm. |
@Beyley are you still planning on updating this with the feedback given? I'd like to be able to merge this. |
My bad, i got busy and completely forgot! I'll switch it to use __builtin_clz on GCC aswell |
Done |
Thanks, if the ci passes I'll merge this. |
Clang refuses to assemble the
asm
macro, stating the instruction is "unavailable with your current feature set", and im not sure why, ive tried enabling a bunch of features, and nothing seems to make it happy. So i enabled the non-accelerated codepath on clang, which makes it compile, and allows most of gu (at least all thats needed for a cube sample) to be compiled using the LLVM/Clang 16 shipped with the Zig compiler