Hello,
I’ve just merged locally my toolchain from LLVM15 to 16rc1 and noticed that there were recently enabled restrictive checks which verifies .riscv.attributes of ELF files.
Currently during building anything with clang I use sys-root built by gcc.
It occurred that I’ve got issues with linking.
When I run for example:
llvm-readobj -A /usr/lib/gcc-cross/riscv64-linux-gnu/12/crtendS.o
I see following attributes:
rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0
Attributes like icsr or ifencei aren’t accepted by LLVM binutils from branch release _16.x.
As a wrorkaround I’ve added locally:
{“zicsr”, RISCVExtensionVersion{2, 0}},
{“zifencei”, RISCVExtensionVersion{2, 0}},
This works, but I wanted to ask why RISCV LLVM backend doesn’t reports that extensions ziscr and zifencei are supported.
Are there still any gaps regarding full support of zicsr and zifencei extensions?
CSR instructions are for example defined:
def CSRRW : CSR_ir<0b001, “csrrw”>;
def CSRRS : CSR_ir<0b010, “csrrs”>;
def CSRRC : CSR_ir<0b011, “csrrc”>;
def CSRRWI : CSR_ii<0b101, “csrrwi”>;
def CSRRSI : CSR_ii<0b110, “csrrsi”>;
def CSRRCI : CSR_ii<0b111, “csrrci”>;
Similarly FENCE_I:
def FENCE_I : RVInstI<0b001, OPC_MISC_MEM, (outs), (ins), “fence.i”, “”>, Sched<[]> {
let rs1 = 0;
let rd = 0;
let imm12 = 0;
}
Or in LLVM we don’t want to separately indicate support for these extensions?
Moreover, other parts of attributes also aren’t accepted, for example rv64i2p1
LLVM reports that doesn’t support version 2.1 for rv64i2p1
So regarding Base Integer instruction set and other Standard extensions are there still any gaps between 2.0 and 2.1 in LLVM?
Thanks,
PrzemekO