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 upTracking Issue: fetch_nand #13226
Comments
alexcrichton
added
the
A-libs
label
Mar 31, 2014
alexcrichton
referenced this issue
Mar 31, 2014
Closed
Add fetch_and, fetch_or, fetch_nand, fetch_xor to AtomicInt, AtomicUint #12964
alexcrichton
referenced this issue
May 6, 2014
Closed
Add remaining operations to atomic types. #7421
steveklabnik
added
the
O-android
label
Apr 28, 2015
This comment has been minimized.
This comment has been minimized.
|
Triage: i don't have android to test. |
This comment has been minimized.
This comment has been minimized.
|
Triage: same as in 2015. |
steveklabnik
added
T-libs
and removed
A-libs
labels
Mar 24, 2017
This comment has been minimized.
This comment has been minimized.
|
I unfortunately do not have an android either, and after spending multiple hours trying to get an emulator setup I have decided to not try any more... the code below I believe is the test for this problem today. If someone has a working android version, and can test it, that would be great. #![feature(core_intrinsics)]
use std::sync::atomic::{AtomicUsize, AtomicIsize};
use std::sync::atomic::Ordering::*;
use std::intrinsics::atomic_nand;
#[test]
fn uint_nand() {
let mut x = AtomicUsize::new(0xf731);
unsafe {
assert_eq!(atomic_nand(x.get_mut() as *mut usize, 0x137f), 0xf731);
}
assert_eq!(x.load(SeqCst), !(0xf731 & 0x137f));
}
#[test]
fn int_nand() {
let mut x = AtomicIsize::new(0xf731);
unsafe {
assert_eq!(atomic_nand(x.get_mut() as *mut isize, 0x137f), 0xf731);
}
assert_eq!(x.load(SeqCst), !(0xf731 & 0x137f));
} |
Mark-Simulacrum
added
the
C-feature-request
label
Jul 20, 2017
Mark-Simulacrum
added
C-bug
and removed
C-feature-request
labels
Jul 29, 2017
This comment has been minimized.
This comment has been minimized.
I've run it on android phone (
|
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton looks like we may be able to enable these on Android. |
This comment has been minimized.
This comment has been minimized.
|
Hurray! |
Mark-Simulacrum
added
C-tracking-issue
B-unstable
and removed
C-bug
O-android
labels
Feb 9, 2018
Mark-Simulacrum
changed the title
fetch_nand is not implemented for Atomic{Int,Uint}
Tracking Issue: fetch_nand
Feb 9, 2018
Mark-Simulacrum
added a commit
to Mark-Simulacrum/rust
that referenced
this issue
Feb 9, 2018
kennytm
added a commit
to kennytm/rust
that referenced
this issue
Feb 9, 2018
Mark-Simulacrum
added a commit
to Mark-Simulacrum/rust
that referenced
this issue
Feb 9, 2018
Mark-Simulacrum
added a commit
to Mark-Simulacrum/rust
that referenced
this issue
Feb 9, 2018
kennytm
added a commit
to kennytm/rust
that referenced
this issue
Feb 10, 2018
This comment has been minimized.
This comment has been minimized.
|
It looks like the only issue (incorrect behavior on Android) has been resolved. @rfcbot fcp merge |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Mar 17, 2018
•
|
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Mar 18, 2018
|
|
rfcbot
removed
the
proposed-final-comment-period
label
Mar 18, 2018
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Mar 28, 2018
|
The final comment period is now complete. |
alexcrichton commentedMar 31, 2014
•
edited by Mark-Simulacrum
Tracking issue for
fetch_nandon integer atomics (it's stable forbool).On android, it appears that these functions give the wrong answer. See #12964 (comment) for some analysis, and the relevant logs are:
#[test] fn uint_nand() { let x = AtomicUint::new(0xf731); assert_eq!(x.fetch_nand(0x137f, SeqCst), 0xf731); assert_eq!(x.load(SeqCst), !(0xf731 & 0x137f)); } #[test] fn int_nand() { let x = AtomicInt::new(0xf731); assert_eq!(x.fetch_nand(0x137f, SeqCst), 0xf731); assert_eq!(x.load(SeqCst), !(0xf731 & 0x137f)); }