Prototype
pub fn atomicrmw( self: *WipFunction, access_kind: MemoryAccessKind, operation: Instruction.AtomicRmw.Operation, ptr: Value, val: Value, sync_scope: SyncScope, ordering: AtomicOrdering, alignment: Alignment, name: []const u8, ) Allocator.Error!Value
Source
pub fn atomicrmw(
self: *WipFunction,
access_kind: MemoryAccessKind,
operation: Instruction.AtomicRmw.Operation,
ptr: Value,
val: Value,
sync_scope: SyncScope,
ordering: AtomicOrdering,
alignment: Alignment,
name: []const u8,
) Allocator.Error!Value {
assert(ptr.typeOfWip(self).isPointer(self.builder));
assert(ordering != .none);
try self.ensureUnusedExtraCapacity(1, Instruction.AtomicRmw, 0);
const instruction = try self.addInst(name, .{
.tag = .atomicrmw,
.data = self.addExtraAssumeCapacity(Instruction.AtomicRmw{
.info = .{
.access_kind = access_kind,
.atomic_rmw_operation = operation,
.sync_scope = sync_scope,
.success_ordering = ordering,
.alignment = alignment,
},
.ptr = ptr,
.val = val,
}),
});
return instruction.toValue();
}