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

Arm bare-metal target doc changes #124404

Merged
merged 8 commits into from
May 2, 2024

Conversation

jonathanpallant
Copy link
Contributor

Updates the Arm bare-metal target docs:

  • Detailed pages for all the Cortex-M targets, including details about setting target-cpu and target-features to suit specific Arm models
  • More detail about the difference between eabi and eabihf
  • Marks the Embedded Devices Working Group Cortex-M Team as the maintainer of the Cortex-M targets

Now explains how to, for example, support a Cortex-M55 with FPU and Integer Helium.
@rustbot
Copy link
Collaborator

rustbot commented Apr 26, 2024

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 26, 2024
@rustbot
Copy link
Collaborator

rustbot commented Apr 26, 2024

Some changes occurred in src/doc/rustc/src/platform-support

cc @Nilstrieb

@Noratrieb
Copy link
Member

I do not know enough about ARM to comment whether the content is correct, but you do as a target maintainer so I trust you there.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Apr 26, 2024

📌 Commit b173984 has been approved by Nilstrieb

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 26, 2024
@rust-log-analyzer

This comment has been minimized.

@Noratrieb
Copy link
Member

@bors r- nevermind

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 26, 2024
@thejpster
Copy link
Contributor

What went wrong?

@Noratrieb
Copy link
Member

linkcheck #124404 (comment)

@thejpster
Copy link
Contributor

Yeah I saw that and I don't know what I did wrong.

I added src/doc/rustc/src/platform-support/thumbv6m-none-eabi.md, and I linked to it. Do I need to tell it about the new file? Or is there a typo I just can't see?

@ehuss
Copy link
Contributor

ehuss commented Apr 26, 2024

New files need to be added to SUMMARY.md.

Copy link
Contributor

@chrisnc chrisnc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few minor notes. At a higher level though, would it be best to consolidate the hf and non-hf documents for the variants that have both? There's a lot of duplicated information that would have to be manually kept in sync as-is.

src/doc/rustc/src/platform-support/arm-none-eabi.md Outdated Show resolved Hide resolved
src/doc/rustc/src/platform-support/arm-none-eabi.md Outdated Show resolved Hide resolved
src/doc/rustc/src/platform-support/arm-none-eabi.md Outdated Show resolved Hide resolved
src/doc/rustc/src/platform-support/arm-none-eabi.md Outdated Show resolved Hide resolved
@jonathanpallant
Copy link
Contributor Author

Left a few minor notes. At a higher level though, would it be best to consolidate the hf and non-hf documents for the variants that have both? There's a lot of duplicated information that would have to be manually kept in sync as-is.

I've done this in the most recent commit. If we don't like it, I can drop it.

Copy link
Contributor

@chrisnc chrisnc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arm consistently uses title case for their own name and architecture names ("Armv6-M", "Armv7E-M", etc.) in their docs these days, so probably should do that here. Right now it's a mix.

@jonathanpallant
Copy link
Contributor Author

Arm consistently uses title case for their own name and architecture names ("Armv6-M", "Armv7E-M", etc.) in their docs these days, so probably should do that here. Right now it's a mix.

Oof. OK, I've done it. But I'm not sure I like how Arm spell it.

Also, I didn't touch "ARM64" (which is a Microsoft term, not an Arm term).

## Common Target Details

This documentation covers details that apply to a range of bare-metal targets
for 32-bit ARM CPUs. In addition, target specific details may be covered in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arm

@chrisnc
Copy link
Contributor

chrisnc commented Apr 30, 2024

Looks great! I will try and assemble similar tables for the Cortex-R's in the next week or so.

Yes it looks weird, but this is how Arm write it now.

I left ARM64 alone, because it's a Microsoft/Apple term but not an Arm term (they have Armv8-A and Armv9-A architectures, which say that A64 instructions are executed when in the Aarch64 state), and I don't want to get into that, especially for a Tier 1 target.
@jonathanpallant jonathanpallant force-pushed the arm-target-changes-new branch from d92aa43 to fcaba9c Compare April 30, 2024 09:01
@jonathanpallant
Copy link
Contributor Author

Ok one more update done - I added a section clarifying the terms Arm ISA, Thumb ISA, Thumb-2 ISA, A32 and T32.

@ehuss
Copy link
Contributor

ehuss commented May 1, 2024

Thanks!

@bors r=chrisnc rollup

@bors
Copy link
Contributor

bors commented May 1, 2024

📌 Commit fcaba9c has been approved by chrisnc

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 1, 2024
@bors
Copy link
Contributor

bors commented May 1, 2024

⌛ Testing commit fcaba9c with merge cfb2410...

@bors
Copy link
Contributor

bors commented May 2, 2024

☀️ Test successful - checks-actions
Approved by: chrisnc
Pushing cfb2410 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 2, 2024
@bors bors merged commit cfb2410 into rust-lang:master May 2, 2024
10 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 2, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (cfb2410): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 676.596s -> 674.001s (-0.38%)
Artifact size: 315.96 MiB -> 315.98 MiB (0.01%)

@ehuss ehuss mentioned this pull request May 30, 2024
| Any | No | Yes | None | None |
| Cortex-M4 | No | Yes | `cortex-m4` | `+soft-float` |
| Cortex-M4F | SP | Yes | `cortex-m4` | None |
| Cortex-M7 | No | Yes | `cortex-m7` | `+soft-float` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW this is a problematic piece of advice to give, since this target feature is also implicated in the soundness issue tracked at #116344.

Copy link
Contributor

@thejpster thejpster Sep 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although as we discussed extensively on Zulip currently we know of no other way of stopping target-cpu=cortex-m7 (or similar) from emitting FPU instructions like vadd.f32, yet it's reasonable to want the Cortex-M7 specific instruction scheduling optimisations even if your Cortex-M7 doesn't have an FPU.

This feature is totally unsound on *-unknown-none-eabihf, but it's both sound and useful on *-unknown-none-eabi. The 'target-feature' checker can currently only look at the target-architecture, and not the full target triple, so it's unclear where we go from here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The target-feature checker is still WIP, and will be improved to handle this, somehow.

But the docs maybe should call out that this same flag is unsound to use on other targets (until rustc reaches the point where it is able to tell users about this directly).

@RalfJung
Copy link
Member

RalfJung commented Sep 28, 2024

Also, it is rather unusual for stable docs to recommend unstable/unsupported features. Using these flags will cause warnings on current compilers! (And the only reason those warnings are not hard errors is that target features are a terrible mess and we are grandfathering in all LLVM features, and hoping that doesn't break too many things.)

@RalfJung
Copy link
Member

Also, it is rather unusual for stable docs to recommend unstable/unsupported features. Using these flags will cause warnings on current compilers! (And the only reason those warnings are not hard errors is that target features are a terrible mess and we are grandfathering in all LLVM features, and hoping that doesn't break too many things.)

We have an issue for this now: #130988

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants