Function loadAtomic [src]

Prototype

pub fn loadAtomic( self: *WipFunction, access_kind: MemoryAccessKind, ty: Type, ptr: Value, sync_scope: SyncScope, ordering: AtomicOrdering, alignment: Alignment, name: []const u8, ) Allocator.Error!Value

Parameters

self: *WipFunctionaccess_kind: MemoryAccessKindty: Typeptr: Valuesync_scope: SyncScopeordering: AtomicOrderingalignment: Alignmentname: []const u8

Source

pub fn loadAtomic( self: *WipFunction, access_kind: MemoryAccessKind, ty: Type, ptr: Value, sync_scope: SyncScope, ordering: AtomicOrdering, alignment: Alignment, name: []const u8, ) Allocator.Error!Value { assert(ptr.typeOfWip(self).isPointer(self.builder)); try self.ensureUnusedExtraCapacity(1, Instruction.Load, 0); const instruction = try self.addInst(name, .{ .tag = switch (ordering) { .none => .load, else => .@"load atomic", }, .data = self.addExtraAssumeCapacity(Instruction.Load{ .info = .{ .access_kind = access_kind, .sync_scope = switch (ordering) { .none => .system, else => sync_scope, }, .success_ordering = ordering, .alignment = alignment, }, .type = ty, .ptr = ptr, }), }); return instruction.toValue(); }