Repository navigation
fix(encoder): high-register Thumb CMN uses 32-bit CMN.W (#184) - #187
Conversation
Sibling of #180: the 16-bit CMN (T1) reg-form (0x42C0) only encodes R0-R7; high registers overflow the 3-bit fields and corrupt the operands. CMN has no high-register 16-bit form, so guard rn/rm < 8 and fall back to 32-bit CMN.W (EB10 Rn | 0F00 Rm). Byte-verified against gas (`cmn r10, r8` = EB1A 0F08). Latent until now (the optimized div-guard uses the CMN *immediate* form; the reg-form is only emitted by the non-optimized selector with low registers), but closed as defense-in-depth — the last of the #180 16-bit-truncation class. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bump version + every path-dep pin 0.11.4 → 0.11.5 (Cargo.toml ×11 + MODULE.bazel + Cargo.lock). CHANGELOG [0.11.5] with falsification statement. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Automated review for PR #187pulseengine/synth: Verdict: 💬 Comment Summary: The patch addresses a critical bug in the Thumb CMN instruction encoding, ensuring that high-register operands are handled correctly. This resolves a latent issue and improves the overall reliability of the Synth compiler. Findings: 0 mechanical (rivet) · 1 from local AI model. Findings (1):
+Patch: high-register Thumb CMN (#184). Closes the last sibling of the #180 |
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
Closes #184 — the last sibling of the #180 16-bit-truncation class found by the encoder audit.
The 16-bit
CMN(T1) reg-form (0x42C0 | rm<<3 | rn) only encodes R0–R7; high-register operands (R8–R11/R12) overflow the 3-bit fields and corrupt the operands. CMN has no high-register 16-bit form, so high registers now fall back to 32-bitCMN.W(EB10 Rn | 0F00 Rm— ADD.W with S=1, Rd discarded as PC).Verification
cmn r10, r8→EB1A 0F08; low-regcmn r1,r2stays 16-bit0x42D1)gas:arm-none-eabi-asassemblescmn r10, r8to exactlyeb1a 0f08Reachability
Latent — the optimized divide-by-zero/INT_MIN guard uses the CMN immediate form (already 32-bit CMN.W), and the reg-form is only emitted by the non-optimized selector with low registers. Closed as defense-in-depth: the last 16-bit reg-form encoder lacking a high-register guard (Add/Adds/Subs fixed in #180; MVNS sites use hardcoded R0).
Closes #184.
🤖 Generated with Claude Code