[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:
@@ -11,6 +11,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define __CONCAT1(x, y) x ## y
|
||||
#define __CONCAT(x, y) __CONCAT1(x, y)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#if __GNUC__ || __clang__
|
||||
|
||||
Reference in New Issue
Block a user