Uh oh!
There was an error while loading. Please reload this page.
Add integer atomic types - #33048
Conversation
rust-highfive
commented
Apr 17, 2016
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
Amanieu
commented
Apr 17, 2016
alexcrichton
commented
Apr 18, 2016
Thanks @Amanieu! Some thoughts of mine:
|
There was a problem hiding this comment.
Just confirming, but this is inherent to aarch64 (e.g. 128-bit atomics are available everywhere?)
alexcrichton
commented
Apr 18, 2016
Gah, I hit enter too quickly...
I wonder if this can also try to have a more comprehensive test? We don't run tests for platforms like ARM/MIPS/etc, but it'd be good to exercise those platforms as they're quite relevant here. Also, cc @rust-lang/libs, @brson |
Amanieu
commented
Apr 18, 2016
The reason I left them out is because they use different stability attributes (
This is a bit complicated because some early AMD x86_64 CPUs don't support cmpxchg16b. Support for this instruction can be enabled in LLVM by targeting a CPU that supports it (which the OSX target does with I don't think there is a way to extract the maximum atomic size from LLVM's API. I've mostly copied what Clang does, which is to determine it from the target architecture and any compilation flags passed in (
Yes, these will never be lowered to compiler-rt calls. The test should be able to catch any cases that are lowered to libcalls.
How would you suggest doing this? |
Amanieu
commented
Apr 18, 2016
Should I reuse the |
de5dcb7 to
f794e48Comparealexcrichton
commented
Apr 18, 2016
Right yeah, but perhaps that could be an input to the macro? (e.g. the macro takes a stability attribute as input)
Only statically, though, right? If I pass
Unfortunately this test won't catch anything because it's only run on x86_64 and x86 for now.
A "minimal cross-compiled libcore" could probably suffice. Something with a few lang items enough to just generate an object file should be enough. You could then call the intrinsics directly to ensure they're not lowered to libcalls. |
Amanieu
commented
Apr 19, 2016
No, for that we would need to be able to recognize all the CPU variant and set the appropriate LLVM flags for them. See Clang: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130930/090167.html |
Amanieu
commented
Apr 19, 2016
Should we expose |
Amanieu
commented
Apr 19, 2016
Also, should I add constants like |
a86ad7f to
702813dCompareAmanieu
commented
Apr 19, 2016
Done
Done |
alexcrichton
commented
Apr 19, 2016
Yeah that's kinda unfortunate for now, although we're not even exposing the 128-bit types just yet, so it's ok to punt on this for now.
Nah I wouldn't bother. If it's easier to write the macro where they all have
Indeed! Awesome, thanks for the updates! |
Amanieu
commented
Apr 19, 2016
I've added the constants, is there anything else to do? |
alexcrichton
commented
Apr 19, 2016
Looks good to me, thanks @Amanieu! I want to double check with @rust-lang/libs about the |
ollie27
commented
Apr 19, 2016
Are the constants not going to be deprecated once |
alexcrichton
commented
Apr 19, 2016
They likely will be, yes, but |
missing comma |
Amanieu
commented
May 5, 2016
Fixed |
alexcrichton
commented
May 5, 2016
@bors: r+ 1a6530803e1c38a105274d0554306fede183d9ce |
bors
commented
May 6, 2016
⌛ Testing commit 1a65308 with merge 4a133c2... |
bors
commented
May 6, 2016
💔 Test failed - auto-linux-64-cross-armsf |
Amanieu
commented
May 6, 2016
Sorry about that, fixed again. |
alexcrichton
commented
May 6, 2016
@bors: r+ 033699ca561a7e8d2f33eee392a3a8a7373e891b |
bors
commented
May 6, 2016
⌛ Testing commit 033699c with merge 780897b... |
bors
commented
May 6, 2016
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
bors
commented
May 7, 2016
☔ The latest upstream changes (presumably #33487) made this pull request unmergeable. Please resolve the merge conflicts. |
Amanieu
commented
May 9, 2016
Rebased and changed the test to only run on Linux. |
alexcrichton
commented
May 9, 2016
bors
commented
May 9, 2016
Add integer atomic types Tracking issue: #32976 RFC: rust-lang/rfcs#1543 The changes to AtomicBool in the RFC are not included, they are in a separate PR (#32365).
bors
commented
May 9, 2016
…-abi, r=alexcrichton Update aarch64-linux-android target to match android abi. - Changed `target_env` to "gnu" to empty "" for all android targets because it does not matter for android. - The PR #33048 added "max_atomic_width" for arm-android but missed recently added armv7-android. Add it there too. - Added features `+neon,+fp-armv8` because they [must exist on `aarch64` android](http://developer.android.com/ndk/guides/cpu-features.html). - Update libc to include rust-lang/libc#282 so that rust's std lib works on android's aarch64 (the main issue there was incorrect structure alignment on 64-bit arm). r? @alexcrichton
Tracking issue: #32976
RFC: rust-lang/rfcs#1543
The changes to AtomicBool in the RFC are not included, they are in a separate PR (#32365).