Skip to content

Commit a9022d4

Browse files
Arm target doc wording tweaks based on review comments.
1 parent e6f0e03 commit a9022d4

File tree

6 files changed

+37
-27
lines changed

6 files changed

+37
-27
lines changed

src/doc/rustc/src/platform-support/arm-none-eabi.md

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,34 @@
3030

3131
## Common Target Details
3232

33-
This documentation covers details that apply to a range of bare-metal target for
34-
32-bit ARM CPUs. In addition, target specific details may be covered in their
35-
own document.
33+
This documentation covers details that apply to a range of bare-metal targets
34+
for 32-bit ARM CPUs. In addition, target specific details may be covered in
35+
their own document.
3636

3737
If a target ends in `eabi`, that target uses the so-called *soft-float ABI*:
3838
functions which take `f32` or `f64` as arguments will have those values packed
3939
into integer registers. This means that an FPU is not required from an ABI
40-
perspective, but within a function FPU instructions may still be used if the
41-
code is compiled with a `target-cpu` or `target-feature` option that enables
42-
FPU support.
40+
perspective, but within a function floating-point instructions may still be used
41+
if the code is compiled with a `target-cpu` or `target-feature` option that
42+
enables FPU support.
4343

44-
If a target ends if `eabihf`, that target uses the so-called *hard-float ABI*:
44+
If a target ends in `eabihf`, that target uses the so-called *hard-float ABI*:
4545
functions which take `f32` or `f64` as arguments will have them passed via FPU
46-
registers. These targets therefore require the use of an FPU and will assume the
47-
minimum support FPU for that architecture is available. More advanced FPU
48-
instructions (e.g. ones that work on double-precision `f64` values) may be
46+
registers. These targets therefore require the availability of an FPU and will
47+
assume some baseline level of floating-point support is available (which can
48+
vary depending on the target). More advanced floating-point instructions may be
4949
generated if the code is compiled with a `target-cpu` or `target-feature` option
50-
that enables such additional FPU support.
50+
that enables such additional FPU support. For example, if a given hard-float
51+
target has baseline *single-precision* (`f32`) support in hardware, there may be
52+
`target-cpu` or `target-feature` options that tell LLVM to assume your processor
53+
in fact also has *double-precision* (`f64`) support.
54+
55+
You may of course use the `f32` and `f64` types in your code, regardless of the
56+
ABI being used, or the level of support your processor has for performing such
57+
operations in hardware. Any floating-point operations that LLVM assumes your
58+
processor cannot support will be lowered to library calls (like `__aeabi_dadd`)
59+
which perform the floating-point operation in software using integer
60+
instructions.
5161

5262
## Target CPU and Target Feature options
5363

@@ -61,7 +71,7 @@ It is important to note that selecting a *target-cpu* will typically enable
6171
*all* the optional features available from Arm on that model of CPU and your
6272
particular implementation of that CPU may not have those features available. In
6373
that case, you can use `-C target-feature=-option` to turn off the specific CPU
64-
features you do not have available, leaving you with the optimised instruction
74+
features you do not have available, leaving you with the optimized instruction
6575
scheduling and support for the features you do have. More details are available
6676
in the detailed target-specific documentation.
6777

