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

Add loongarch64 support #4891

Merged
merged 8 commits into from
Mar 11, 2024
Merged

Conversation

donmor
Copy link
Contributor

@donmor donmor commented Mar 11, 2024

Add loongarch64 identifiers in configure.ac and version_string.h, making loongarch64 a "supported" architecture.
Also enable MT32 support on loongarch64.

Add proper loongarch64 support
Recognize loongarch64 as 64-bit
loongarch64 is 64-bit
@@ -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__)
Copy link

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.

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

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.

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

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.

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

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

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.

@joncampbell123 joncampbell123 merged commit 3c95b14 into joncampbell123:master Mar 11, 2024
19 checks passed
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.

3 participants