feat: ARM target profiles with FPU capability threading#38
Merged
Conversation
Add `fpu: Option<FPUPrecision>` to `TargetSpec` and thread it through
the entire compilation pipeline — CLI, instruction selector, encoder,
ELF builder, and Cortex-M startup code. This prepares the pipeline for
VFP floating-point instruction selection on M4F/M7 targets.
- New target constructors: cortex_m3(), cortex_m4f(), cortex_m7dp()
- New --target CLI flag (cortex-m3, cortex-m4, cortex-m4f, cortex-m7, cortex-m7dp)
- Target-aware float error messages ("no FPU" vs "VFP not yet implemented")
- ELF e_flags: EF_ARM_ABI_FLOAT_HARD set for hard-float targets
- FPU startup: CPACR CP10+CP11 enable with DSB/ISB barriers
- ArmEncoder gains fpu field (prep for VFP encoding)
Co-Authored-By: Claude Opus 4.6 <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
fpu: Option<FPUPrecision>toTargetSpecand thread it through the entire compilation pipeline (CLI → instruction selector → encoder → ELF builder → startup code)cortex_m3(),cortex_m4f(),cortex_m7dp()with correct triples and FPU settings--targetCLI flag (cortex-m3,cortex-m4,cortex-m4f,cortex-m7,cortex-m7dp) that implies--cortex-mfor Cortex-M targetse_flagsset toEF_ARM_ABI_FLOAT_HARDfor hard-float targetsArmEncodergainsfpufield (prep for VFP instruction encoding in Task 4)Prerequisite for #36 (anti-pinch test case requires VFP float support).
Test plan
cargo test --workspace)cargo clippy --workspace --all-targets -- -D warningscleancargo fmt --checkcleancortex_m3,cortex_m4f,cortex_m7dp,cortex_m7target parsing🤖 Generated with Claude Code