Function storeAtomic [src]

Prototype

pub fn storeAtomic( self: *WipFunction, access_kind: MemoryAccessKind, val: Value, ptr: Value, sync_scope: SyncScope, ordering: AtomicOrdering, alignment: Alignment, ) Allocator.Error!Instruction.Index

Parameters

self: *WipFunctionaccess_kind: MemoryAccessKindval: Valueptr: Valuesync_scope: SyncScopeordering: AtomicOrderingalignment: Alignment

Source

pub fn storeAtomic( self: *WipFunction, access_kind: MemoryAccessKind, val: Value, ptr: Value, sync_scope: SyncScope, ordering: AtomicOrdering, alignment: Alignment, ) Allocator.Error!Instruction.Index { assert(ptr.typeOfWip(self).isPointer(self.builder)); try self.ensureUnusedExtraCapacity(1, Instruction.Store, 0); const instruction = try self.addInst(null, .{ .tag = switch (ordering) { .none => .store, else => .@"store atomic", }, .data = self.addExtraAssumeCapacity(Instruction.Store{ .info = .{ .access_kind = access_kind, .sync_scope = switch (ordering) { .none => .system, else => sync_scope, }, .success_ordering = ordering, .alignment = alignment, }, .val = val, .ptr = ptr, }), }); return instruction; }