Maybe you could try to keep use clang (lld) with option --gcc-toolchain=<gcc_path>, to get libc supports (e.g., newlib) from gcc build.
From: riscv21 <zahra...@gmail.com>
Sent: 2021年8月2日 14:04
To: RISC-V SW Dev <sw-...@groups.riscv.org>
Subject: [sw-dev] Problem using LLVM with RISC-V vector extension
External email: Use caution opening links or attachments |
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
sw-dev+un...@groups.riscv.org.
To view this discussion on the web visit
https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/bd2ce74b-c0a1-4cfa-afe9-356e856d5cdcn%40groups.riscv.org.
Spike should be able to execute RVV instructions, have u used options like “--isa=RV$(XLEN)IMAFDCV --varch=vlen:$(VLEN),elen:128,slen:$(VLEN)”, to enable V ext and set VLEN?
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/DM8PR12MB5416ADDCCA75ADC945F0457DADF19%40DM8PR12MB5416.namprd12.prod.outlook.com.
However, the problem is that when clang generates only the assembly file the vector encoding is known,but if it generates the binary file directly and I use the objdump to dump the object file, all the vector instructions are "unknown".So Spike also throws invalid instruction errors on vector instructions because they are unknown.
spike --isa=RV64IMAFDCV --varch=vlen:256,elen:32 pk -s test_prog
bbl loader
z 0000000000000000 ra 0000000000016ec0 sp 0000003ffffff7d0 gp 000000000008b0d0
tp 000000000008cac0 t0 0000000000000ff0 t1 000000000002d51a t2 0000000000000000
s0 0000003ffffff8c0 s1 000000000008d1c0 a0 3ffffffffffffffe a1 00000000000951c0
a2 00000000000991c0 a3 0000000000002000 a4 0000003ffffff8f8 a5 000000000009d1c0
a6 0000000000000008 a7 000000000009f1c0 s2 0000000000001000 s3 0000000000000000
s4 00000000000103c8 s5 00000000ffffffff s6 000000000000003a s7 000000000008b000
s8 0000000000000000 s9 0000000000000000 sA 0000000000000000 sB 000000000008d1c0
t3 000000000000007c t4 0000000000000000 t5 0000000000000000 t6 0000000000000000
pc 000000000005346e va/inst 000000005e003cd7 sr 8000000200006620
An illegal instruction was executed!
The single-letter V extension is intended for use in application processor profiles.
The V vector extension depends upon the Zvl128b extension.
The V extension supports EEW of 8, 16, and 32, and 64.
If you don't want code generated using 64 bit elements then you have to tell the compiler to use one of the embedded profiles e.g. Zve32x or Zve32f
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/d82ef379-6b80-4b04-9108-9fc993b20c02n%40groups.riscv.org.
Thank you Bruce!So if the single letter v extension supports eew of 32, I should be able to compile the code for 32-bit elements even without using zve32x (just with -march=rv64gcv0p10), right?Is there any option to pass the element width to the compiler?
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/1a990944-eca9-4d67-87de-f4f93cbf04fcn%40groups.riscv.org.