ara icon indicating copy to clipboard operation
ara copied to clipboard

Questions about Compiling and CodeGen

Open tangcy98 opened this issue 3 years ago • 1 comments

As Ara supports the RISC-V Vector Extension, I want to know how Ara compiles a normal C program into an executable file with vector instructions? I see that the Makefile in apps/riscv-tests/benchmarks uses "riscv64-unknown-elf-gcc" to compile the C program. I wonder how does riscv64-unknown-elf-gcc compile the program with the prior knowledge of the ISA extension? How can I compile my self-written C code into an executable file with your implementation of RISC-V Vector Extension?

tangcy98 avatar Apr 29 '22 07:04 tangcy98

Hello @tangcy98,

You can use our software environment and write your own programs. The compiler (you pointed out riscv64-unknown-elf-gcc, but we use clang (llvm) for our programs). We tell the compiler that the code can have vector instructions via the option -march=rv64[other_extensions]v, and if your code actually contains them, they will be correctly compiled. Otherwise, only non-vectorial code will be produced.

Best, Matteo

mp-17 avatar May 03 '22 14:05 mp-17