-
Notifications
You must be signed in to change notification settings - Fork 262
Add loongarch64 support #535
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
base: master
Are you sure you want to change the base?
Conversation
xen0n
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a drive-by review prompted by loongson-community/discussions#105. The comments are made based on the latest (v0.2) version of Software Development and Build Convention for LoongArch Architectures.
| # define OGRE_CPU OGRE_CPU_ARM | ||
| #elif defined( __mips__ ) || defined( __mips64 ) || defined( __mips64_ ) || defined( _M_MIPS ) | ||
| # define OGRE_CPU OGRE_CPU_MIPS | ||
| #elif defined( __loongarch64 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bitness is not reflected here, so just __loongarch__ will do.
| #elif defined( __loongarch64 ) | |
| #elif defined( __loongarch__ ) |
| defined( _M_ARM64 ) || defined( __mips64 ) || defined( __mips64_ ) || defined( __alpha__ ) || \ | ||
| defined( __ia64__ ) || defined( __e2k__ ) || defined( __s390__ ) || defined( __s390x__ ) || \ | ||
| ( defined( __riscv ) && __riscv_xlen == 64 ) | ||
| ( defined( __riscv ) && __riscv_xlen == 64 ) || defined( __loongarch64 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the ABI instead of target hardware capability (which may not be utilized to full extent).
| ( defined( __riscv ) && __riscv_xlen == 64 ) || defined( __loongarch64 ) | |
| ( defined( __riscv ) && __riscv_xlen == 64 ) || defined( __loongarch_lp64 ) |
| #if defined( __LP64__ ) || defined( _WIN64 ) || ( defined( __x86_64__ ) && !defined( __ILP32__ ) ) || \ | ||
| defined( _M_X64 ) || defined( __ia64 ) || defined( _M_IA64 ) || defined( __aarch64__ ) || \ | ||
| defined( __powerpc64__ ) | ||
| defined( __powerpc64__ ) || defined( __loongarch64 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed, both GCC and Clang on LoongArch64 already expose the __LP64__ macro which is already handled here.
The LoongArch architecture (LoongArch) is an Instruction Set Architecture (ISA) that has a RISC style.
Documentations:
ISA:
https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html
ABI:
https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html
More docs can be found at:
https://loongson.github.io/LoongArch-Documentation/README-EN.html