fix(riscv): reject reserved JALR funct3 in the lifter - #220
Conversation
cpu.rs exceeded the AGENTS.md hard split triggers (2000 lines / 150 kB). Move the vector (RVV) element access and data-path execution group, including set_vtype, into cpu/vector.rs with no behavior change.
JALR's funct3 field is reserved and must be 0; the SMIR lifter now returns InvalidEncoding for other values instead of lifting the word as a JALR.
|
I reviewed the focused commit Two changes are needed before this is merge-ready:
The legal/reserved controls otherwise pass. This fix is non-RVV and should remain separate from #203. |
|
Thank you @carlosqwqqwq for identifying the reserved JALR |
fix(riscv): reject reserved JALR funct3 in the lifter
Closes #219
Summary
JALR's funct3 field is reserved and must be 0; the SMIR lifter lifted any funct3 value as a JALR. It now returns
InvalidEncodingfor the reserved values.Validation
cargo test --lib: 1 new test passes.Notes
Independent encoding-validation root cause, distinct from the no-C alignment handling.