Skip to content

Commit

Permalink
Regenerate sources
Browse files Browse the repository at this point in the history
  • Loading branch information
lorentey committed Jul 27, 2023
1 parent 6c53582 commit 7d4c7d8
Show file tree
Hide file tree
Showing 27 changed files with 2,174 additions and 4,128 deletions.
110 changes: 110 additions & 0 deletions Sources/Atomics/autogenerated/AtomicBool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,116 @@ extension Bool.AtomicRepresentation {
}
}

extension Atomic where Value == Bool {
/// Perform an atomic logical AND operation and return the original value, applying
/// the specified memory ordering.
///
/// - Parameter operand: A boolean value.
/// - Parameter ordering: The memory ordering to apply on this operation.
/// - Returns: The original value before the operation.
@_semantics("atomics.requires_constant_orderings")
@_transparent @_alwaysEmitIntoClient
public func loadThenLogicalAnd(
with operand: Value,
ordering: AtomicUpdateOrdering
) -> Value {
Value.AtomicRepresentation.atomicLoadThenLogicalAnd(
with: operand,
at: _ptr,
ordering: ordering)
}
/// Perform an atomic logical OR operation and return the original value, applying
/// the specified memory ordering.
///
/// - Parameter operand: A boolean value.
/// - Parameter ordering: The memory ordering to apply on this operation.
/// - Returns: The original value before the operation.
@_semantics("atomics.requires_constant_orderings")
@_transparent @_alwaysEmitIntoClient
public func loadThenLogicalOr(
with operand: Value,
ordering: AtomicUpdateOrdering
) -> Value {
Value.AtomicRepresentation.atomicLoadThenLogicalOr(
with: operand,
at: _ptr,
ordering: ordering)
}
/// Perform an atomic logical XOR operation and return the original value, applying
/// the specified memory ordering.
///
/// - Parameter operand: A boolean value.
/// - Parameter ordering: The memory ordering to apply on this operation.
/// - Returns: The original value before the operation.
@_semantics("atomics.requires_constant_orderings")
@_transparent @_alwaysEmitIntoClient
public func loadThenLogicalXor(
with operand: Value,
ordering: AtomicUpdateOrdering
) -> Value {
Value.AtomicRepresentation.atomicLoadThenLogicalXor(
with: operand,
at: _ptr,
ordering: ordering)
}
}

extension Atomic where Value == Bool {
/// Perform an atomic logical AND operation and return the original value, applying
/// the specified memory ordering.
///
/// - Parameter operand: A boolean value.
/// - Parameter ordering: The memory ordering to apply on this operation.
/// - Returns: The original value before the operation.
@_semantics("atomics.requires_constant_orderings")
@_transparent @_alwaysEmitIntoClient
public func logicalAndThenLoad(
with operand: Value,
ordering: AtomicUpdateOrdering
) -> Value {
let original = Value.AtomicRepresentation.atomicLoadThenLogicalAnd(
with: operand,
at: _ptr,
ordering: ordering)
return original && operand
}
/// Perform an atomic logical OR operation and return the original value, applying
/// the specified memory ordering.
///
/// - Parameter operand: A boolean value.
/// - Parameter ordering: The memory ordering to apply on this operation.
/// - Returns: The original value before the operation.
@_semantics("atomics.requires_constant_orderings")
@_transparent @_alwaysEmitIntoClient
public func logicalOrThenLoad(
with operand: Value,
ordering: AtomicUpdateOrdering
) -> Value {
let original = Value.AtomicRepresentation.atomicLoadThenLogicalOr(
with: operand,
at: _ptr,
ordering: ordering)
return original || operand
}
/// Perform an atomic logical XOR operation and return the original value, applying
/// the specified memory ordering.
///
/// - Parameter operand: A boolean value.
/// - Parameter ordering: The memory ordering to apply on this operation.
/// - Returns: The original value before the operation.
@_semantics("atomics.requires_constant_orderings")
@_transparent @_alwaysEmitIntoClient
public func logicalXorThenLoad(
with operand: Value,
ordering: AtomicUpdateOrdering
) -> Value {
let original = Value.AtomicRepresentation.atomicLoadThenLogicalXor(
with: operand,
at: _ptr,
ordering: ordering)
return original != operand
}
}
extension UnsafeAtomic where Value == Bool {
/// Perform an atomic logical AND operation and return the original value, applying
/// the specified memory ordering.
Expand Down
Loading

0 comments on commit 7d4c7d8

Please sign in to comment.