fix(riscv): reject widening vd/vs2 overlap beyond the high part - #206
Closed
carlosqwqqwq wants to merge 2 commits into
Closed
fix(riscv): reject widening vd/vs2 overlap beyond the high part#206carlosqwqqwq wants to merge 2 commits into
carlosqwqqwq wants to merge 2 commits into
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 widening integer ops (vwadd/vwsub/vwmul/vwmacc families) write a 2*LMUL destination; only an overlap in the highest-numbered part of the destination group is legal (RVV §5.2). The .vx/.wx forms and the vwmulu/vwmaccu families were not validated. Fractional LMUL keeps one-register source and destination groups.
Member
|
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. |
Contributor
Author
|
Thanks for consolidating these into #203 and for the co-author credit. The local evidence (QEMU 8.2.2 |
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.
fix(riscv): reject widening vd/vs2 overlap beyond the high part
Closes #205
Summary
The widening integer ops (
vwadd/vwsub/vwmul/vwmaccfamilies) write a 2*LMUL destination; RVV §5.2 only permits an overlap in the highest-numbered part of the destination group (source group ends where the destination ends). The existing check only covered the OPMVV forms ofvwadd/vwsub; the OPMVX forms and the whole widening multiply family bypassed it, so reserved encodings executed normally.Validation
Vwmulu/Vwmul/Vwmulsu/Vwmaccu/Vwmacc/Vwmaccsu/Vwmaccus; the.wforms use the wide source group width; fractional LMUL keeps one-register source and destination groups.cargo test --lib: cpu suite 70 passed, 0 failed.Notes
The vector semantics live in
cpu/vector.rsafter the refactor in #202, so this change does not grow the oversizedcpu.rs.