Add support for ARMv5TE architecture #37615

Merged
merged 2 commits into from Nov 12, 2016

Projects

None yet

9 participants

@atilag
Contributor
atilag commented Nov 6, 2016

No description provided.

@nrc nrc was assigned by rust-highfive Nov 6, 2016
@rust-highfive
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nrc (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@japaric
Member
japaric commented Nov 6, 2016
+
+ options: TargetOptions {
+ features: "+soft-float".to_string(),
+ max_atomic_width: Some(64),
@japaric
japaric Nov 6, 2016 Member

LLVM can't lower atomic stuff to actual ARMv5 instructions because there are no instructions in the instruction set to implement atomics. This is going to require something like rust-lang-nursery/compiler-builtins#115

cc @Amanieu

@Amanieu
Amanieu Nov 7, 2016 Contributor

Even with my PR the maximum atomic width would be 32 bits, not 64 bits.

@alexcrichton
Member

cc @rust-lang/tools, thoughts on adding a new target?

@alexcrichton
Member

Thanks for the PR @atilag! Could you also expand a bit on your use case for this target and why you'd like to see it in the compiler itself? (as opposed to using custom target specs)

@Amanieu
Contributor
Amanieu commented Nov 7, 2016

Another question is, should we also add support for ARMv4T as a target? This is the minimum architecture that Debian armel requires.

@atilag
Contributor
atilag commented Nov 7, 2016 edited

Hi guys!
Well, me and me colleagues were trying to build a project around a hardware that, despite of being a little oldish, seems to be still very common in IoT based products. We could use other technologies, like C/C++ of course, but our experience in Rust is being very positive and we would love to keep using it and prove that Rust is a valid option even for these elderly platforms. We don't have special desires to include it as part of the compiler, so maybe using a custom target would work for us, but, is there any strong reason to not include it?
Thanks guys!
Keep up the good work!

@japaric
Member
japaric commented Nov 7, 2016

@alexcrichton

Not the OP but if they are building std programs then having the target in-tree + binary releases of std is the most ergonomic option until we get std-aware Cargo. Or, IOW, compiling std for custom targets is a pain in the neck.

@Amanieu

Do you know for how long does Debian intent to provide ARMv4+ support?

@fabricedesre
Contributor

Indeed we are building std programs (the OS is Linux), so having an in-tree target helps.

@Amanieu
Contributor
Amanieu commented Nov 7, 2016

@japaric I don't think Debian has any intention of dropping armel any time soon. Debian currently supports only two ARM variants: armel (ARMv4t+, soft float) and armhf (ARMv7+, hard float).

@atilag
Contributor
atilag commented Nov 7, 2016

@japaric @Amanieu @Amanieu so I have updated the max_atomic_width to 32 bits. I guess that we need to merge rust-lang-nursery/compiler-builtins#115 before merging this one, right?

@japaric
Member
japaric commented Nov 7, 2016

@atilag #36992 would have to land as well.

@Amanieu
Contributor
Amanieu commented Nov 7, 2016

We also need to decide whether we want to support ARMv4T, ARMv5TE, or both.

@atilag
Contributor
atilag commented Nov 8, 2016

@Amanieu I guess that in case we need to support ARMv4T, this could be done in another PR.
My understanding is that supporting ARMv5TE would only increase the added value of the language, so the question would be whether there's any drawback that outperforms this support. If we don't want to deal with a potential instability because of the atomic support, is there any way to mark this support as "unstable" or "experimental" ?

@alexcrichton
Member

Thanks for the explanation @atilag! I think we should hold off on armv4 here and perhaps add that in a future PR (if at all).

If ARMv5 doesn't have atomic instructions, though, then the current stance of the libs team is to set the max_atomic_width field to Some(0) as we can't actually create any instructions there. The fallbacks in compiler-builtins are intended to be optional for other use cases, if needed. We haven't figured out a great story yet, unfortunately, for pulling in those intrinsics on demand.

@alexcrichton
Member

@bors: r+

Thanks @atilag! cc @rust-lang/tools, a new target, but not necessarily libstd support just yet

@bors
Contributor
bors commented Nov 10, 2016

📌 Commit 365ea80 has been approved by alexcrichton

@brson brson added the relnotes label Nov 11, 2016
@eddyb eddyb added a commit to eddyb/rust that referenced this pull request Nov 11, 2016
@eddyb eddyb Rollup merge of #37615 - atilag:armv5te-support, r=alexcrichton
Add support for ARMv5TE architecture
df060c4
@eddyb eddyb referenced this pull request Nov 11, 2016
Closed

Rollup of 29 pull requests #37726

@bors bors added a commit that referenced this pull request Nov 12, 2016
@bors bors Auto merge of #37726 - eddyb:rollup, r=eddyb
Rollup of 29 pull requests

- Successful merges: #37190, #37368, #37481, #37503, #37527, #37535, #37545, #37551, #37584, #37600, #37615, #37659, #37662, #37669, #37682, #37688, #37690, #37692, #37693, #37694, #37695, #37696, #37698, #37699, #37705, #37708, #37709, #37716, #37724
- Failed merges: #37640, #37689
14d64c8
@eddyb eddyb added a commit to eddyb/rust that referenced this pull request Nov 12, 2016
@eddyb eddyb Rollup merge of #37615 - atilag:armv5te-support, r=alexcrichton
Add support for ARMv5TE architecture
8d2da2b
@eddyb eddyb referenced this pull request Nov 12, 2016
Merged

Rollup of 30 pull requests #37730

@bors bors added a commit that referenced this pull request Nov 12, 2016
@bors bors Auto merge of #37730 - eddyb:rollup, r=eddyb f3af8c8
@bors bors merged commit 365ea80 into rust-lang:master Nov 12, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment