feat(rsp): the reserved VZERO opcode family (19 undocumented encodings) - #42
Merged
Conversation
Implements the nineteen undocumented COP2 encodings n64-systemtest pins to its
single `run_vzero` reference: VSUT (0x12), VADDB/VSUBB/VACCB/VSUCB/VSAD/VSAC/
VSUM (0x16..=0x1C), V30/V31 (0x1E/0x1F), V46/V47 (0x2E/0x2F), and
VEXT{T,Q,N}/V59/VINS{T,Q,N} (0x38..=0x3E). Each writes ACC_LO = vs + vt per
lane, zeroes vd, and touches no flag word.
They are not distinct instructions to reverse-engineer one at a time -- the
suite's own Weird/RarelyUsed grouping and shared reference are the tell -- so a
single `vzero` helper covers all of them.
The four whole-instruction forms (VRND, clip, VZERO, VMACQ) are consolidated
into one `vu_whole_instruction` dispatch, which also keeps vu_compute under the
100-line clippy limit.
Suite-wide n64-systemtest failures drop 116 -> 97; the RSP arithmetic category
loses all nineteen of these. Non-circular regression: the expected ACC_LO is
computed from the seeds, and a 0xDEAD sentinel in vd makes a decoded no-op
visible (the decoded-but-no-op hazard).
Gates: fmt, clippy, workspace test, rustdoc, no_std, markdownlint green;
n64-systemtest Phase 1 categories still 0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughReserved VZERO-family opcodes now use whole-vector dispatch. Their implementation sums ChangesVZERO opcode handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 7 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (7 passed)
Comment |
This was referenced Jul 31, 2026
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.
Motivation
Continues Phase 2 (
to-dos/VERSION-PLAN.md§v0.3.0, RSP categoryFailed: 0).This clears the largest remaining block of RSP failures — the reserved /
undocumented COP2 vector opcodes.
What these are
n64-systemtest tests nineteen undocumented encodings, but pins all of them to
a single
run_vzeroreference: each writesACC_LO = vs + vtper lane,zeroes
vd, and touches no flag word. They are not distinct instructions toreverse-engineer one at a time — the suite's own
Level::Weird/RarelyUsedgrouping and shared reference are the tell.
VSUT(0x12)VADDB/VSUBB/VACCB/VSUCB/VSAD/VSAC/VSUM(0x16..=0x1C)V30/V31(0x1E/0x1F)V46/V47(0x2E/0x2F)VEXT{T,Q,N}/V59/VINS{T,Q,N}(0x38..=0x3E)Changes
vzerohelper implements the whole family.into one
vu_whole_instructiondispatch — this also keepsvu_computeunderthe 100-line clippy limit, which the fourth early-return had just breached.
ACC_LOis computed from the seeds (not thecode), and a
0xDEADsentinel invdmakes a decoded no-op visible — thedecoded-but-no-op hazard that silent-passes every "does not raise" check.
docs/rsp.mddocuments the family and the single-reference insight.Result
Suite-wide n64-systemtest failures drop 116 -> 97; the RSP arithmetic
category loses all nineteen of these encodings. Phase 1 categories remain at 0.
Gates run locally
cargo fmt --all --check,cargo clippy --workspace --all-targets -D warnings,cargo test --workspace,RUSTDOCFLAGS=-D warnings cargo doc --workspace --no-deps, thethumbv7em-none-eabihfno_std build, andpre-commit run markdownlint --all-files— all green. The#[ignore]d n64-systemtest runnerconfirms Phase 1 categories at 0 and the 116->97 drop.
🤖 Generated with Claude Code