diff --git a/libc/cmake/modules/LLVMLibCArchitectures.cmake b/libc/cmake/modules/LLVMLibCArchitectures.cmake --- a/libc/cmake/modules/LLVMLibCArchitectures.cmake +++ b/libc/cmake/modules/LLVMLibCArchitectures.cmake @@ -57,6 +57,8 @@ set(target_arch "power") elseif(target_arch MATCHES "^riscv64") set(target_arch "riscv64") + elseif(target_arch MATCHES "^riscv32") + set(target_arch "riscv32") else() return() endif() @@ -150,6 +152,10 @@ set(LIBC_TARGET_ARCHITECTURE_IS_X86 TRUE) elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "riscv64") set(LIBC_TARGET_ARCHITECTURE_IS_RISCV64 TRUE) + set(LIBC_TARGET_ARCHITECTURE "riscv") +elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "riscv32") + set(LIBC_TARGET_ARCHITECTURE_IS_RISCV32 TRUE) + set(LIBC_TARGET_ARCHITECTURE "riscv") else() message(FATAL_ERROR "Unsupported libc target architecture ${LIBC_TARGET_ARCHITECTURE}") diff --git a/libc/config/linux/riscv64/entrypoints.txt b/libc/config/linux/riscv/entrypoints.txt rename from libc/config/linux/riscv64/entrypoints.txt rename to libc/config/linux/riscv/entrypoints.txt diff --git a/libc/config/linux/riscv64/headers.txt b/libc/config/linux/riscv/headers.txt rename from libc/config/linux/riscv64/headers.txt rename to libc/config/linux/riscv/headers.txt diff --git a/libc/src/__support/FPUtil/FEnvImpl.h b/libc/src/__support/FPUtil/FEnvImpl.h --- a/libc/src/__support/FPUtil/FEnvImpl.h +++ b/libc/src/__support/FPUtil/FEnvImpl.h @@ -31,7 +31,7 @@ #elif defined(LIBC_TARGET_ARCH_IS_ARM) #include "arm/FEnvImpl.h" #elif defined(LIBC_TARGET_ARCH_IS_RISCV64) -#include "riscv64/FEnvImpl.h" +#include "riscv/FEnvImpl.h" #else namespace __llvm_libc::fputil { @@ -42,6 +42,8 @@ LIBC_INLINE int test_except(int) { return 0; } +LIBC_INLINE int get_except() { return 0; } + LIBC_INLINE int set_except(int) { return 0; } LIBC_INLINE int raise_except(int) { return 0; } diff --git a/libc/src/__support/FPUtil/FMA.h b/libc/src/__support/FPUtil/FMA.h --- a/libc/src/__support/FPUtil/FMA.h +++ b/libc/src/__support/FPUtil/FMA.h @@ -19,7 +19,7 @@ #elif defined(LIBC_TARGET_ARCH_IS_AARCH64) #include "aarch64/FMA.h" #elif defined(LIBC_TARGET_ARCH_IS_RISCV64) -#include "riscv64/FMA.h" +#include "riscv/FMA.h" #endif #else diff --git a/libc/src/__support/FPUtil/riscv64/FEnvImpl.h b/libc/src/__support/FPUtil/riscv/FEnvImpl.h rename from libc/src/__support/FPUtil/riscv64/FEnvImpl.h rename to libc/src/__support/FPUtil/riscv/FEnvImpl.h diff --git a/libc/src/__support/FPUtil/riscv64/FMA.h b/libc/src/__support/FPUtil/riscv/FMA.h rename from libc/src/__support/FPUtil/riscv64/FMA.h rename to libc/src/__support/FPUtil/riscv/FMA.h diff --git a/libc/src/__support/FPUtil/riscv64/sqrt.h b/libc/src/__support/FPUtil/riscv/sqrt.h rename from libc/src/__support/FPUtil/riscv64/sqrt.h rename to libc/src/__support/FPUtil/riscv/sqrt.h diff --git a/libc/src/__support/FPUtil/sqrt.h b/libc/src/__support/FPUtil/sqrt.h --- a/libc/src/__support/FPUtil/sqrt.h +++ b/libc/src/__support/FPUtil/sqrt.h @@ -16,7 +16,7 @@ #elif defined(LIBC_TARGET_ARCH_IS_AARCH64) #include "aarch64/sqrt.h" #elif defined(LIBC_TARGET_ARCH_IS_RISCV64) -#include "riscv64/sqrt.h" +#include "riscv/sqrt.h" #else #include "generic/sqrt.h" diff --git a/libc/src/__support/OSUtil/linux/riscv64/CMakeLists.txt b/libc/src/__support/OSUtil/linux/riscv/CMakeLists.txt rename from libc/src/__support/OSUtil/linux/riscv64/CMakeLists.txt rename to libc/src/__support/OSUtil/linux/riscv/CMakeLists.txt diff --git a/libc/src/__support/OSUtil/linux/riscv64/syscall.h b/libc/src/__support/OSUtil/linux/riscv/syscall.h rename from libc/src/__support/OSUtil/linux/riscv64/syscall.h rename to libc/src/__support/OSUtil/linux/riscv/syscall.h diff --git a/libc/src/__support/OSUtil/linux/syscall.h b/libc/src/__support/OSUtil/linux/syscall.h --- a/libc/src/__support/OSUtil/linux/syscall.h +++ b/libc/src/__support/OSUtil/linux/syscall.h @@ -19,7 +19,7 @@ #elif defined(LIBC_TARGET_ARCH_IS_ARM) #include "arm/syscall.h" #elif defined(LIBC_TARGET_ARCH_IS_RISCV64) -#include "riscv64/syscall.h" +#include "riscv/syscall.h" #endif namespace __llvm_libc { diff --git a/libc/src/setjmp/riscv64/CMakeLists.txt b/libc/src/setjmp/riscv/CMakeLists.txt rename from libc/src/setjmp/riscv64/CMakeLists.txt rename to libc/src/setjmp/riscv/CMakeLists.txt diff --git a/libc/src/setjmp/riscv64/longjmp.cpp b/libc/src/setjmp/riscv/longjmp.cpp rename from libc/src/setjmp/riscv64/longjmp.cpp rename to libc/src/setjmp/riscv/longjmp.cpp diff --git a/libc/src/setjmp/riscv64/setjmp.cpp b/libc/src/setjmp/riscv/setjmp.cpp rename from libc/src/setjmp/riscv64/setjmp.cpp rename to libc/src/setjmp/riscv/setjmp.cpp diff --git a/libc/startup/linux/riscv64/CMakeLists.txt b/libc/startup/linux/riscv/CMakeLists.txt rename from libc/startup/linux/riscv64/CMakeLists.txt rename to libc/startup/linux/riscv/CMakeLists.txt diff --git a/libc/startup/linux/riscv64/start.cpp b/libc/startup/linux/riscv/start.cpp rename from libc/startup/linux/riscv64/start.cpp rename to libc/startup/linux/riscv/start.cpp