Skip to content
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

Initial support for RISCV vector extension #1716

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
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