As of clang 9.0, the only way to access the RISC-V Control and Status Registers
is to use inline assembly, which is ugly and hinders optimisations.
This patch adds some Clang Builtins and LLVM Intrinsics to allow programmers
to access the CSRs without using inline assembly, which should therefore be
safer.
I hope to build a slightly nicer interface to this, to support the read-only or
write-only CSR operations (akin to the csrr, csrw, csrs and csrc
pseudo-instructions) via these builtins, which will eventually be available via
<rvintrin.h>.