Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise arm platform notes regarding soft float #130987

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/doc/rustc/src/platform-support/arm-none-eabi.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,15 @@ their own document.
There are two 32-bit instruction set architectures (ISAs) defined by Arm:

- The [*A32 ISA*][a32-isa], with fixed-width 32-bit instructions. Previously
known as the *Arm* ISA, this originated with the original Arm1 of 1985 and has
known as the *Arm* ISA, this originated with the original ARM1 of 1985 and has
been updated by various revisions to the architecture specifications ever
since.
- The [*T32 ISA*][t32-isa], with a mix of 16-bit and 32-bit width instructions.
Note that this term includes both the original 16-bit width *Thumb* ISA
introduced with the Armv4T architecture in 1994, and the later 16/32-bit sized
*Thumb-2* ISA introduced with the Armv6T2 architecture in 2003.

Again, these ISAs have been revised by subsequent revisions to the relevant Arm
architecture specifications.
*Thumb-2* ISA introduced with the Armv6T2 architecture in 2003. Again, these
ISAs have been revised by subsequent revisions to the relevant Arm
architecture specifications.

There is also a 64-bit ISA with fixed-width 32-bit instructions called the *A64
ISA*, but targets which implement that instruction set generally start with
Expand Down Expand Up @@ -106,10 +105,14 @@ features you do not have available, leaving you with the optimized instruction
scheduling and support for the features you do have. More details are available
in the detailed target-specific documentation.

**Note:** Many target-features are currently unstable and subject to change, and
<div class="warning">

Many target-features are currently unstable and subject to change, and
if you use them you should disassemble the compiler output and manually inspect
it to ensure only appropriate instructions for your CPU have been generated.

</div>

If you wish to use the *target-cpu* and *target-feature* options, you can add
them to your `.cargo/config.toml` file alongside any other flags your project
uses (likely linker related ones):
Expand Down
15 changes: 11 additions & 4 deletions src/doc/rustc/src/platform-support/thumbv7em-none-eabi.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ to use these flags.
| CPU | FPU | DSP | Target CPU | Target Features |
| ---------- | --- | --- | ----------- | --------------- |
| Any | No | Yes | None | None |
| Cortex-M4 | No | Yes | `cortex-m4` | `+soft-float` |
| Cortex-M4 | No | Yes | `cortex-m4` | `-fpregs` |
| Cortex-M4F | SP | Yes | `cortex-m4` | None |
| Cortex-M7 | No | Yes | `cortex-m7` | `+soft-float` |
| Cortex-M7 | No | Yes | `cortex-m7` | `-fpregs` |
| Cortex-M7F | SP | Yes | `cortex-m7` | `-fp64` |
| Cortex-M7F | DP | Yes | `cortex-m7` | None |

Expand All @@ -50,6 +50,13 @@ to use these flags.
| Cortex-M7F | SP | Yes | `cortex-m7` | `-fp64` |
| Cortex-M7F | DP | Yes | `cortex-m7` | None |

<div class="warning">

Never use the `-fpregs` *target-feature* with these `eabihf` targets
thejpster marked this conversation as resolved.
Show resolved Hide resolved
as it will cause compilation units to have different ABIs, which is unsound.

</div>

### Arm Cortex-M4 and Arm Cortex-M4F

The target CPU is `cortex-m4`.
Expand All @@ -59,7 +66,7 @@ The target CPU is `cortex-m4`.
* enabled by default with this *target*
* Cortex-M4F has a single precision FPU
* support is enabled by default with this *target-cpu*
* disable support using the `+soft-float` feature (`eabi` only)
* disable support using the `-fpregs` *target-feature* (`eabi` only)

### Arm Cortex-M7 and Arm Cortex-M7F

