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 LoongArch basic support #183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions build/cmake/TargetArch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ set(archdetect_c_code "
#error cmake_ARCH i386
#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
#error cmake_ARCH x86_64
#elif defined(__loongarch__)
#error cmake_ARCH LoongArch
#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
#error cmake_ARCH ia64
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \\
Expand Down
5 changes: 5 additions & 0 deletions cds/compiler/gcc/compiler_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@
# else
# define CDS_BUILD_BITS 32
# endif
#elif defined(__loongarch__)
# define CDS_PROCESSOR_ARCH CDS_PROCESSOR_LOONGARCH
# define CDS_PROCESSOR__NAME "LOONGARCH"
# define CDS_PROCESSOR__NICK "loongarch"
# define CDS_BUILD_BITS 64
#else
# if defined(CDS_USE_LIBCDS_ATOMIC)
# error "Libcds does not support atomic implementation for the processor architecture. Try to use C++11-compatible compiler and remove CDS_USE_LIBCDS_ATOMIC flag from compiler command line"
Expand Down
2 changes: 2 additions & 0 deletions cds/details/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ namespace cds {}
- CDS_PROCESSOR_PPC64 PowerPC64
- CDS_PROCESSOR_ARM7 ARM v7
- CDS_PROCESSOR_ARM8 ARM v8
- CDS_PROCESSOR_LOONGARCH LoongArch
- CDS_PROCESSOR_UNKNOWN undefined processor architecture

CDS_PROCESSOR__NAME The name (string) of processor architecture
Expand Down Expand Up @@ -278,6 +279,7 @@ namespace cds {}
#define CDS_PROCESSOR_PPC64 5 // PowerPC 64bit
#define CDS_PROCESSOR_ARM7 7
#define CDS_PROCESSOR_ARM8 8
#define CDS_PROCESSOR_LOONGARCH 9
#define CDS_PROCESSOR_UNKNOWN -1

// Supported OS interfaces
Expand Down