-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Open
thejpster
wants to merge
6
commits into
rust-lang:main
Choose a base branch
from
thejpster:add-armv6-bare-metal
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add new Tier 3 targets for ARMv6 #150138
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
982fdcf
Add ARMv6 bare-metal targets
thejpster 32cd8e5
Fix typo in thumbv4t/v5te README
thejpster acecdd1
Fix links
thejpster 4c03213
Revised yield hints
thejpster b79e559
Add links in platform-support.md
thejpster b3c66dd
Fix Armv7-R entries in platform-support.md
thejpster File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| //! Targets the ARMv6K architecture, with `a32` code by default. | ||
|
|
||
| use crate::spec::{Abi, Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs}; | ||
|
|
||
| pub(crate) fn target() -> Target { | ||
| Target { | ||
| llvm_target: "armv6-none-eabi".into(), | ||
| metadata: TargetMetadata { | ||
| description: Some("Bare ARMv6 soft-float".into()), | ||
| tier: Some(3), | ||
| host_tools: Some(false), | ||
| std: Some(false), | ||
| }, | ||
| pointer_width: 32, | ||
| arch: Arch::Arm, | ||
| data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(), | ||
| options: TargetOptions { | ||
| abi: Abi::Eabi, | ||
| llvm_floatabi: Some(FloatAbi::Soft), | ||
| asm_args: cvs!["-mthumb-interwork", "-march=armv6", "-mlittle-endian",], | ||
| features: "+soft-float,+strict-align,+v6k".into(), | ||
| atomic_cas: true, | ||
| has_thumb_interworking: true, | ||
| ..base::arm_none::opts() | ||
| }, | ||
| } | ||
| } |
27 changes: 27 additions & 0 deletions
27
compiler/rustc_target/src/spec/targets/armv6_none_eabihf.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| //! Targets the ARMv6K architecture, with `a32` code by default, and hard-float ABI | ||
|
|
||
| use crate::spec::{Abi, Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs}; | ||
|
|
||
| pub(crate) fn target() -> Target { | ||
| Target { | ||
| llvm_target: "armv6-none-eabihf".into(), | ||
| metadata: TargetMetadata { | ||
| description: Some("Bare ARMv6 hard-float".into()), | ||
| tier: Some(3), | ||
| host_tools: Some(false), | ||
| std: Some(false), | ||
| }, | ||
| pointer_width: 32, | ||
| arch: Arch::Arm, | ||
| data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(), | ||
| options: TargetOptions { | ||
| abi: Abi::EabiHf, | ||
| llvm_floatabi: Some(FloatAbi::Hard), | ||
| asm_args: cvs!["-mthumb-interwork", "-march=armv6", "-mlittle-endian",], | ||
| features: "+strict-align,+v6k,+vfp2,-d32".into(), | ||
| atomic_cas: true, | ||
| has_thumb_interworking: true, | ||
| ..base::arm_none::opts() | ||
| }, | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
compiler/rustc_target/src/spec/targets/thumbv6_none_eabi.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| //! Targets the ARMv6K architecture, with `t32` code by default. | ||
|
|
||
| use crate::spec::{Abi, Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base, cvs}; | ||
|
|
||
| pub(crate) fn target() -> Target { | ||
| Target { | ||
| llvm_target: "thumbv6-none-eabi".into(), | ||
| metadata: TargetMetadata { | ||
| description: Some("Thumb-mode Bare ARMv6 soft-float".into()), | ||
| tier: Some(3), | ||
| host_tools: Some(false), | ||
| std: Some(false), | ||
| }, | ||
| pointer_width: 32, | ||
| arch: Arch::Arm, | ||
| data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(), | ||
| options: TargetOptions { | ||
| abi: Abi::Eabi, | ||
| llvm_floatabi: Some(FloatAbi::Soft), | ||
| asm_args: cvs!["-mthumb-interwork", "-march=armv6", "-mlittle-endian",], | ||
| features: "+soft-float,+strict-align,+v6k".into(), | ||
| // atomics not available until ARMv6T2 | ||
| atomic_cas: false, | ||
| max_atomic_width: Some(0), | ||
| has_thumb_interworking: true, | ||
| ..base::arm_none::opts() | ||
| }, | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # `armv6-none-eabi*` and `thumbv6-none-eabi` | ||
|
|
||
| * **Tier: 3** | ||
| * **Library Support:** core and alloc (bare-metal, `#![no_std]`) | ||
|
|
||
| Bare-metal target for any cpu in the Armv6 architecture family, supporting | ||
| ARM/Thumb code interworking (aka `Arm`/`Thumb`), with `Arm` code as the default | ||
| code generation. The most common processor family using the Armv6 architecture | ||
| is the ARM11, which includes the ARM1176JZF-S used in the original Raspberry Pi | ||
| and in the Raspberry Pi Zero. | ||
|
|
||
| This target assumes your processor has the Armv6K extensions, as basically all | ||
| Armv6 processors do[^1]. The Armv6K extension adds the `LDREXB` and `STREXB` | ||
| instructions required to implement CAS on the [`AtomicU8`] and [`AtomicI8`] types. | ||
|
|
||
| The `thumbv6-none-eabi` target is the same as this one, but the instruction set | ||
| defaults to `Thumb`. Note that this target only supports the old Thumb-1 | ||
| instruction set, not the later Thumb-2 instruction set that was added in the | ||
| Armv6T2 extension. | ||
|
|
||
| The `armv6-none-eabihf` target uses the EABIHF hard-float ABI, and requires an | ||
| FPU - it assumes a VFP2D16 FPU is present. The FPU is not available from Thumb | ||
| mode so there is no `thumbv6-none-eabihf` target. | ||
|
|
||
| See [`arm-none-eabi`](arm-none-eabi.md) for information applicable to all | ||
| `arm-none-eabi` targets. | ||
|
|
||
| [`AtomicU8`](https://docs.rust-lang.org/stable/core/sync/atomic/struct.AtomicU8.html) | ||
| [`AtomicI8`](https://docs.rust-lang.org/stable/core/sync/atomic/struct.AtomicI8.html) | ||
thejpster marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Target Maintainers | ||
|
|
||
| [@thejpster](https://github.com/thejpster) | ||
|
|
||
| [^1]: The only ARMv6 processor without the Armv6k extensions is the first (r0) | ||
| revision of the ARM1136 - in the unlikely event you have a chip with one of | ||
| these processors, use the ARMv5TE target instead. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.