Skip to content

harm: ADDS/SUBS#57

Merged
monoid merged 3 commits into
masterfrom
feat/addc/subc
Jul 10, 2026
Merged

harm: ADDS/SUBS#57
monoid merged 3 commits into
masterfrom
feat/addc/subc

Conversation

@monoid

@monoid monoid commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added builders for AArch64 ADDS and SUBS instructions, including shifted, extended-register, and immediate forms.
    • Added support for additional register and operand combinations across arithmetic instructions.
    • Added public access to the new arithmetic instruction modules.
  • Bug Fixes

    • Corrected operand and destination handling for existing ADD and SUB instruction variants.
    • Improved validation for unsupported immediate values.

monoid added 2 commits July 10, 2026 07:49
Change arg order, remove unused args.
@monoid monoid self-assigned this Jul 10, 2026
@monoid monoid added enhancement New feature or request harm The `harm` dynamic assembler labels Jul 10, 2026
@coderabbitai

coderabbitai Bot commented Jul 10, 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: 50 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: a3b3afa7-1cf3-4a35-b6c9-3ab52dc52552

📥 Commits

Reviewing files that changed from the base of the PR and between eccc997 and c05c8b7.

📒 Files selected for processing (1)
  • harm/src/instructions/arith/subs.rs
📝 Walkthrough

Walkthrough

The arithmetic instruction modules now expose ADDS and SUBS builders with encoding support and tests. Shared macros and existing ADD/SUB declarations are updated to distinguish destination and source register types across shifted, extended, and immediate forms.

Changes

Arithmetic instruction builders

Layer / File(s) Summary
Shared arithmetic macro typing
harm/src/instructions/arith/macros.rs, harm/src/instructions/arith/add.rs, harm/src/instructions/arith/sub.rs
Arithmetic macros and ADD/SUB declarations now use distinct destination, source, zero-register, and stack-pointer-compatible operand types.
ADDS builder and coverage
harm/src/instructions/arith/adds.rs, harm/src/instructions/arith.rs
Adds the public adds constructor, MakeAdds trait, Adds struct, supported shifted/extended/immediate forms, module export, and encoding tests.
SUBS builder and coverage
harm/src/instructions/arith/subs.rs
Adds the public subs constructor, MakeSubs trait, Subs struct, supported shifted/extended/immediate forms, and encoding tests.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant adds_or_subs
  participant MakeTrait
  participant RawInstruction
  Caller->>adds_or_subs: provide destination and source operands
  adds_or_subs->>MakeTrait: call new(...)
  MakeTrait->>RawInstruction: construct encoded ADDS or SUBS variant
  RawInstruction-->>Caller: return instruction value
Loading

Possibly related PRs

  • monoid/harm#33: Both changes modify arithmetic instruction-generation macros and operand encoding paths.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
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.
Title check ✅ Passed The title matches the main change: adding and updating ADDS/SUBS arithmetic instruction support.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/addc/subc

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

🤖 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/arith/subs.rs`:
- Line 142: Rename the copied test identifier `untested_adds_db` to
`untested_subs_db` in the `SUBS_DB` declaration so it accurately references
subtraction tests.
🪄 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: b6f10f9c-6da8-4293-8d61-8e4d161e4ae1

📥 Commits

Reviewing files that changed from the base of the PR and between 6a1053e and eccc997.

📒 Files selected for processing (6)
  • harm/src/instructions/arith.rs
  • 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

Comment thread harm/src/instructions/arith/subs.rs Outdated
@monoid monoid changed the title harm: ADDC/SUBC harm: ADDS/SUBS Jul 10, 2026
@monoid
monoid merged commit 1ed555e into master Jul 10, 2026
2 checks passed
@monoid
monoid deleted the feat/addc/subc branch July 10, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request harm The `harm` dynamic assembler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant