riscv-non-isa / riscv-asm-manual

RISC-V Assembly Programmer's Manual
https://jira.riscv.org/browse/RVG-4
Creative Commons Attribution 4.0 International
1.41k stars 235 forks source link

Document (c)lui immediate #66

Closed nick-knight closed 3 years ago

nick-knight commented 3 years ago

My (mis)reading of the ISA manual leads me to expect c.lui to accept a nonzero integer immediate in the interval [-32, 31]. The GNU assembler rejects values in [-32, -1]. This PR aims to clear up this behavior I found counterintuitive.

EDIT: Writing in a hurry, I originally worded this more strongly than I meant. GAS's behavior is actually rather reasonable.