Skip to content

LDNP/STNP#60

Merged
monoid merged 3 commits into
masterfrom
feat/ldnp/stnp
Jul 11, 2026
Merged

LDNP/STNP#60
monoid merged 3 commits into
masterfrom
feat/ldnp/stnp

Conversation

@monoid

@monoid monoid commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Added AArch64 non-temporal paired load/store instructions (ldnp and stnp).
    • Introduced public constructors and builders for register-pair operations with immediate address offsets (including 32-bit/64-bit and stack-pointer forms).
    • Added instruction encoding coverage for the supported offset-range and register combinations.
  • Tests
    • Added comprehensive opcode coverage and boundary tests for underflow/overflow offset handling.
  • Refactor
    • Improved instruction rule generation for paired immediate offsets and updated generated documentation formatting.

@monoid monoid self-assigned this Jul 11, 2026
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@monoid, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6e183baf-2f6d-43a5-97b6-03366c15133b

📥 Commits

Reviewing files that changed from the base of the PR and between d90d02a and a4fce73.

📒 Files selected for processing (31)
  • harm/src/instructions/arith/add.rs
  • harm/src/instructions/arith/adds.rs
  • harm/src/instructions/arith/macros.rs
  • harm/src/instructions/arith/sub.rs
  • harm/src/instructions/arith/subs.rs
  • harm/src/instructions/dpimm/pcreladdr.rs
  • harm/src/instructions/ldst/ldnp.rs
  • harm/src/instructions/ldst/ldp.rs
  • harm/src/instructions/ldst/ldpsw.rs
  • harm/src/instructions/ldst/ldr.rs
  • harm/src/instructions/ldst/ldrb.rs
  • harm/src/instructions/ldst/ldrh.rs
  • harm/src/instructions/ldst/ldrsb.rs
  • harm/src/instructions/ldst/ldrsh.rs
  • harm/src/instructions/ldst/ldrsw.rs
  • harm/src/instructions/ldst/ldur.rs
  • harm/src/instructions/ldst/ldurb.rs
  • harm/src/instructions/ldst/ldurh.rs
  • harm/src/instructions/ldst/ldursb.rs
  • harm/src/instructions/ldst/ldursh.rs
  • harm/src/instructions/ldst/ldursw.rs
  • harm/src/instructions/ldst/macros.rs
  • harm/src/instructions/ldst/stnp.rs
  • harm/src/instructions/ldst/stp.rs
  • harm/src/instructions/ldst/str.rs
  • harm/src/instructions/ldst/strb.rs
  • harm/src/instructions/ldst/strh.rs
  • harm/src/instructions/ldst/stur.rs
  • harm/src/instructions/ldst/sturb.rs
  • harm/src/instructions/ldst/sturh.rs
  • harm/src/instructions/mov.rs
📝 Walkthrough

Walkthrough

Adds LDNP and STNP AArch64 instruction types, constructors, encoding rules, public exports, and tests for register combinations and immediate offset boundaries. Shared pair-offset macro generation is generalized to support both instructions.

Changes

LDNP and STNP pair instructions

Layer / File(s) Summary
Generalize pair-offset encoding rules
harm/src/instructions/ldst/macros.rs
Adds a reusable macro for simple pair immediate-offset encoding, updates pair-offset rule generation, and changes generated documentation attributes.
Implement LDNP instruction
harm/src/instructions/ldst/ldnp.rs, harm/src/instructions/ldst.rs
Adds the Ldnp type, constructor API, 32-bit and 64-bit encoding rules, public exports, opcode coverage, and offset-boundary tests.
Implement STNP instruction
harm/src/instructions/ldst/stnp.rs, harm/src/instructions/ldst.rs
Adds the Stnp type, constructor API, 32-bit and 64-bit encoding rules, public exports, opcode coverage, and offset-boundary tests.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested labels: enhancement, harm

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly matches the main change by naming the two new instruction additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ldnp/stnp

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
harm/src/instructions/ldst/macros.rs (1)

493-547: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Doc comments hardcode "LDP" for a now-generic macro.

All four doc attributes in define_simple_pair_imm_offset_rules! say "LDP with 64-bit destination, base register with aligned immediate offset." This macro is now instantiated for Ldnp/Stnp (and presumably Stp) too, so the generated rustdoc for those types will incorrectly reference LDP.

✏️ Suggested fix using $mnem via paste doc concatenation
-        #[doc = r" `LDP` with 64-bit destination, base register with aligned immediate offset."]
+        #[doc = "`" $mnem "` with base register with aligned immediate offset."]
         impl<Rt1, Rt2, B> $trait_name<Rt1, Rt2, (B, $offset_type)>

(similarly for the other three doc attributes at lines 511, 529, 547, inside the same ::paste::paste! context if moved there, or otherwise using a generic non-mnemonic-specific wording.)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@harm/src/instructions/ldst/macros.rs` around lines 493 - 547, Update the four
doc attributes in define_simple_pair_imm_offset_rules! to avoid hardcoding
“LDP”; interpolate the macro’s $mnem value within the existing paste context, or
use wording that is correct for every generated instruction such as Ldnp and
Stnp.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@harm/src/instructions/ldst/ldnp.rs`:
- Around line 35-38: Correct the doc comments for the MakeLdnp trait in
harm/src/instructions/ldst/ldnp.rs lines 35-38 by changing “possible was” to
“possible ways” and “faillible” to “fallible”; apply the same wording fixes to
the corresponding MakeStnp documentation in harm/src/instructions/ldst/stnp.rs
lines 35-38.

---

Outside diff comments:
In `@harm/src/instructions/ldst/macros.rs`:
- Around line 493-547: Update the four doc attributes in
define_simple_pair_imm_offset_rules! to avoid hardcoding “LDP”; interpolate the
macro’s $mnem value within the existing paste context, or use wording that is
correct for every generated instruction such as Ldnp and Stnp.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b8b43483-3b15-400d-b022-26ed888c0af2

📥 Commits

Reviewing files that changed from the base of the PR and between 377525c and e83de1b.

📒 Files selected for processing (4)
  • harm/src/instructions/ldst.rs
  • harm/src/instructions/ldst/ldnp.rs
  • harm/src/instructions/ldst/macros.rs
  • harm/src/instructions/ldst/stnp.rs

Comment thread harm/src/instructions/ldst/ldnp.rs Outdated
monoid added 2 commits July 11, 2026 18:04
Use real mnemonics for docstring.
@monoid

monoid commented Jul 11, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@monoid
monoid merged commit cbca1ea into master Jul 11, 2026
2 checks passed
@monoid
monoid deleted the feat/ldnp/stnp branch July 11, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant