//! Synchronisation primitives and memory barriers for Apple Silicon.
//!
//! Provides lightweight wrappers around ARM barrier instructions,
//! core-affinity via macOS QoS classes, and data prefetch hints.
// ---------------------------------------------------------------------------
// Memory barriers
// ---------------------------------------------------------------------------
/// Data Memory Barrier โ Inner Shareable domain.
///
/// Ensures all explicit data memory accesses before the barrier are
/// observed before any explicit data memory accesses after the barrier,
/// within the inner-shareable domain (same cluster).
///
/// # Safety
///
/// Barrier instructions do not access memory themselves, but mis-placed
/// barriers can hide data races. The caller must understand the intended
/// ordering guarantee.
pub unsafe
/// Data Synchronization Barrier โ Inner Shareable domain.
///
/// Stronger than DMB: also waits for all cache-maintenance, TLB,
/// and branch-predictor maintenance operations to complete.
///
/// # Safety
///
/// See [`barrier`].
pub unsafe
/// Instruction Synchronization Barrier.
///
/// Flushes the pipeline and ensures all subsequent instructions are
/// fetched from cache or memory after the barrier completes.
///
/// # Safety
///
/// See [`barrier`].
pub unsafe
/// Wait For Event.
///
/// Places the PE into a low-power state until an event is signalled
/// (via SEV, interrupt, or debug event).
///
/// # Safety
///
/// Must only be used in contexts where stalling the core is acceptable.
pub unsafe
/// Signal Event.
///
/// Sends an event to all PEs in the inner-shareable domain, waking
/// any core that is in WFE state.
///
/// # Safety
///
/// Benign in isolation, but incorrect pairing with [`wait`] can cause
/// live-locks or missed wake-ups.
pub unsafe
Homonyms
cyb/evy/forks/naga/src/back/hlsl/mod.rs
struct Baz { m: mat3x2, } struct Baz { float2 m_0; float2 m_1; float2 m_2; }; float3x2 GetMatmOnBaz(Baz obj) { return float3x2(obj.m_0, obj.m_1, obj.m_2); }