Open
Conversation
xen0n
reviewed
Nov 7, 2025
xen0n
left a comment
There was a problem hiding this comment.
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.
Bitness is not reflected here, so just __loongarch__ will do.
Suggested change
| #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.
Check the ABI instead of target hardware capability (which may not be utilized to full extent).
Suggested change
| ( 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.
This is not needed, both GCC and Clang on LoongArch64 already expose the __LP64__ macro which is already handled here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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