fix(riscv): keep memory access for loads to x0 - #224
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.
The SMIR lifter dropped the Load operation entirely when the destination was x0, which removed the architectural memory read: out-of-bounds accesses no longer fault and MMIO read side effects disappeared on the translated path. A temporary destination keeps the access while x0 stays unwritten.
|
I reviewed the focused commit Three changes are needed before this is merge-ready:
This is a non-RVV scalar SMIR memory fix and should remain independent from #203. |
|
Thank you @carlosqwqqwq for identifying that SMIR dropped observable loads to |
fix(riscv): keep memory access for loads to x0
Closes #223
Summary
The SMIR lifter dropped the
Loadoperation entirely when the destination register wasx0, which removed the architectural memory read: out-of-bounds accesses no longer fault and MMIO read side effects disappeared on the translated/JIT path. A temporary destination keeps the access whilex0stays unwritten.Validation
lw x0, 0(x1)and asserts aLoadoperation is present.cargo test --lib: 8214 passed, 0 failed.Notes
Translated-path fault/side-effect preservation, independent of the direct interpreter.