[riscv][clang] Use a CSR name instead of a numeric expression

Clang's assembler rejects expressions containing e.g. (1u << N) in the
assembler. Instead using numeric expressions for per-privilege level
CSRs, we can prepend `m` or `s`. This also lets the compiler assign the
CSR encoding instead of having to hardcode it in the source code.
This commit is contained in:
Alex Richardson
2021-12-09 11:14:22 +00:00
parent 6025bec3a1
commit 496e2f4b8c
4 changed files with 14 additions and 16 deletions

View File

@@ -1,6 +0,0 @@
#pragma once
#ifndef __CONCAT
#define __CONCAT1(x,y) x ## y
#define __CONCAT(x,y) __CONCAT1(x,y)
#endif