Expand All @@ -71,4 +78,4 @@ The target CPU is `cortex-m7`.
* Cortex-M7F have either a single-precision or double-precision FPU
* double-precision support is enabled by default with this *target-cpu*
* opt-out by using the `-f64` *target-feature*
* disable support entirely using the `+soft-float` feature (`eabi` only)
* disable support entirely using the `-fpregs` *target-feature* (`eabi` only)
31 changes: 19 additions & 12 deletions src/doc/rustc/src/platform-support/thumbv8m.main-none-eabi.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@ to use these flags.
| CPU | FPU | DSP | MVE | Target CPU | Target Features |
| ----------- | --- | --- | --------- | ------------- | --------------------- |
| Unspecified | No | No | No | None | None |
| Cortex-M33 | No | No | No | `cortex-m33` | `+soft-float,-dsp` |
| Cortex-M33 | No | Yes | No | `cortex-m33` | `+soft-float` |
| Cortex-M33 | No | No | No | `cortex-m33` | `-fpregs,-dsp` |
| Cortex-M33 | No | Yes | No | `cortex-m33` | `-fpregs` |
| Cortex-M33 | SP | No | No | `cortex-m33` | `-dsp` |
| Cortex-M33 | SP | Yes | No | `cortex-m33` | None |
| Cortex-M35P | No | No | No | `cortex-m35p` | `+soft-float,-dsp` |
| Cortex-M35P | No | Yes | No | `cortex-m35p` | `+soft-float` |
| Cortex-M35P | No | No | No | `cortex-m35p` | `-fpregs,-dsp` |
| Cortex-M35P | No | Yes | No | `cortex-m35p` | `-fpregs` |
| Cortex-M35P | SP | No | No | `cortex-m35p` | `-dsp` |
| Cortex-M35P | SP | Yes | No | `cortex-m35p` | None |
| Cortex-M55 | No | Yes | No | `cortex-m55` | `+soft-float,-mve` |
| Cortex-M55 | No | Yes | No | `cortex-m55` | `-fpregs,-mve` |
| Cortex-M55 | DP | Yes | No | `cortex-m55` | `-mve` |
| Cortex-M55 | No | Yes | Int | `cortex-m55` | `+soft-float,-mve.fp` |
| Cortex-M55 | No | Yes | Int | `cortex-m55` | `-fpregs,-mve.fp,+mve`|
| Cortex-M55 | DP | Yes | Int | `cortex-m55` | `-mve.fp` |
| Cortex-M55 | DP | Yes | Int+Float | `cortex-m55` | None |
| Cortex-M85 | No | Yes | No | `cortex-m85` | `+soft-float,-mve` |
| Cortex-M85 | No | Yes | No | `cortex-m85` | `-fpregs,-mve` |
| Cortex-M85 | DP | Yes | No | `cortex-m85` | `-mve` |
| Cortex-M85 | No | Yes | Int | `cortex-m85` | `+soft-float,-mve.fp` |
| Cortex-M85 | No | Yes | Int | `cortex-m85` | `-fpregs,-mve.fp,+mve`|
| Cortex-M85 | DP | Yes | Int | `cortex-m85` | `-mve.fp` |
| Cortex-M85 | DP | Yes | Int+Float | `cortex-m85` | None |

Expand All @@ -74,6 +74,13 @@ to use these flags.
| Cortex-M85 | DP | Yes | Int | `cortex-m85` | `-mve.fp` |
| Cortex-M85 | DP | Yes | Int+Float | `cortex-m85` | None |

<div class="warning">

Never use the `-fpregs` *target-feature* with these `eabihf` targets
as it will cause compilation units to have different ABIs, which is unsound.

</div>

### Arm Cortex-M33

The target CPU is `cortex-m33`.
Expand All @@ -83,7 +90,7 @@ The target CPU is `cortex-m33`.
* enabled by default with this *target-cpu*
* Has an optional single precision FPU
* support is enabled by default with this *target-cpu*
* disable support using the `+soft-float` feature (`eabi` only)
* disable support using the `-fpregs` *target-feature* (`eabi` only)

### Arm Cortex-M35P

Expand All @@ -94,7 +101,7 @@ The target CPU is `cortex-m35p`.
* enabled by default with this *target-cpu*
* Has an optional single precision FPU
* support is enabled by default with this *target-cpu*
* disable support using the `+soft-float` feature (`eabi` only)
* disable support using the `-fpregs` *target-feature* (`eabi` only)

### Arm Cortex-M55

Expand All @@ -106,7 +113,7 @@ The target CPU is `cortex-m55`.
* Has an optional double-precision FPU that also supports half-precision FP16
values
* support is enabled by default with this *target-cpu*
* disable support using the `+soft-float` feature (`eabi` only)
* disable support using the `-fpregs` *target-feature* (`eabi` only)
* Has optional support for M-Profile Vector Extensions
* Also known as *Helium Technology*
* Available with only integer support, or both integer/float support
Expand All @@ -125,7 +132,7 @@ The target CPU is `cortex-m85`.
* Has an optional double-precision FPU that also supports half-precision FP16
values
* support is enabled by default with this *target-cpu*
* disable support using the `+soft-float` feature (`eabi` only)
* disable support using the `-fpregs` *target-feature* (`eabi` only)
* Has optional support for M-Profile Vector Extensions
* Also known as *Helium Technology*
* Available with only integer support, or both integer/float support
Expand Down
Loading