Enable RVV support in CMake and Bazel for RISC-V targets

Enable RISC-V Vector (RVV) by default when building natively on RISC-V
platforms (such as SpacemiT K1/K3) using CMake and Bazel:
- CMakeLists.txt: Detect riscv64 and riscv32, probe compiler support
  for -march=rv64gcv / -march=rv32gcv, and append architecture flags
  with auto-vectorization disabled (-fno-vectorize -fno-slp-vectorize).
  Support custom architecture flags via -DRISCV_COMPILER_FLAGS and
  provide -DUSE_RVV=OFF to disable.
- BUILD.bazel: Add RVV_COPTS for @platforms//cpu:riscv64 and
  @platforms//cpu:riscv32 with -fno-vectorize.
- docs/getting_started.md: Document native SBC builds, custom targets
  (SiFive X280, Coral 32-bit Zve32x), Bazel, and Blaze commands.

Test: cmake build on host and simulated riscv64; clang cross-compile tests
Bug: none
Change-Id: Iecb20b73b2934b6477e7e0c71b3539a8251e4e8b
TAG=agy
CONV=2f28dd8a-c892-4c29-8aed-606afd090398
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8349493
Reviewed-by: richard winterton <rrwinterton@gmail.com>
Commit-Queue: Frank Barchard <fbarchard@google.com>
3 files changed
tree: c54ec79852b00e6f6ad1dc1e73a732a0b428184a
  1. build_overrides/
  2. docs/
  3. include/
  4. infra/
  5. riscv_script/
  6. source/
  7. tools_libyuv/
  8. unit_test/
  9. util/
  10. .clang-format
  11. .gitignore
  12. .gn
  13. .vpython3
  14. Android.bp
  15. Android.mk
  16. AUTHORS
  17. BUILD.bazel
  18. BUILD.gn
  19. CM_linux_packages.cmake
  20. CMakeLists.txt
  21. codereview.settings
  22. DEPS
  23. DIR_METADATA
  24. download_vs_toolchain.py
  25. GEMINI.md
  26. libyuv.bzl
  27. libyuv.gni
  28. libyuv.gyp
  29. libyuv.gypi
  30. LICENSE
  31. linux.mk
  32. OWNERS
  33. PATENTS
  34. PRESUBMIT.py
  35. public.mk
  36. pylintrc
  37. README.chromium
  38. README.md
  39. winarm.mk
  40. WORKSPACE.bazel
README.md

libyuv is an open source project that includes YUV scaling and conversion functionality.

  • Scale YUV to prepare content for compression, with point, bilinear or box filter.
  • Convert to YUV from webcam formats for compression.
  • Convert to RGB formats for rendering/effects.
  • Rotate by 90/180/270 degrees to adjust for mobile devices in portrait mode.
  • Optimized for SSSE3/AVX2 on x86/x64.
  • Optimized for Neon/SVE2/SME on Arm.
  • Optimized for MSA on Mips.
  • Optimized for RVV on RISC-V.

Development

See Getting started for instructions on how to get started developing.

You can also browse the docs directory for more documentation.