fix(riscv): reject vmsbf/vmsif/vmsof with vd == vs2 - #197
Conversation
|
Review findings:
|
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 prefix ops write vd while reading vs2; aliasing the source register is reserved, and in the masked form the destination must not be the mask register v0.
4fdd2d5 to
094ab68
Compare
|
Thanks for the review. Updated as suggested:
Verified locally: |
|
Thanks @carlosqwqqwq. This fix is being consolidated into rollup PR #203, where it shares centralized direct-interpreter, SMIR/JIT, and QEMU differential coverage with the related RVV corrections. Closing this PR in favor of #203; the relevant rollup commits credit you as co-author. |
fix(riscv): reject vmsbf/vmsif/vmsof with vd == vs2
Closes #192
Summary
The RISC-V V extension reserves the mask-prefix operations when the destination aliases the
vs2source register (vd == vs2), and the masked form must not target the mask register itself (!vm && vd == 0). Both cases now raise an illegal-instruction trap.Validation
vd == vs2forvmsbf/vmsif/vmsof, maskedvd == v0for all three, and unmasked/masked legal controls.cargo test --lib: cpu suite 72 passed, 0 failed.Notes
The vector semantics moved to
cpu/vector.rsin #202 so this change does not grow the oversizedcpu.rs.