Skip to content

Commit

Permalink
Add support for RISC-V 64-bit architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
mitya57 committed Apr 14, 2020
1 parent 5da2323 commit e3674fa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -83,6 +83,8 @@ elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "s390")
set(WTF_CPU_S390 1)
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "s390x")
set(WTF_CPU_S390X 1)
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64")
set(WTF_CPU_RISCV64 1)
else ()
message(FATAL_ERROR "Unknown CPU '${LOWERCASE_CMAKE_SYSTEM_PROCESSOR}'")
endif ()
Expand Down
1 change: 1 addition & 0 deletions Source/JavaScriptCore/CMakeLists.txt
Expand Up @@ -1289,6 +1289,7 @@ elseif (WTF_CPU_MIPS)
elseif (WTF_CPU_SH4)
elseif (WTF_CPU_X86)
elseif (WTF_CPU_X86_64)
elseif (WTF_CPU_RISCV64)
if (MSVC AND ENABLE_JIT)
add_custom_command(
OUTPUT ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj
Expand Down
8 changes: 7 additions & 1 deletion Source/WTF/wtf/Platform.h
Expand Up @@ -176,6 +176,11 @@
#define WTF_CPU_X86_SSE2 1
#endif

/* CPU(RISCV64) - RISCV64 */
#if defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
#define WTF_CPU_RISCV64 1
#endif

/* CPU(ARM64) - Apple */
#if (defined(__arm64__) && defined(__APPLE__)) || defined(__aarch64__)
#define WTF_CPU_ARM64 1
Expand Down Expand Up @@ -707,7 +712,8 @@
|| CPU(S390X) \
|| CPU(MIPS64) \
|| CPU(PPC64) \
|| CPU(PPC64LE)
|| CPU(PPC64LE) \
|| CPU(RISCV64)
#define USE_JSVALUE64 1
#else
#define USE_JSVALUE32_64 1
Expand Down
2 changes: 1 addition & 1 deletion Source/WTF/wtf/dtoa/utils.h
Expand Up @@ -49,7 +49,7 @@
defined(__ARMEL__) || \
defined(_MIPS_ARCH_MIPS32R2)
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
#elif CPU(MIPS) || CPU(MIPS64) || CPU(PPC) || CPU(PPC64) || CPU(PPC64LE) || CPU(SH4) || CPU(S390) || CPU(S390X) || CPU(IA64) || CPU(ALPHA) || CPU(ARM64) || CPU(HPPA)
#elif CPU(MIPS) || CPU(MIPS64) || CPU(PPC) || CPU(PPC64) || CPU(PPC64LE) || CPU(SH4) || CPU(S390) || CPU(S390X) || CPU(IA64) || CPU(ALPHA) || CPU(ARM64) || CPU(HPPA) || CPU(RISCV64)
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
#elif defined(_M_IX86) || defined(__i386__)
#if defined(_WIN32)
Expand Down
1 change: 1 addition & 0 deletions Source/cmake/OptionsQt.cmake
Expand Up @@ -448,6 +448,7 @@ else ()
find_package(Sqlite REQUIRED)
endif ()

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

if (USE_LIBJPEG)
Expand Down

0 comments on commit e3674fa

Please sign in to comment.