aboutsummaryrefslogtreecommitdiff
path: root/files/docs
diff options
context:
space:
mode:
Diffstat (limited to 'files/docs')
-rw-r--r--files/docs/environment_variables.md3
-rw-r--r--files/docs/getting_started.md29
2 files changed, 32 insertions, 0 deletions
diff --git a/files/docs/environment_variables.md b/files/docs/environment_variables.md
index dd5d59fb..4eb09659 100644
--- a/files/docs/environment_variables.md
+++ b/files/docs/environment_variables.md
@@ -40,6 +40,9 @@ By default the cpu is detected and the most advanced form of SIMD is used. But
LIBYUV_DISABLE_LSX
LIBYUV_DISABLE_LASX
+## RISCV CPUs
+ LIBYUV_DISABLE_RVV
+
# Test Width/Height/Repeat
The unittests default to a small image (128x72) to run fast. This can be set by environment variable to test a specific resolutions.
diff --git a/files/docs/getting_started.md b/files/docs/getting_started.md
index 15b19ab2..b19f0009 100644
--- a/files/docs/getting_started.md
+++ b/files/docs/getting_started.md
@@ -220,6 +220,35 @@ Install cmake: http://www.cmake.org/
make -j4
make package
+## Building RISC-V target with cmake
+
+### Prerequisite: build risc-v clang toolchain and qemu
+
+If you don't have prebuilt clang and riscv64 qemu, run the script to download source and build them.
+
+ ./riscv_script/prepare_toolchain_qemu.sh
+
+After running script, clang & qemu are built in `build-toolchain-qemu/riscv-clang/` & `build-toolchain-qemu/riscv-qemu/`.
+
+### Cross-compile for RISC-V target
+ cmake -B out/Release/ -DUNIT_TEST=ON \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_TOOLCHAIN_FILE="./riscv_script/riscv-clang.cmake" \
+ -DTOOLCHAIN_PATH={TOOLCHAIN_PATH} \
+ -DUSE_RVV=ON .
+ cmake --build out/Release/
+
+
+### Run on QEMU
+
+#### Run libyuv_unittest on QEMU
+ cd out/Release/
+ USE_RVV=ON \
+ TOOLCHAIN_PATH={TOOLCHAIN_PATH} \
+ QEMU_PREFIX_PATH={QEMU_PREFIX_PATH} \
+ ../../riscv_script/run_qemu.sh libyuv_unittest
+
+
## Setup for Arm Cross compile
See also https://www.ccoderun.ca/programming/2015-12-20_CrossCompiling/index.html