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

Conversation

thejpster
Copy link

This PR updates the Arm microcontroller platform docs to recommend -fpregs instead of +soft-float as discussed on Zulip

These arrived in rust-lang#125690, I think by mistake.
@rustbot
Copy link
Collaborator

rustbot commented Sep 28, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

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

rustbot commented Sep 28, 2024

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

cc @Noratrieb

@thejpster thejpster changed the title Revise arm platform notes soft float Revise arm platform notes regarding soft float Sep 28, 2024
Has the same effect, but turning off a feature matches the other flags better than turning on a feature (which actually turns off a feature).
@thejpster thejpster force-pushed the revise-arm-platform-notes-soft-float branch from b6a713b to 1bec022 Compare September 28, 2024 17:20
@ehuss
Copy link
Contributor

ehuss commented Sep 30, 2024

@rustbot ping arm

Can an Arm maintainer review this, please?

Or, cc @RalfJung, since I've noticed the two of you discussing this on Zulip, if you want to review this.

@rustbot rustbot added the O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state label Sep 30, 2024
@rustbot
Copy link
Collaborator

rustbot commented Sep 30, 2024

Hey ARM Group! This bug has been identified as a good "ARM candidate".
In case it's useful, here are some instructions for tackling these sorts of
bugs. Maybe take a look?
Thanks! <3

cc @adamgemmell @davidtwco @hug-dev @jacobbramley @JamieCunliffe @joaopaulocarreiro @raw-bin @Stammark

@thejpster
Copy link
Author

thejpster commented Oct 1, 2024

AIUI there are no Arm maintainers for M-Profile, only for the Aarch64 A-Profile. Although they offered to help on a best-effort basis.

The designated maintainer is the Cortex-M Team in the Embedded Devices Working Group. I don't think you can ping them on github but I'll post this on their matrix room.

@jamesmunns
Copy link
Member

jamesmunns commented Oct 1, 2024

CC @adamgreig @thalesfragoso @newAM

Copy link
Contributor

@jacobbramley jacobbramley left a comment

Choose a reason for hiding this comment

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

This seems to do the right thing (at least for the cases I tried and based on the Zulip discussion), and no alarm bells went off when I discussed it with our LLVM teams.

One caveat we noticed — which is really a separate concern — is that there's no way to specify eabihf with no FP. That sounds nonsensical, but it's potentially useful with integer MVE, which uses the same registers. Clang achieves that with +nofp, which seems to get translated into -mfpu=none, but I can't find a way to control that through Rust.

@thejpster
Copy link
Author

Does Integer MVE let you use s0 and d0 even without an FPU?! Wild.

@jacobbramley
Copy link
Contributor

jacobbramley commented Oct 11, 2024

Does Integer MVE let you use s0 and d0 even without an FPU?! Wild.

Yes, at least for the few instructions you'd need to use this ABI. I've not done any real work on these devices so can't claim to be an expert, but the Armv8-M reference manual says that the necessary VMOV instructions are available with either FP or MVE.

The FP/vector register file is overlaid so that q0 aliases d1:d0 and s3:s2:s1:s0, just like A-class AArch32's Neon registers. You could read d0 as "the lower 64 bits of q0", which might feel more natural in a world without FP hardware. There's a layout diagram under rule RBBYH, page 180 in version B.y of the manual.

@thejpster
Copy link
Author

Does Integer MVE let you use s0 and d0 even without an FPU?! Wild.

Yes, at least for the few instructions you'd need to use this ABI. I've not done any real work on these devices so can't claim to be an expert, but the Armv8-M reference manual says that the necessary VMOV instructions are available with either FP or MVE.

The FP/vector register file is overlaid so that q0 aliases d1:d0 and s3:s2:s1:s0, just like A-class AArch32's Neon registers. You could read d0 as "the lower 64 bits of q0", which might feel more natural in a world without FP hardware. There's a layout diagram under rule RBBYH, page 180 in version B.y of the manual.

OK, I added some notes to mention that this is a potentially valid setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants