@@ -77,40 +77,40 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
77
77
this. atomic_compare_exchange_weak ( args, dest, rw_ord ( ord1) ?, read_ord ( ord2) ?) ?,
78
78
79
79
[ "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) ?) ?,
81
81
[ "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) ?) ?,
83
83
[ "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) ?) ?,
85
85
[ "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) ?) ?,
87
87
[ "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) ?) ?,
89
89
[ "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) ?) ?,
91
91
[ "min" , ord] => {
92
92
// Later we will use the type to indicate signed vs unsigned,
93
93
// so make sure it matches the intrinsic name.
94
94
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) ?) ?;
96
96
}
97
97
[ "umin" , ord] => {
98
98
// Later we will use the type to indicate signed vs unsigned,
99
99
// so make sure it matches the intrinsic name.
100
100
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) ?) ?;
102
102
}
103
103
[ "max" , ord] => {
104
104
// Later we will use the type to indicate signed vs unsigned,
105
105
// so make sure it matches the intrinsic name.
106
106
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) ?) ?;
108
108
}
109
109
[ "umax" , ord] => {
110
110
// Later we will use the type to indicate signed vs unsigned,
111
111
// so make sure it matches the intrinsic name.
112
112
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) ?) ?;
114
114
}
115
115
116
116
_ => throw_unsup_format ! ( "unimplemented intrinsic: `atomic_{intrinsic_name}`" ) ,
@@ -178,7 +178,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
178
178
Ok ( ( ) )
179
179
}
180
180
181
- fn atomic_op (
181
+ fn atomic_rmw_op (
182
182
& mut self ,
183
183
args : & [ OpTy < ' tcx , Provenance > ] ,
184
184
dest : & PlaceTy < ' tcx , Provenance > ,
@@ -213,7 +213,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
213
213
Ok ( ( ) )
214
214
}
215
215
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) ?;
217
217
this. write_immediate ( * old, dest) ?; // old value is returned
218
218
Ok ( ( ) )
219
219
}
0 commit comments