Zig Version
0.15.2
Steps to Reproduce and Observed Behavior
For risc-v, in addition to formal register names, aliases are defined that can be used interchangeably in assembly code (for example, zero for x0 or a0–1 for function arguments is mapped to x10–11).
The current inline assembler syntax only accepts the original name, such as x10, but not the alias a0.
It's not a big deal to consult the manual and specify the full name, but it looks like a bug in the code.
For example:
asm volatile (
\\ mv a0, %[val]
:
: [val] "r" (val),
: .{ .x10 = true });
Expected Behavior
It seems more explicit and convenient if the compiler accepted aliace. Let me know if you're interested in the pull request.