feat(synth): F64<->I64 conversions on Cortex-M7DP (closes v0.7.0 deferred items)#148
Merged
Merged
Conversation
…t VCVT Architectural finding for the v0.7.0 "Deferred to follow-up" items F64ConvertI64S/U and I64TruncF64S/U: these cannot be implemented as single-instruction VCVT encodings on Cortex-M7DP. The 64-bit integer to/from floating-point VCVT encodings are ARMv8-A FEAT_FP only — not present in any M-profile VFP variant including FPv5-D16 (used by M7DP, M33-DP, M55, M85). See ARMv7-M ARM DDI 0403E.e A7.5/A8.8 vs. ARMv8-A ARM DDI 0487 C7.2. The right closing PR involves either a ~30-instruction software sequence per op or a soft-float helper, plus WASM-trap integration for the i64-trunc family (NaN + out-of-range trap per WASM spec §4.3.2), plus matching Rocq proofs — out of scope for v0.8.0's i64-T1-promotion theme. Deferred to a later floating-point milestone. This PR ships: - docs/analysis/ARMV7M_F64_I64_VCVT_FINDING.md — full finding with ISA citation, scope analysis, and closing-PR shape. - CHANGELOG.md [Unreleased] entry pointing at the finding. No code changes. The selector continues to emit the existing typed Error::Synthesis for these ops — no behavior change vs. v0.7.0. Refs #147 (v0.8.0 umbrella, optional additive item 6). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is v0.8.0 PR 6 from issue #147 (umbrella, "optional additive PRs", item 6). The task was to close the four
F64ConvertI64S/U+I64TruncF64S/Udeferred items from the v0.7.0 CHANGELOG.Result: deferred with a written architectural finding. No code changes; documentation only. The selector continues to surface a typed
Error::Synthesisfor these ops — no behavior change vs. v0.7.0.Reality check — does Cortex-M7DP support these as single VCVTs?
No, and no M-profile core does. The 64-bit integer ↔ floating-point VCVT encodings (
VCVT.{F32,F64}.{S64,U64}andVCVT.{S64,U64}.{F32,F64}) were introduced in ARMv8-A FEAT_FP — they are A-profile only.Citations:
VCVT.{F32,F64}.{S32,U32}andVCVT.{S32,U32}.{F32,F64}), plusVCVT.F32.F64/VCVT.F64.F32. No 64-bit integer VCVTs.FEAT_FP. ARMv8-A is a separate architecture profile from ARMv7-M.This matches the existing situation in synth for
F32ConvertI64S/Uand theI64TruncF32S/Ufamily, which are already deferred for the same root cause (seecrates/synth-synthesis/src/instruction_selector.rslines 1956–1960).Emitting an A-profile-only encoding on a Cortex-M7DP would either decode to a different instruction (silent miscompile) or fault with
UNDEFINSTR. The task brief explicitly says "Don't bluff" — this PR honors that.Implementation choice
Deferred to v0.9.0 (or later floating-point milestone). Doing this properly requires:
I64TruncF64S/U(NaN + out-of-range trap per WASM spec §4.3.2)None of this is required for v0.8.0's stated theme (i64 T1 result-correspondence parity per issue #147), and the issue itself marks this PR "optional additive". Full scoping in
docs/analysis/ARMV7M_F64_I64_VCVT_FINDING.md.What this PR ships
docs/analysis/ARMV7M_F64_I64_VCVT_FINDING.md— full architectural finding with ISA citations, scope analysis, and the shape of the eventual closing PR.CHANGELOG.md[Unreleased]entry pointing at the finding. (v0.7.0 history is frozen and unchanged.)No code changes. No new
ArmOpvariants. No new encoder tests (would test bogus encodings).Test plan
cargo test --workspace --exclude synth-verify— 1275 passed, 0 failed, 3 ignored on the deferral branch.cargo clippy --workspace --exclude synth-verify --all-targets -- -D warnings— clean.cargo fmt --check— clean.bazel test //coq:verify_proofs) — unchanged, no code touched.Why this is the right answer
The task brief gave two acceptable outcomes:
Option (b) is a meaningful piece of correctness-critical work (trap semantics + softfloat + proofs) that does not fit inside an "optional additive" v0.8.0 PR. Option (a) is the principled answer — recorded as a finding so the next milestone can pick it up with full context.
🤖 Generated with Claude Code