fix(riscv): reject vwredsum/vwredsumu vs1 overlapping vs2 group - #281
Closed
carlosqwqqwq wants to merge 1 commit into
Closed
fix(riscv): reject vwredsum/vwredsumu vs1 overlapping vs2 group#281carlosqwqqwq wants to merge 1 commit into
carlosqwqqwq wants to merge 1 commit into
Conversation
Contributor
Author
|
Withdrawing this PR: the proposed overlap check is incorrect. Per RVV spec, the reduction scalar seed vs1 is read with EEW=SEW (same as the vs2 group elements), so a vs1 register inside the vs2 group does not violate the double-EEW rule (vector-common.adoc: a register cannot be read with two different EEWs in one instruction). The maintainer rollup #203 already encodes the correct semantics in vector_validation.rs (widening_reductions_allow_any_scalar_destination_register: scalar sources/destinations are not LMUL groups and may lie within vs2). QEMU 11.0.50's is_overlapped check is a conservative implementation detail, not a spec requirement. Apologies for the noise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #276
Summary
The widening integer reductions
vwredsumu.vsandvwredsum.vsread a 2*SEW scalar seed from the single registervs1(EMUL=1) and a SEW vector group fromvs2. The RISC-V V extension forbids reading the same vector register with more than one EEW in a single instruction, so avs1inside thevs2group is a reserved encoding. The affectedVwredsumu | Vwredsumbranch only checkedsew < 64and executed the reserved encoding, e.g.vwredsumu.vs v4, v0, v0with e32/m2. QEMU 11.0.50 raises SIGILL for these encodings viareduction_widen_check.The fix rejects any
vwredsumu.vs/vwredsum.vswhosevs1lies inside thevs2group[vs2, vs2 + EMUL).Validation
cargo test --lib: the targeted vwredsum overlap 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.