@@ -34,7 +34,7 @@ use stdarch_test::assert_instr;
34
34
/// support `cmpxchg16b` and the program enters an execution path that
35
35
/// eventually would reach this function the behavior is undefined.
36
36
///
37
- /// The `success` ordering must also be stronger or equal to `failure` , or this
37
+ /// The failure ordering must be [`SeqCst`], [`Acquire`] or [`Relaxed`] , or this
38
38
/// function call is undefined. See the `Atomic*` documentation's
39
39
/// `compare_exchange` function for more information. When `compare_exchange`
40
40
/// panics, this is undefined behavior. Currently this function aborts the
@@ -54,15 +54,21 @@ pub unsafe fn cmpxchg16b(
54
54
debug_assert ! ( dst as usize % 16 == 0 ) ;
55
55
56
56
let ( val, _ok) = match ( success, failure) {
57
- ( Acquire , Acquire ) => intrinsics:: atomic_cxchg_acquire_acquire ( dst, old, new) ,
58
- ( Release , Relaxed ) => intrinsics:: atomic_cxchg_release_relaxed ( dst, old, new) ,
59
- ( AcqRel , Acquire ) => intrinsics:: atomic_cxchg_acqrel_acquire ( dst, old, new) ,
60
57
( Relaxed , Relaxed ) => intrinsics:: atomic_cxchg_relaxed_relaxed ( dst, old, new) ,
61
- ( SeqCst , SeqCst ) => intrinsics:: atomic_cxchg_seqcst_seqcst ( dst, old, new) ,
58
+ ( Relaxed , Acquire ) => intrinsics:: atomic_cxchg_relaxed_acquire ( dst, old, new) ,
59
+ ( Relaxed , SeqCst ) => intrinsics:: atomic_cxchg_relaxed_seqcst ( dst, old, new) ,
62
60
( Acquire , Relaxed ) => intrinsics:: atomic_cxchg_acquire_relaxed ( dst, old, new) ,
61
+ ( Acquire , Acquire ) => intrinsics:: atomic_cxchg_acquire_acquire ( dst, old, new) ,
62
+ ( Acquire , SeqCst ) => intrinsics:: atomic_cxchg_acquire_seqcst ( dst, old, new) ,
63
+ ( Release , Relaxed ) => intrinsics:: atomic_cxchg_release_relaxed ( dst, old, new) ,
64
+ ( Release , Acquire ) => intrinsics:: atomic_cxchg_release_acquire ( dst, old, new) ,
65
+ ( Release , SeqCst ) => intrinsics:: atomic_cxchg_release_seqcst ( dst, old, new) ,
63
66
( AcqRel , Relaxed ) => intrinsics:: atomic_cxchg_acqrel_relaxed ( dst, old, new) ,
67
+ ( AcqRel , Acquire ) => intrinsics:: atomic_cxchg_acqrel_acquire ( dst, old, new) ,
68
+ ( AcqRel , SeqCst ) => intrinsics:: atomic_cxchg_acqrel_seqcst ( dst, old, new) ,
64
69
( SeqCst , Relaxed ) => intrinsics:: atomic_cxchg_seqcst_relaxed ( dst, old, new) ,
65
70
( SeqCst , Acquire ) => intrinsics:: atomic_cxchg_seqcst_acquire ( dst, old, new) ,
71
+ ( SeqCst , SeqCst ) => intrinsics:: atomic_cxchg_seqcst_seqcst ( dst, old, new) ,
66
72
67
73
// The above block is all copied from libcore, and this statement is
68
74
// also copied from libcore except that it's a panic in libcore and we
0 commit comments