-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Many Arm microcontoller target feature flags are missing #130988
Copy link
Copy link
Open
Labels
A-ABIArea: Concerning the application binary interface (ABI)Area: Concerning the application binary interface (ABI)A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-ABIArea: Concerning the application binary interface (ABI)Area: Concerning the application binary interface (ABI)A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
@RalfJung asked me to open an issue listing all the useful Arm microcontroller feature flags that are currently entirely unsupported by Rust, not even unstably.
These are all listed at https://doc.rust-lang.org/nightly/rustc/platform-support/arm-none-eabi.html and the sub-pages, as modified by #130987.
Selecting a CPU with
-C target-cpu=xxxcauses LLVM to enable all the optional features of that type of CPU. However, sometimes CPUs are sold without certain features (e.g. you can get a Cortex-M4 either with or without an FPU). So, we use these-C target-feature=...flags to disable some of the things that LLVM over-enthusiastically enabled for us when we selected a target-cpu. If you don't select a target-cpu, you don't need these flags because by default, only the architecture's baseline features are enabled and you never want to turn those off.-fpregs- don't emit FPU instructions-fp64- don't emit double precision FPU instructions-mve- don't emit Float or Integer M-Profile Vector Extension instructions-mve.fp- don't emit Float M-Profile Vector Extension instructions-dsp- don't emit DSP instructions+mve- do emit Integer M-Profile Vector Extension instructions (used with-fpregsbecause MVE uses registers shared with the FPU and those registers are present if you have Integer MVE but no FPU)These are alongside the following target CPUs (
-C target-cpu=...):cortex-m0cortex-m0pluscortex-m3cortex-m4cortex-m7cortex-m33cortex-m35pcortex-m55cortex-m85If you don't want to use
-C target-cpu...then the following additional flags can enable certain features. However, these aren't currently mentioned in the documentation (except+mvebecause it's listed above).+mve- M-Profile Vector Extensions (integer)+mve.fp- M-Profile Vector Extensions (floating point)+dsp- DSP extensions+fp-armv8d16sp- single precision FPU for Armv8-M+fp-armv8d16- double precision FPU for Armv8-M+vfp4d16sp- single precision FPU for Armv7E-M+vfp4d16- double precision FPU for Armv7E-M