Skip to content

Commit

Permalink
[riscv] Init support for RISCV vector extension
Browse files Browse the repository at this point in the history
  • Loading branch information
ita-sc committed Aug 14, 2024
1 parent c1f74e3 commit 492c84d
Show file tree
Hide file tree
Showing 93 changed files with 4,072 additions and 119 deletions.
19 changes: 19 additions & 0 deletions cmake/toolchain/clang.rvv128.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
##==================================================================================================
## EVE - Expressive Vector Engine
## Copyright : EVE Project Contributors
## SPDX-License-Identifier: BSL-1.0
##==================================================================================================
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR riscv64)

set(CMAKE_C_COMPILER clang )
set(CMAKE_CXX_COMPILER clang++ )


if(NOT DEFINED ENV{RISCV_GCC})
message(FATAL_ERROR "expected to have RISCV_GCC in environment")
endif()

set(CMAKE_CXX_FLAGS "-O3 -march=rv64gcv -std=c++20 -mrvv-vector-bits=128 --sysroot=$ENV{RISCV_GCC}/sysroot --gcc-toolchain=$ENV{RISCV_GCC} --static --target=riscv64-unknown-linux-gnu ${EVE_OPTIONS}" )

set(CMAKE_CROSSCOMPILING_CMD ${PROJECT_SOURCE_DIR}/cmake/toolchain/run_rvv128.sh )
8 changes: 8 additions & 0 deletions cmake/toolchain/run_rvv128.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
##==================================================================================================
## EVE - Expressive Vector Engine
## Copyright : EVE Project Contributors
## SPDX-License-Identifier: BSL-1.0
##==================================================================================================
#!/bin/sh

qemu-riscv64 --cpu rv64,v=true,vlen=128 $@
1 change: 1 addition & 0 deletions include/eve/arch/abi_of.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ namespace eve
else return emulated_{};
}
}
else if constexpr( spy::simd_instruction_set == spy::rvv_ ) { return riscv_rvv_dyn_ {}; }
else
{
return emulated_{};
Expand Down
9 changes: 5 additions & 4 deletions include/eve/arch/as_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
#include <eve/arch/cpu/as_register.hpp>

#if !defined(EVE_NO_SIMD)
#include <eve/arch/x86/as_register.hpp>
#include <eve/arch/ppc/as_register.hpp>
#include <eve/arch/arm/sve/as_register.hpp>
#include <eve/arch/arm/neon/as_register.hpp>
# include <eve/arch/arm/neon/as_register.hpp>
# include <eve/arch/arm/sve/as_register.hpp>
# include <eve/arch/ppc/as_register.hpp>
# include <eve/arch/riscv/as_register.hpp>
# include <eve/arch/x86/as_register.hpp>
#endif

Loading

0 comments on commit 492c84d

Please sign in to comment.