Type casting
enigma.metal_cast(value, dtype) -> IRValue
Numeric conversion. Lowers to MSL static_cast<T>(x).
enigma.as_type(value, dtype) -> IRValue
Bitwise reinterpret. Target type must have the same bit width. Lowers to MSL
as_type<T>(x).
Vector construction
Short vectors areIRValues with dtype "vec<N,elem>" and map to Metal
floatN / halfN / intN / uintN types.
enigma.make_vec(*components) -> IRValue
Construct a vector from 2, 3, or 4 scalar components. All components must
share the same dtype.
Convenience constructors
Lane access
Geometry
All take vectorIRValues. Returns are scalar or vector as noted.
Scalar-returning
Vector-returning
Pack / unpack (color and texture formats)
Convert between float vectors and packed integer representations. These mirror MSL’spack_float_to_* / unpack_*_to_float functions used for color and
texture encoding.
For integer-only packing (uint8, int4) used in quantized GEMM, see
Quantization Helpers.
Pack: vector → uint
All take a vectorIRValue and return a uint IRValue.
Unpack: uint → vector
All take auint IRValue and return a vector IRValue.
