-
Notifications
You must be signed in to change notification settings - Fork 383
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
Add loongarch64 support #4891
Add loongarch64 support #4891
Conversation
Add proper loongarch64 support
Recognize loongarch64 as 64-bit
loongarch64 is 64-bit
include/version_string.h
Outdated
@@ -57,7 +57,7 @@ | |||
#define OS_PLATFORM_LONG "" | |||
#endif | |||
|
|||
#if defined(_M_X64) || defined (_M_AMD64) || defined (_M_ARM64) || defined (_M_IA64) || defined(__ia64__) || defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__) | |||
#if defined(_M_X64) || defined (_M_AMD64) || defined (_M_ARM64) || defined (_M_IA64) || defined(__ia64__) || defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(__aarch64__) || 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.
No need for this addition: LoongArch64 is covered by the __LP64__
test already.
src/libs/libchdr/lzma/CpuArch.h
Outdated
@@ -83,6 +83,14 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem | |||
#endif | |||
|
|||
|
|||
#if defined(__loongarch64) \ | |||
|| 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.
Please just test for __loongarch_lp64
. The __loongarch64
name is deprecated while __loongarch64__
has never been included in any platform spec.
src/libs/libchdr/lzma/CpuArch.h
Outdated
@@ -140,6 +148,7 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem | |||
|| defined(__MIPSEL__) \ | |||
|| defined(__MIPSEL) \ | |||
|| defined(_MIPSEL) \ | |||
|| defined(MY_CPU_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.
No need to test this either, the last check is generic enough to catch LoongArch.
src/misc/savestates.cpp
Outdated
@@ -277,7 +277,7 @@ std::string GetPlatform(bool save) { | |||
#endif | |||
); | |||
if (!save) strcat(platform, (std::string(SDL_STRING)+", ").c_str()); | |||
#if defined(_M_X64) || defined (_M_AMD64) || defined (_M_ARM64) || defined (_M_IA64) || defined(__ia64__) || defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__) | |||
#if defined(_M_X64) || defined (_M_AMD64) || defined (_M_ARM64) || defined (_M_IA64) || defined(__ia64__) || defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(__aarch64__) || 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.
Similarly here: the __LP64__
check suffices.
configure.ac
Outdated
@@ -630,6 +630,12 @@ case "$host_cpu" in | |||
c_targetcpu="m68k" | |||
c_unalignedmemory=yes | |||
;; | |||
loongarch64*) | |||
AC_DEFINE(C_TARGETCPU,LOONGARCH64) | |||
AC_MSG_RESULT(Loongson 3A5000+) |
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.
Maybe just "LoongArch"? Even if just considering Loongson products, this expression excludes the 2K product line, which may not be what you mean.
Add loongarch64 identifiers in
configure.ac
andversion_string.h
, making loongarch64 a "supported" architecture.Also enable MT32 support on loongarch64.