Reputation: 434
I am looking for a C/C++ toolchain that supports the RISC-V vector extension v1.0 as defined per official spec.
Spike appears to support vector rvv1.0, but I am having trouble finding a toolchain to use it with.
Neither GCC (I only see a branch for rvv0.9) nor LLVM (I am using LLVM/clang 13.0.0, which only goes up to rvv0.10) appear to support the latest spec.
Can somebody point me to a working toolchain or do I just have to wait some more for the tools to catch up?
Upvotes: 6
Views: 5183
Reputation: 91
GCC support RVV1.0 feature now. You can use this:https://github.com/riscv-collab/riscv-gnu-toolchain. checkout riscv-gcc
to riscv-gcc-rvv-next
and riscv-binutils-gdb
to riscv-binutils-2.38
. Then you can have latest RVV1.0 features in GNU toolchain
To support auto-vectorization: use -mrvv
compile options.
Upvotes: 6
Reputation: 444
now, at 8 dec 2021 you can use llvm + clang 14.0.0 3eda87732fbac6f316e9e83984ef9a90f962c381 with enabled vector support rvv 0.1.
Compile RISCV GCC TOOLCHAIN
Compile LLVM + CLANG + LLD
Add GCC Toolchain to llvm install folder, here described how you can do it Using Clang to compile for RISC-V
And finally vectorize with next keys:
clang -O2 -c -march=rv64gv0p10 test.ll -o test1.o -menable-experimental-extensions -mllvm --riscv-v-vector-bits-min=256 -mno-relax
Here is an output - objdump file:
Objdump won't recognize instructions but you can see it if you emit assembler code with -S
key:
Upvotes: 3