Specifying unpriviledge spec version (-misa-spec gcc flag equivalent)

Hi all,

GCC implements the flag -misa-spec:

Specify the version of the RISC-V Unprivileged (formerly User-Level) ISA specification to produce code conforming to.
The default is -misa-spec=20191213

LLVM seems to be fixed conforming to isa spec 2.2. My question is should LLVM have an equivalent flag for both the clang driver and assembler? This would mostly control which default versions of standard extensions are used.

I did take some time to try and implement this flag, to some degree of success. There were a few challenges and it’s rough around the edges. I can put it up for a review soon if there’s interest.

Thanks,
Joe

Hi Joe,

I think the lack of -misa-spec is mainly due to lack of sufficient interest / priority as opposed to any active decision that we shouldn’t support it in Clang / LLVM.

I think the main thing to keep in mind in terms of adding that support is to be wary of any additional code complexity in terms of supporting multiple isa spec versions, and keep that in mind when considering which ISA spec versions to support (it could be the complexity is minimal / non-existing, but if not it may not be worth supporting very old spec versions that have no known users).