Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upenable Atomic*.{load,store} for ARMv6-M / MSP430 #51953
Conversation
rust-highfive
assigned
alexcrichton
Jun 30, 2018
rust-highfive
added
the
S-waiting-on-review
label
Jun 30, 2018
japaric
reviewed
Jun 30, 2018
| @@ -479,6 +479,9 @@ declare_features! ( | |||
|
|
|||
| // Allows async and await syntax | |||
| (active, async_await, "1.28.0", Some(50547), None), | |||
|
|
|||
| // Allows async and await syntax | |||
| (active, cfg_target_has_atomic_cas, "1.28.0", Some(0), None), | |||
This comment has been minimized.
This comment has been minimized.
japaric
Jun 30, 2018
Author
Member
after this gets a thumbs up I'll create a tracking issue and fill it the number here
japaric
referenced this pull request
Jun 30, 2018
Closed
Consider adding load/store atomics for targets that don't support compare and swap #45085
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Looks good to me. Unfortunately I think there is a bug in llvm that needs to be fixed to use atomics on msp430. There is a chance that libcore will fail to compile on msp with this change, need to check before committing. |
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
alexcrichton
reviewed
Jul 2, 2018
|
Looks good to me, thanks! |
| @@ -163,7 +164,8 @@ mod boxed { | |||
| #[cfg(test)] | |||
| mod boxed_test; | |||
| pub mod collections; | |||
| #[cfg(target_has_atomic = "ptr")] | |||
| #[cfg_attr(stage0, cfg(target_has_atomic = "ptr"))] | |||
| #[cfg_attr(not(stage0), cfg(all(target_has_atomic = "ptr", target_has_atomic_cas)))] | |||
This comment has been minimized.
This comment has been minimized.
alexcrichton
Jul 2, 2018
Member
Instead of this cfg_attr, perhaps this could be:
#[cfg(any(
all(stage0, target_has_atomic = "ptr"),
all(not(stage0), target_has_atomic_cas, target_has_atomic = "ptr")
))]That may be a bit easier to clean up after the next stage0
This comment has been minimized.
This comment has been minimized.
alexcrichton
Jul 2, 2018
Member
Also, in terms of implementation, it may be easiest to piggy back on the existing target_has_atomic perhaps and do something like target_has_atomic ="cas" maybe?
| @@ -853,6 +862,7 @@ impl<T> AtomicPtr<T> { | |||
| /// ``` | |||
| #[inline] | |||
| #[stable(feature = "extended_compare_and_swap", since = "1.10.0")] | |||
| #[cfg_attr(not(stage0), cfg(target_has_atomic_cas))] | |||
This comment has been minimized.
This comment has been minimized.
japaric
force-pushed the
japaric:atomic-load-store
branch
from
c7058dc
to
6dc74b0
Jul 5, 2018
japaric
force-pushed the
japaric:atomic-load-store
branch
from
6dc74b0
to
0ed3231
Jul 5, 2018
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton latest commit reuses the existing |
This comment has been minimized.
This comment has been minimized.
|
@bors: r+ |
This comment has been minimized.
This comment has been minimized.
|
|
bors
added
S-waiting-on-bors
and removed
S-waiting-on-review
labels
Jul 5, 2018
kennytm
added a commit
to kennytm/rust
that referenced
this pull request
Jul 5, 2018
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
bors
added a commit
that referenced
this pull request
Jul 6, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors r- There is a failed CI test. |
bors
added
S-waiting-on-author
and removed
S-waiting-on-bors
labels
Jul 6, 2018
This comment has been minimized.
This comment has been minimized.
|
Very excited about this change! |
This comment has been minimized.
This comment has been minimized.
|
@bors r=alexcrichton |
This comment has been minimized.
This comment has been minimized.
|
|
bors
added
S-waiting-on-bors
and removed
S-waiting-on-author
labels
Jul 6, 2018
bors
added a commit
that referenced
this pull request
Jul 6, 2018
bors
added a commit
that referenced
this pull request
Jul 6, 2018
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jul 6, 2018
This comment has been minimized.
This comment has been minimized.
|
|
bors
added
S-waiting-on-review
and removed
S-waiting-on-bors
labels
Jul 6, 2018
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
1 similar comment
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
This comment has been minimized.
This comment has been minimized.
bors
added
S-waiting-on-bors
and removed
S-waiting-on-review
labels
Jul 6, 2018
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jul 6, 2018
This comment has been minimized.
This comment has been minimized.
|
|
japaric commentedJun 30, 2018
•
edited
closes #45085
as proposed in #45085 (comment)
this commit adds an
atomic_castarget option and extends the#[cfg(target_has_atomic)]attribute to enable a subset of the
Atomic*API on architectures that don't support atomic CASnatively, like MSP430 and ARMv6-M.
r? @alexcrichton