(
&mut self,
dst: Self::Value,
cmp: Self::Value,
src: Self::Value,
order: AtomicOrdering,
failure_order: AtomicOrdering,
_weak: bool,
)
| 2163 | } |
| 2164 | |
| 2165 | fn atomic_cmpxchg( |
| 2166 | &mut self, |
| 2167 | dst: Self::Value, |
| 2168 | cmp: Self::Value, |
| 2169 | src: Self::Value, |
| 2170 | order: AtomicOrdering, |
| 2171 | failure_order: AtomicOrdering, |
| 2172 | _weak: bool, |
| 2173 | ) -> Self::Value { |
| 2174 | let dst_pointee_ty = match self.lookup_type(dst.ty) { |
| 2175 | SpirvType::Pointer { pointee } => pointee, |
| 2176 | ty => self.fatal(&format!( |
| 2177 | "atomic_cmpxchg called on variable that wasn't a pointer: {ty:?}" |
| 2178 | )), |
| 2179 | }; |
| 2180 | assert_ty_eq!(self, dst_pointee_ty, cmp.ty); |
| 2181 | assert_ty_eq!(self, dst_pointee_ty, src.ty); |
| 2182 | self.validate_atomic(dst_pointee_ty, dst.def(self)); |
| 2183 | // TODO: Default to device scope |
| 2184 | let memory = self.constant_u32(self.span(), Scope::Device as u32); |
| 2185 | let semantics_equal = self.ordering_to_semantics_def(order); |
| 2186 | let semantics_unequal = self.ordering_to_semantics_def(failure_order); |
| 2187 | // Note: OpAtomicCompareExchangeWeak is deprecated, and has the same semantics |
| 2188 | self.emit() |
| 2189 | .atomic_compare_exchange( |
| 2190 | src.ty, |
| 2191 | None, |
| 2192 | dst.def(self), |
| 2193 | memory.def(self), |
| 2194 | semantics_equal.def(self), |
| 2195 | semantics_unequal.def(self), |
| 2196 | src.def(self), |
| 2197 | cmp.def(self), |
| 2198 | ) |
| 2199 | .unwrap() |
| 2200 | .with_type(src.ty) |
| 2201 | } |
| 2202 | |
| 2203 | fn atomic_rmw( |
| 2204 | &mut self, |
nothing calls this directly
no test coverage detected