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

ARM 32/64 bit logic & version? #129

Open
jcelerier opened this issue Mar 30, 2023 · 0 comments
Open

ARM 32/64 bit logic & version? #129

jcelerier opened this issue Mar 30, 2023 · 0 comments
Assignees

Comments

@jcelerier
Copy link

jcelerier commented Mar 30, 2023

The ARM macros define the version to 8 if __aarch64__ is defined.
But I believe this is not correct: ARMv8 can run in aarch32 mode, where only __arm__ and not __aarch64__ is defined (and conversely, AArch64 mode does not define __arm__).

The correct thing I believe would be to use __ARM_ARCH which expands to e.g. 7 in ARMv7, 8 in ARMv8 etc for the version, and use the existence of __arm__ / __aarch64__ to distinguish between 32 & 64.

see repro: https://gcc.godbolt.org/z/xqqYWEaz6

ideally I would argue that AArch64 ought to be treated as an entirely different architecture, like PPC / PPC64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants