rust-lang / rust-lang/rust

Support `vfp5` target feature

Open
#127,449 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-target-feature C-feature-request O-Arm T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

ARM Cortex-M7 has vfp5, according to documentation - 1 and 2.

LLVM already has it, see https://github.com/llvm/llvm-project/issues/95053 (FPUVersion::VFPV5).

Seems to rustc doesn't supports it, throwing message

'+vfp5' is not a recognized feature for this target (ignoring feature)

Could be great to support vfp5 in the rustc ❤️‍🔥


Oh I see that there is vfp4d16sp feature. Am I right? Maybe could be good to create alias for it as vfp5?
https://github.com/rust-lang/rust/blob/35e6e4c5e9d3936df098d30750f28716740ea71b/compiler/rustc_target/src/spec/targets/thumbv7em_none_eabihf.rs#L29-L36

Also I see features

  • vfp4d16 - VFP4 instructions with only 16 d-registers
  • vfp4d16sp - VFP4 instructions with only 16 d-registers and no double precision
  • vfp4sp - VFP4 instructions with no double precision

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with compiler/rustc_target/src/spec/targets/thumbv7em_none_eabihf.rs and compare its existing VFP feature names with LLVM's FPUVersion::VFPV5 referenced in the issue. Determine whether vfp5 should be supported directly or treated as an alias, then verify that the target feature is accepted instead of being ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.