Missing target features that should be supported by LLVM

Hi,
For the context, I'm currently working on embedded software targeting RISC V. And I'm reaching the point where I need a very specific vendor extension (THeadCmo), so I searched for it, and luckily it appears to be supported by LLVM (LLVM/RISCVUsage). I'm also using Rust 1.72.0 which is using LLVM 16, so I was expecting to get this feature in rustc... But it doesn't show up when I run rustc --print target-features --target riscv32imac-unknown-none-elf.

This command shows up two list, the first "Features supported by rustc for this target" are features explicitly supported by rustc (rustc source code).
The second list is "Code-generation features supported by LLVM for this target" shows all features supported by LLVM (rustc source code: compiler/rustc_codegen_llvm/src/llvm_util.rs#L335).

The problem is that the latter doesn't show every extension listed on the LLVM website, there are some (like "xtheadvdot", or "sifive7" for example), but not much more vendor specific ones.

Note: I only need this feature for writing inline assembly, no support needed from rustc I guess?

I must be missing something trivial here... Anyone know?

Force those reading this afterward, someone on discord linked me the following repository, which manually implements RISC-V instructions: GitHub - rustsbi/xuantie: Low level access to T-Head Xuantie RISC-V processors

I'm considering using their method or even use their crate.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.