@@ -76,13 +86,13 @@ uses (likely linker related ones):
7686
```toml
7787
rustflags = [
7888
# Usual Arm bare-metal linker setup
79-
"-C", "link-arg=-Tlink.x",
80-
"-C", "link-arg=--nmagic",
89+
"-Clink-arg=-Tlink.x",
90+
"-Clink-arg=--nmagic",
8191
# tell Rust we have a Cortex-M55
82-
"-C", "target-cpu=cortex-m55",
92+
"-Ctarget-cpu=cortex-m55",
8393
# tell Rust our Cortex-M55 doesn't have Floating-Point M-Profile Vector
8494
# Extensions (but it does have everything else a Cortex-M55 could have).
85-
"-C", "target-feature=-mve.fp"
95+
"-Ctarget-feature=-mve.fp"
8696
]
8797

8898
[build]
@@ -157,10 +167,10 @@ Most of `core` should work as expected, with the following notes:
157167

158168
Rust programs are output as ELF files.
159169

160-
[atomic-load]: https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicU32.html#method.load
161-
[atomic-store]: https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicU32.html#method.store
162-
[fetch-add]: https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicU32.html#method.fetch_add
163-
[compare-exchange]: https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicU32.html#method.compare_exchange
170+
[atomic-load]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU32.html#method.load
171+
[atomic-store]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU32.html#method.store
172+
[fetch-add]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU32.html#method.fetch_add
173+
[compare-exchange]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU32.html#method.compare_exchange
164174

165175
## Testing
166176

src/doc/rustc/src/platform-support/thumbv6m-none-eabi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ See [`arm-none-eabi`](arm-none-eabi.md) for information applicable to all
1515
`arm-none-eabi` targets.
1616

1717
This target uses the soft-float ABI: functions which take `f32` or `f64` as
18-
arguments will have those values packed into an integer registers. This is the
18+
arguments will have those values packed into integer registers. This is the
1919
only option because there is no FPU support in [ARMv6-M].
2020

2121
[t32-isa]: https://developer.arm.com/Architectures/T32%20Instruction%20Set%20Architecture

src/doc/rustc/src/platform-support/thumbv7em-none-eabi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See [`arm-none-eabi`](arm-none-eabi.md) for information applicable to all
1414
`arm-none-eabi` targets.
1515

1616
This target uses the soft-float ABI: functions which take `f32` or `f64` as
17-
arguments will have those values packed into an integer registers. This target
17+
arguments will have those values packed into integer registers. This target
1818
therefore does not require the use of an FPU (which is optional on Cortex-M4 and
1919
Cortex-M7), but an FPU can be optionally enabled if desired. See also the
2020
hard-float ABI version of this target
@@ -52,7 +52,7 @@ The target CPU is `cortex-m4`.
5252

5353
* All Cortex-M4 have DSP extensions
5454
* support is controlled by the `dsp` *target-feature*
55-
* enabled by default with this *target-cpu*
55+
* enabled by default with this *target*
5656
* Cortex-M4F has a single precision FPU
5757
* support is enabled by default with this *target-cpu*
5858
* disable support using the `+soft-float` feature
@@ -63,7 +63,7 @@ The target CPU is `cortex-m7`.
6363

6464
* All Cortex-M7 have DSP extensions
6565
* support is controlled by the `dsp` *target-feature*
66-
* enabled by default with this *target-cpu*
66+
* enabled by default with this *target*
6767
* Cortex-M7F have either a single-precision or double-precision FPU
6868
* double-precision support is enabled by default with this *target-cpu*
6969
* opt-out by using the `-f64` *target-feature*

src/doc/rustc/src/platform-support/thumbv7m-none-eabi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See [`arm-none-eabi`](arm-none-eabi.md) for information applicable to all
1313
`arm-none-eabi` targets.
1414

1515
This target uses the soft-float ABI: functions which take `f32` or `f64` as
16-
arguments will have those values packed into an integer registers. This is the
16+
arguments will have those values packed into integer registers. This is the
1717
only option because there is no FPU support in [ARMv7-M].
1818

1919
[t32-isa]: https://developer.arm.com/Architectures/T32%20Instruction%20Set%20Architecture

src/doc/rustc/src/platform-support/thumbv8m.base-none-eabi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See [`arm-none-eabi`](arm-none-eabi.md) for information applicable to all
1313
`arm-none-eabi` targets.
1414

1515
This target uses the soft-float ABI: functions which take `f32` or `f64` as
16-
arguments will have those values packed into an integer registers. This is the
16+
arguments will have those values packed into integer registers. This is the
1717
only option because there is no FPU support in [ARMv6-M].
1818

1919
[t32-isa]: https://developer.arm.com/Architectures/T32%20Instruction%20Set%20Architecture

src/doc/rustc/src/platform-support/thumbv8m.main-none-eabi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ See [`arm-none-eabi`](arm-none-eabi.md) for information applicable to all
1616
`arm-none-eabi` targets.
1717

1818
This target uses the soft-float ABI: functions which take `f32` or `f64` as
19-
arguments will have those values packed into an integer registers. This target
19+
arguments will have those values packed into integer registers. This target
2020
therefore does not require the use of an FPU (which is optional on Cortex-M33,
2121
Cortex-M55 and Cortex-M85), but an FPU can be optionally enabled if desired. See
2222
also the hard-float ABI version of this target

0 commit comments

Comments
 (0)