Skip to content

Enable RISC-V platform support #2

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

Open
wants to merge 1 commit into
base: cl30
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
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
set(CLConform_TARGET_ARCH x86_64)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*")
set(CLConform_TARGET_ARCH x86)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64")
set(CLConform_TARGET_ARCH RISCV64)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv")
set(CLConform_TARGET_ARCH RISCV)
endif()

if(NOT DEFINED CLConform_TARGET_ARCH)
Expand Down
6 changes: 6 additions & 0 deletions test_common/harness/fpcontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ inline void ForceFTZ(FPU_mode_type *mode)
__asm__ volatile("msr fpcr, %0" ::"r"(fpscr | (1U << 24)));
#elif defined(__mips__)
fpa_bissr(FPA_CSR_FS);
#elif defined(__riscv)
#warning RISC-V platform does NOT support FTZ...
#else
#error ForceFTZ needs an implentation
#endif
Expand Down Expand Up @@ -97,6 +99,8 @@ inline void DisableFTZ(FPU_mode_type *mode)
__asm__ volatile("msr fpcr, %0" ::"r"(fpscr & ~(1U << 24)));
#elif defined(__mips__)
fpa_bicsr(FPA_CSR_FS);
#elif defined(__riscv)
#warning RISC-V platform does NOT support FTZ...
#else
#error DisableFTZ needs an implentation
#endif
Expand All @@ -117,6 +121,8 @@ inline void RestoreFPState(FPU_mode_type *mode)
__asm__ volatile("msr fpcr, %0" ::"r"(*mode));
#elif defined(__mips__)
// Mips runs by default with DAZ=1 FTZ=1
#elif defined(__riscv)
#warning RISC-V platform does NOT support FTZ...
#else
#error RestoreFPState needs an implementation
#endif
Expand Down
5 changes: 5 additions & 0 deletions test_common/harness/rounding_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ void *FlushToZero(void)
#elif defined(__mips__)
fpa_bissr(FPA_CSR_FS);
return NULL;
#elif defined(__riscv)
#warning RISC-V does NOT support FTZ...
return NULL;
#else
#error Unknown arch
#endif
Expand Down Expand Up @@ -254,6 +257,8 @@ void UnFlushToZero(void *p)
_FPU_SETCW(flags);
#elif defined(__mips__)
fpa_bicsr(FPA_CSR_FS);
#elif defined(__riscv)
#warning RISC-V does NOT support FTZ...
#else
#error Unknown arch
#endif
Expand Down
2 changes: 2 additions & 0 deletions test_common/harness/testHarness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,8 @@ void PrintArch(void)
vlog("ARCH:\tWindows\n");
#elif defined(__mips__)
vlog("ARCH:\tmips\n");
#elif defined(__riscv)
vlog("ARCH:\riscv/riscv64\n");
#else
#error unknown arch
#endif
Expand Down