ADCS/SBCS#59
Conversation
📝 WalkthroughWalkthroughAdded 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. ChangesCarry-aware arithmetic instructions
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
harm/src/instructions/arith/sbcs.rs (1)
17-61: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider reducing duplication between
adcs.rsandsbcs.rs.These two files are near-identical, differing only in instruction name and encoding module. If the existing
adc/sbcinstructions 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
📒 Files selected for processing (3)
harm/src/instructions/arith.rsharm/src/instructions/arith/adcs.rsharm/src/instructions/arith/sbcs.rs
Summary by CodeRabbit
ADCS) instructions.SBCS) instructions.