-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Add new Tier 3 targets for ARMv6 #150138
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
base: main
Are you sure you want to change the base?
Add new Tier 3 targets for ARMv6 #150138
Conversation
|
cc @Amanieu, @folkertdev, @sayantn These commits modify compiler targets. Some changes occurred in src/doc/rustc/src/platform-support cc @Noratrieb |
This comment has been minimized.
This comment has been minimized.
696697d to
32cd8e5
Compare
|
Force pushed with fixed formatting |
Targets added in rust-lang/rust#150138. Tested with local build of rustc.
This comment has been minimized.
This comment has been minimized.
|
I think the naming is good. I have reviewed it myself, and would r+, but our policy is that new targets should be approved by a compiler lead, so: r? compiler_leads |
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #149831) made this pull request unmergeable. Please resolve the merge conflicts. |
| // atomics not available until ARMv6T2 | ||
| atomic_cas: false, | ||
| max_atomic_width: Some(0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this can be implemented using thumb interworking. (If so, I'm not sure if LLVM implements it, but I think I can implement it in portable-atomic.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you suggest I change it to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried max_atomic_width: Some(32) and even with a relaxed load/store I got:
rust-lld: error: undefined symbol: __sync_val_compare_and_swap_4
So for the same reason as ARMv4T and ARMv5TE I propose just switching atomics off here, and letting portable-atomic provide a work-around if it so chooses.
Three targets, covering A32 and T32 instructions, and soft-float and hard-float ABIs. Hard-float and atomics not available in Thumb mode.
Turns out v7 targets always have v6t2 set, so that line was redundant. Also add a link to the Arm Armv7 A.R.M.
b3c66dd to
02b8038
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Rebased on main and added some updates based on comments above. |
Targets added in rust-lang/rust#150138. Tested with local build of rustc.
Targets added in rust-lang/rust#150138. Tested with local build of rustc.
Adds three new targets to support ARMv6 processors running bare-metal:
armv6-none-eabi- Arm ISA, soft-floatarmv6-none-eabihf- Arm ISA, hard-floatthumbv6-none-eabi- Thumb-1 ISA, soft-floatThere is no
thumbv6-none-eabihftarget because as far as I can tell, hard-float isn't support with the Thumb-1 instruction set (and you need the ARMv6T2 extension to enable Thumb-2 support).The targets require ARMv6K as a minimum, which allows the two Arm ISA targets to have full CAS atomics. LLVM has a bug which means it emits some ARMv6K instructions even if you only call for ARMv6, and as no-one else has noticed the bug, and because basically all ARMv6 processors have ARMv6K, I think this is fine. The Thumb target also doesn't have any kind of atomics, just like the Armv5TE and Armv4 targets, because LLVM was emitting library calls to emulate them.
Testing will be added to https://github.com/rust-embedded/aarch32 once the target is accepted. I already have tests for the other non-M arm-none-eabi targets, and those tests pass on these targets.
I have listed myself. If accepted, I'll talk to the Embedded Devices Working Group about adding this one to the rosta with all the others they support.
You might prefer
arm-none-eabi, becausearm-unknown-linux-gnuis an ARMv6 target - the implicit rule seems to be that if the Arm architecture version isn't specified, it's assumed to be v6. However,armv6-none-eabiseemed to fit better betweenarmv5te-none-eabiandarmv7a/armv7r-none-eabi.The hamming distance between
thumbv6-none-eabiandthumbv6m-none-eabiis unfortunately low, but I don't know how to make it better. They are the ARMv6 and ARMv6-M targets, and its perhaps not worse thanarmv7a-none-eabiandarmv7r-none-eabi.No different to any other arm-none-eabi target.
Noted.
Same as other arm-none-eabi targets.
Same as other arm-none-eabi targets.
Noted.
Noted
Noted