Skip to content

add loongarch64 support #1120

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/cpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
# define C4_CPU_PPC
# define C4_WORDSIZE 4
# endif

#elif defined(__loongarch64)
# define C4_CPU_LOONGARCH64
# define C4_WORDSIZE 8
# define C4_BYTE_ORDER _C4EL
#elif defined(SWIG)
#else
# error "unknown CPU architecture"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ __inline__ static void trap_instruction(void)
* 'aarch64_default_breakpoint' */
__asm__ volatile(".inst 0xd4200000");
}
#elif defined(__loongarch64)
enum { HAVE_TRAP_INSTRUCTION = 1, };
__attribute__((gnu_inline, always_inline))
__inline__ static void trap_instruction(void)
{
/* See 'loongarch-tdep.c' in GDB source,
* 'loongarch_default_breakpoint' */
__asm__ volatile(".word 0x002a0005" ::: "memory");
}
#else
enum { HAVE_TRAP_INSTRUCTION = 0, };
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
|| defined(__amd64) || defined(__aarch64__) || defined(_M_ARM64) \
|| defined(__MINGW64__) \
|| defined(__s390x__) \
|| defined(__loongarch64) \
|| (defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || defined(__PPC64LE__)))
#define FASTFLOAT_64BIT
#elif (defined(__i386) || defined(__i386__) || defined(_M_IX86) \
Expand Down Expand Up @@ -337,4 +338,4 @@ inline OStream& operator<<(OStream &out, const fast_float::decimal &d) {
return out;
}

#endif
#endif