Skip to main content

Module vector_reg

Module vector_reg 

Source
Expand description

Module containing the generic SIMD vector register wrappers. Monomorphized SIMD vector register wrapper.

§Safety

Every operation here ultimately calls a #[target_feature]-gated SimdKernel method, sound only on a host that implements Arch. Two disciplines discharge that obligation:

  • Safe methods call assert_runtime_supported (or runtime_support_result for the try_* forms) before their unsafe kernel call, so the check immediately above each block is its target-feature proof. Those blocks therefore carry a per-site SAFETY comment only when they add a further obligation — a raw-pointer bound, a lane-index range, or a MaybeUninit initialization.
  • The pub unsafe fn register loads/stores (load_aligned and friends) push both the target-feature requirement and pointer validity to the caller; each states both in its # Safety section.

Lane-count and lane-index preconditions (from_array, extract, cast, …) are proven at compile time by the AssertLaneCount/AssertLaneIndex const guards, so a mismatch fails the build rather than reading out of bounds.

Structs§

Vector
A monomorphized vector register type wrapping the architecture-native raw register.