Closed vmingchen closed 4 months ago
It turned out that the RVV 0.7.1 version is not supported by the mainline gcc.
Use the gcc version here fix the problem: https://github.com/brucehoult/riscv-gnu-toolchain
$ cat vtype.S
.globl main
.section .text
main:
li t0, 6
vsetvli a0, t0, e64 # set a0 to vl which is the 1st arg to `_exit`
li a7, 93 # set and invoke syscall '_exit'
ecall
$ /opt/rvv071/bin/riscv64-unknown-elf-gcc -g vtype.S -o vtype -march=rv64gcv && ./vtype
$ echo $?
2
I am playing with the vector support on my Lichee Pi 4A. But I could not get a simple assembly program with vector instruction working. The program is as follows:
I meant it to call the
_exit
syscall with thevl
value as return value. But the return value is always zero.According to the
riscv-v-spec-0.7.1
doc,So, it suggests this simple
vtype
setting ofe64
is not supported. How can we fix this and get RVV instructions working?I am using the vanilla OS coming with the board:
Thanks a lot!