Skip to content

Commit 0b6c30a

Browse files
committed
atomic_op → atomic_rmw_op
1 parent 6212cc6 commit 0b6c30a

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/tools/miri/src/concurrency/data_race.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
558558
this.buffered_atomic_write(val, dest, atomic, val)
559559
}
560560

561-
/// Perform an atomic operation on a memory location.
562-
fn atomic_op_immediate(
561+
/// Perform an atomic RMW operation on a memory location.
562+
fn atomic_rmw_op_immediate(
563563
&mut self,
564564
place: &MPlaceTy<'tcx, Provenance>,
565565
rhs: &ImmTy<'tcx, Provenance>,

src/tools/miri/src/shims/intrinsics/atomic.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,40 +77,40 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
7777
this.atomic_compare_exchange_weak(args, dest, rw_ord(ord1)?, read_ord(ord2)?)?,
7878

7979
["or", ord] =>
80-
this.atomic_op(args, dest, AtomicOp::MirOp(BinOp::BitOr, false), rw_ord(ord)?)?,
80+
this.atomic_rmw_op(args, dest, AtomicOp::MirOp(BinOp::BitOr, false), rw_ord(ord)?)?,
8181
["xor", ord] =>
82-
this.atomic_op(args, dest, AtomicOp::MirOp(BinOp::BitXor, false), rw_ord(ord)?)?,
82+
this.atomic_rmw_op(args, dest, AtomicOp::MirOp(BinOp::BitXor, false), rw_ord(ord)?)?,
8383
["and", ord] =>
84-
this.atomic_op(args, dest, AtomicOp::MirOp(BinOp::BitAnd, false), rw_ord(ord)?)?,
84+
this.atomic_rmw_op(args, dest, AtomicOp::MirOp(BinOp::BitAnd, false), rw_ord(ord)?)?,
8585
["nand", ord] =>
86-
this.atomic_op(args, dest, AtomicOp::MirOp(BinOp::BitAnd, true), rw_ord(ord)?)?,
86+
this.atomic_rmw_op(args, dest, AtomicOp::MirOp(BinOp::BitAnd, true), rw_ord(ord)?)?,
8787
["xadd", ord] =>
88-
this.atomic_op(args, dest, AtomicOp::MirOp(BinOp::Add, false), rw_ord(ord)?)?,
88+
this.atomic_rmw_op(args, dest, AtomicOp::MirOp(BinOp::Add, false), rw_ord(ord)?)?,
8989
["xsub", ord] =>
90-
this.atomic_op(args, dest, AtomicOp::MirOp(BinOp::Sub, false), rw_ord(ord)?)?,
90+
this.atomic_rmw_op(args, dest, AtomicOp::MirOp(BinOp::Sub, false), rw_ord(ord)?)?,
9191
["min", ord] => {
9292
// Later we will use the type to indicate signed vs unsigned,
9393
// so make sure it matches the intrinsic name.
9494
assert!(matches!(args[1].layout.ty.kind(), ty::Int(_)));
95-
this.atomic_op(args, dest, AtomicOp::Min, rw_ord(ord)?)?;
95+
this.atomic_rmw_op(args, dest, AtomicOp::Min, rw_ord(ord)?)?;
9696
}
9797
["umin", ord] => {
9898
// Later we will use the type to indicate signed vs unsigned,
9999
// so make sure it matches the intrinsic name.
100100
assert!(matches!(args[1].layout.ty.kind(), ty::Uint(_)));
101-
this.atomic_op(args, dest, AtomicOp::Min, rw_ord(ord)?)?;
101+
this.atomic_rmw_op(args, dest, AtomicOp::Min, rw_ord(ord)?)?;
102102
}
103103
["max", ord] => {
104104
// Later we will use the type to indicate signed vs unsigned,
105105
// so make sure it matches the intrinsic name.
106106
assert!(matches!(args[1].layout.ty.kind(), ty::Int(_)));
107-
this.atomic_op(args, dest, AtomicOp::Max, rw_ord(ord)?)?;
107+
this.atomic_rmw_op(args, dest, AtomicOp::Max, rw_ord(ord)?)?;
108108
}
109109
["umax", ord] => {
110110
// Later we will use the type to indicate signed vs unsigned,
111111
// so make sure it matches the intrinsic name.
112112
assert!(matches!(args[1].layout.ty.kind(), ty::Uint(_)));
113-
this.atomic_op(args, dest, AtomicOp::Max, rw_ord(ord)?)?;
113+
this.atomic_rmw_op(args, dest, AtomicOp::Max, rw_ord(ord)?)?;
114114
}
115115

116116
_ => throw_unsup_format!("unimplemented intrinsic: `atomic_{intrinsic_name}`"),
@@ -178,7 +178,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
178178
Ok(())
179179
}
180180

181-
fn atomic_op(
181+
fn atomic_rmw_op(
182182
&mut self,
183183
args: &[OpTy<'tcx, Provenance>],
184184
dest: &PlaceTy<'tcx, Provenance>,
@@ -213,7 +213,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
213213
Ok(())
214214
}
215215
AtomicOp::MirOp(op, neg) => {
216-
let old = this.atomic_op_immediate(&place, &rhs, op, neg, atomic)?;
216+
let old = this.atomic_rmw_op_immediate(&place, &rhs, op, neg, atomic)?;
217217
this.write_immediate(*old, dest)?; // old value is returned
218218
Ok(())
219219
}

0 commit comments

Comments
 (0)