fix(riscv): reject vslide1up/vfslide1up with vd == vs2 - #199
fix(riscv): reject vslide1up/vfslide1up with vd == vs2#199carlosqwqqwq wants to merge 2 commits into
Conversation
|
Blocking review finding: the added regression test encodes the wrong instructions and currently fails.
The focused command ran one test and failed at the first assertion: Issue #194 contains the same incorrect probe. Its current word actually exposes a separate pre-existing Repository policy note: this PR adds to |
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.
vslide1up and vfslide1up write vd while reading vs2, so aliasing the source register is a reserved encoding; vslide1down and vfslide1down permit the overlap. Regression covers both trap forms and both legal down controls.
6e239bd to
fff76f2
Compare
|
Thanks for the review. Fixed 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 vslide1up/vfslide1up with vd == vs2
Closes #194
Summary
The RISC-V V extension reserves
vslide1up/vfslide1upwhen the destination aliases thevs2source register, whilevslide1down/vfslide1downpermit the overlap.vd == vs2now raises an illegal-instruction trap for the up forms.Validation
funct3=0b110for the.vxforms and0b101for the.vfforms), coveringvslide1up.vx,vfslide1up.vf, the legalvslide1down.vx/vfslide1down.vfcontrols, and a non-overlapping legal form.cargo test --lib: cpu suite 72 passed, 0 failed.Notes
vslideupgroup-overlap gap exposed during review is tracked separately in riscv: vslideup accepts partial vd/vs2 group overlap #204; this PR stays scoped tovslide1up/vfslide1up.cpu/vector.rsin refactor(riscv): split vector semantics out of cpu.rs #202 so this change does not grow the oversizedcpu.rs.