fix(riscv): require aligned register groups for vsaddu/vsadd/vssubu/vssub - #284
fix(riscv): require aligned register groups for vsaddu/vsadd/vssubu/vssub#284carlosqwqqwq wants to merge 3 commits into
Conversation
|
The Evidence:
Conclusion: this is the known flaky AVX-512 JIT test on GitHub-hosted linux-x64 runners (the native replay executes AVX-512 instructions that the runner CPU does not support consistently), not a defect in this patch. The patch is unchanged apart from empty retrigger commits. |
|
Thanks for the report, patch, and CI follow-up. I independently reproduced the RVV issue and reimplemented the accepted alignment checks in #296. I also reran the current Linux core CI selection after rebasing onto |
Closes #279
Summary
The saturating add/subtract instructions
vsaddu,vsadd,vssubuandvssubname vector register groups invd,vs2and (for the.vvform)vs1, and the RISC-V V extension requires each group to be specified by its lowest-numbered register (riscv-v-spec, Section 3.4.2). The affectedVsaddu | Vsadd | Vssubu | Vssubbranch executed the arithmetic without any register-group alignment check, so reserved encodings such asvsaddu.vv v2, v1, v2with e32/m2 (vs2=v1 misaligned) were executed. QEMU raises SIGILL for these encodings viaopivv_check/opivx_check.The fix rejects any
.vvform with a misaligned vd, vs1 or vs2, and any.vxform with a misaligned vd or vs2, computing EMUL from vtype.Validation
cargo test --lib: the targeted saturating add/subtract alignment tests pass, and the full library test suite passes with no regressions.No new upstream test files are added; this is a source-only change.