Skip to content

Conversation

@zhaixiaojuan
Copy link

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

Copy link

@xen0n xen0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# 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 )
Copy link

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.

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 )
Copy link

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).

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 )
Copy link

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants