Skip to content

ADCS/SBCS#59

Merged
monoid merged 1 commit into
masterfrom
feat/adcs/sbcs
Jul 10, 2026
Merged

ADCS/SBCS#59
monoid merged 1 commit into
masterfrom
feat/adcs/sbcs

Conversation

@monoid

@monoid monoid commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Added support for AArch64 add-with-carry (ADCS) instructions.
    • Added support for AArch64 subtract-with-carry (SBCS) instructions.
    • Supports both 32-bit and 64-bit registers, including zero-register operands.
    • Added instruction encoding coverage for the new arithmetic operations.

@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

📝 Walkthrough

Walkthrough

Added public ADCS and SBCS AArch64 instruction wrappers with generic constructors, register and zero-register operand forms, carry-aware encoding support, unit tests, and module exports.

Changes

Carry-aware arithmetic instructions

Layer / File(s) Summary
ADCS instruction wrapper
harm/src/instructions/arith.rs, harm/src/instructions/arith/adcs.rs
Exports ADCS, defines its generic constructor and sealed operand-construction API, supports 32-bit and 64-bit register or zero-register forms, and tests emitted encodings.
SBCS instruction wrapper
harm/src/instructions/arith/sbcs.rs
Defines the SBCS constructor and sealed operand-construction API, supports 32-bit and 64-bit register or zero-register forms, and tests emitted encodings.

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

🚥 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 names the two new instruction wrappers added in this PR and is directly related to the main change.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/adcs/sbcs

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.

@monoid

monoid commented Jul 10, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 10, 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.

@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.

🧹 Nitpick comments (1)
harm/src/instructions/arith/sbcs.rs (1)

17-61: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider reducing duplication between adcs.rs and sbcs.rs.

These two files are near-identical, differing only in instruction name and encoding module. If the existing adc/sbc instructions follow the same pattern, this duplication is an established convention — but a shared macro or generic factory could eliminate the repeated boilerplate (function, trait, struct, sealed impl, direct impls) across all carry-arithmetic instructions.

🤖 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/arith/sbcs.rs` around lines 17 - 61, Reduce duplicated
carry-arithmetic boilerplate shared by adcs.rs and sbcs.rs by introducing a
reusable macro or generic factory covering the public constructor, Make* trait,
instruction struct, Sealed implementation, and Reg32/Reg64 direct
implementations. Apply it consistently to Adcs/Sbcs and align with the existing
adc/sbc pattern, while preserving each instruction’s distinct name and encoding
module.
🤖 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.

Nitpick comments:
In `@harm/src/instructions/arith/sbcs.rs`:
- Around line 17-61: Reduce duplicated carry-arithmetic boilerplate shared by
adcs.rs and sbcs.rs by introducing a reusable macro or generic factory covering
the public constructor, Make* trait, instruction struct, Sealed implementation,
and Reg32/Reg64 direct implementations. Apply it consistently to Adcs/Sbcs and
align with the existing adc/sbc pattern, while preserving each instruction’s
distinct name and encoding module.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4c7c56ee-65b6-4a96-9fcf-e5a6291e662c

📥 Commits

Reviewing files that changed from the base of the PR and between 71684c7 and 2021d61.

📒 Files selected for processing (3)
  • harm/src/instructions/arith.rs
  • harm/src/instructions/arith/adcs.rs
  • harm/src/instructions/arith/sbcs.rs

@monoid
monoid merged commit 377525c into master Jul 10, 2026
1 check passed
@monoid
monoid deleted the feat/adcs/sbcs branch July 10, 2026 17:40
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