GAS support immediate operand for those instructions without i suffix.
Thanks Kito, I've added a couple of comments. I think the main issue is the pattern for the shift amount immediate, which means invalid assembly is accepted.
|562–567 ↗||(On Diff #158200)|
These should use uimmlog2xlen for the shift amount. When fixing this, could you please also add tests that demonstrate the range checks are correct (adding to rv32i-aliases-invalid.s and rv64i-aliases-invalid.s)?
|179 ↗||(On Diff #158200)|
Yes, we should match gas here. Perhaps add a comment to this test like "The following aliases are accepted as input but the canonical form of the instruction will always be printed."
Thanks Kito. This patch breaks rv32i-invalid.s as the error message for add a1, a2, (a3) changes. Could you adjust that test too please?
It probably makes most sense to use 32 as the shamt in the relevant tests in rv32i-aliases-invalid.s and rv64i-aliases-invalid.s