Skip to content

Commit

Permalink
reject xuantie gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Dec 3, 2024
1 parent 2b8e0f5 commit 87573b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,11 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(riscv)")
set(NCNN_TARGET_ARCH riscv)

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
check_cxx_source_compiles("#if __riscv_v == 7000\nint main() { return 0; }\n#endif\n" NCNN_COMPILER_IS_XUANTIE_GCC)
if(NCNN_COMPILER_IS_XUANTIE_GCC)
message(FATAL_ERROR "Since XuanTie GCC Toolchain is not yet ready for RVV1.0, the risc-v optimized code of ncnn has been migrated to the RVV1.0 standard. Please use the old version of ncnn, which can be found at https://github.com/Tencent/ncnn/releases/download/20240820/ncnn-20240820-full-source.zip")
endif()

set(CMAKE_REQUIRED_FLAGS "-march=rv64gcv")
check_cxx_source_compiles("#include <riscv_vector.h>\nint main() { vfloat32m8_t _s, _w; float _v; size_t vl; _s = __riscv_vfmacc_vf_f32m8(_s, _v, _w, vl); return 0; }" NCNN_COMPILER_SUPPORT_RISCV_V)

Expand Down
4 changes: 4 additions & 0 deletions docs/how-to-build/how-to-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,10 @@ Pick `build-XYZ/install` folder for further usage.

### Build for AllWinner D1

**Important Note**

Since XuanTie GCC Toolchain is not yet ready for RVV1.0, the RISC-V optimized code of ncnn has been migrated to the RVV1.0 standard. The compilation process here uses the old version of ncnn, which can be found at https://github.com/Tencent/ncnn/releases/download/20240820/ncnn-20240820-full-source.zip

Download c906 toolchain package from https://xuantie.t-head.cn/community/download?id=4224193099938729984

```shell
Expand Down

0 comments on commit 87573b4

Please sign in to comment.