"include/vscode:/vscode.git/clone" did not exist on "19e73bbe014670a04d864b99c36c34302c902d7a"
Unverified Commit af229eb4 authored by ZangRuochen's avatar ZangRuochen Committed by GitHub
Browse files

Add LoongArch architecture LSX support. (#4467)



LoongArch is a new architecture, already supported by linux-6.1, gcc-12.
Signed-off-by: default avatarZang Ruochen <zangruochen@loongson.cn>
Co-authored-by: default avatarZang Ruochen <zangruochen@loongson.cn>
parent faee23a2
......@@ -48,6 +48,11 @@ if ("${TARGET_ARCH}" MATCHES "ppc")
set(PPC ON)
add_definitions(-D__PPC__=1)
endif()
if ("${TARGET_ARCH}" MATCHES "loongarch64")
set(LOONGARCH64 ON)
add_definitions(-D__LOONGARCH64__=1 -mlsx)
endif()
# Where to install
IF(WIN32)
......
......@@ -87,6 +87,8 @@ set(archdetect_c_code "
#else
#error cmake_ARCH ppc
#endif
#elif defined(__loongarch64)
#error cmake_ARCH loongarch64
#endif
#error cmake_ARCH unknown
......
......@@ -94,7 +94,7 @@ static int getNumProcessors() {
#define cpuid __cpuid
#else
#if !defined(__ANDROID__) && !defined(__PNACL__) && !defined(__PPC__) \
&& !defined(__ARM__) && !defined(__ARM64__)
&& !defined(__ARM__) && !defined(__ARM64__) && !defined(__LOONGARCH64__)
static void cpuid(int cpuInfo[4], int infoType) {
#ifdef __LP64__
__asm__ __volatile__ (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment