-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
[AArch64] Suboptimal expansion of __builtin_bswap16
#77222
Comments
@llvm/issue-subscribers-backend-aarch64 Author: Karl Meakin (Kmeakin)
https://godbolt.org/z/jcxb4n97o
uint16_t rev16(uint16_t x) { return __builtin_bswap16(x); } expands to rev16:
rev w8, w0
lsr w0, w8, #<!-- -->16
ret instead of rev16:
rev16 w0, w0
ret
|
Latest clang seems to emit |
It is still suboptimal on Compiler Explorer |
this also applies to the |
I've been working on a patch for this at #105375 . |
https://godbolt.org/z/jcxb4n97o
expands to
instead of
__builtin_bswap32
and__builtin_bswap64
don't have the same issueThe text was updated successfully, but these errors were encountered: