int8x16
struct int8x16Available without an import.
A 128-bit SIMD value containing 16 int8 lanes. Arithmetic operates lane-wise, with integer overflow wrapping within each lane. Lane and WithLane require constant indices; bracket indexing supports checked runtime indices. Comparisons return all-one/all-zero integer masks. Bit reinterpretation involving floating-point lanes canonicalizes NaNs.
Members
Splatmethod
public static fn Splat(int8 value) : int8x16Copies one scalar value into every lane.
Zeromethod
public static fn Zero() : int8x16Returns a vector whose lanes are all zero.
constructorconstructor
public constructor (int8 l0, int8 l1, int8 l2, int8 l3, int8 l4, int8 l5, int8 l6, int8 l7, int8 l8, int8 l9, int8 l10, int8 l11, int8 l12, int8 l13, int8 l14, int8 l15)Creates a vector from scalar lanes in ascending index order.
Lanemethod
public fn Lane(int32 index) : int32Reads a compile-time constant lane index in [0, 16). Invalid or nonconstant indices are rejected; use bracket indexing for runtime indices. Sub-32-bit integer lanes widen with the type's signedness.
Minmethod
public fn Min(int8x16 other) : int8x16Selects the smaller value in each lane.
Maxmethod
public fn Max(int8x16 other) : int8x16Selects the larger value in each lane.
AddSatmethod
public fn AddSat(int8x16 other) : int8x16Adds corresponding lanes and clamps each result to this lane type's minimum/maximum instead of wrapping.
SubSatmethod
public fn SubSat(int8x16 other) : int8x16Subtracts corresponding lanes and clamps each result to this lane type's minimum/maximum instead of wrapping.
Absmethod
public fn Abs() : int8x16Returns each lane's magnitude. A minimum signed lane remains the negative minimum because its positive magnitude does not fit.
PopCountmethod
public fn PopCount() : int8x16Counts the set bits in each byte lane, producing counts from 0 to 8.
Eqmethod
public fn Eq(int8x16 other) : int8x16Compares corresponding lanes for equal, returning all-one bits for true and all-zero bits for false. Ordered comparisons use the lane type's signedness.
Nemethod
public fn Ne(int8x16 other) : int8x16Compares corresponding lanes for unequal, returning all-one bits for true and all-zero bits for false. Ordered comparisons use the lane type's signedness.
Ltmethod
public fn Lt(int8x16 other) : int8x16Compares corresponding lanes for less, returning all-one bits for true and all-zero bits for false. Ordered comparisons use the lane type's signedness.
Lemethod
public fn Le(int8x16 other) : int8x16Compares corresponding lanes for less or equal, returning all-one bits for true and all-zero bits for false. Ordered comparisons use the lane type's signedness.
Gtmethod
public fn Gt(int8x16 other) : int8x16Compares corresponding lanes for greater, returning all-one bits for true and all-zero bits for false. Ordered comparisons use the lane type's signedness.
Gemethod
public fn Ge(int8x16 other) : int8x16Compares corresponding lanes for greater or equal, returning all-one bits for true and all-zero bits for false. Ordered comparisons use the lane type's signedness.
AnyTruemethod
public fn AnyTrue() : boolTests whether any lane has a nonzero bit pattern.
AllTruemethod
public fn AllTrue() : boolTests whether every lane has a nonzero bit pattern.
Bitmaskmethod
public fn Bitmask() : int32Packs each lane's most significant bit into the corresponding bit of an integer; lane zero becomes bit zero.
WithLanemethod
public fn WithLane(int32 index, int8 value) : int8x16Returns a copy with one lane replaced. The index must be a compile-time constant in [0, 16); use bracket assignment for runtime indices.
Shufflemethod
public fn Shuffle(int32 l0, int32 l1, int32 l2, int32 l3, int32 l4, int32 l5, int32 l6, int32 l7, int32 l8, int32 l9, int32 l10, int32 l11, int32 l12, int32 l13, int32 l14, int32 l15) : int8x16Returns lanes selected in argument order. Every index must be a compile-time constant in [0, 16); repeats are allowed.
Selectmethod
public fn Select(int8x16 a, int8x16 b) : int8x16Selects bits from a where this mask has one bits and from b where it has zero bits. Comparison masks select entire lanes; arbitrary masks can mix bits within a lane.
WidenLowmethod
public fn WidenLow() : int16x8Widens the low half of the lanes to twice their width, using sign extension.
WidenHighmethod
public fn WidenHigh() : int16x8Widens the high half of the lanes to twice their width, using sign extension.
WideningMulLowmethod
public fn WideningMulLow(int8x16 other) : int16x8Multiplies the low-half lane pairs, widening operands first so products fit the doubled lane width.
WideningMulHighmethod
public fn WideningMulHigh(int8x16 other) : int16x8Multiplies the high-half lane pairs, widening operands first so products fit the doubled lane width.
ReduceSummethod
public fn ReduceSum() : int32Sums every lane into the scalar result. Arithmetic wraps at the scalar result width; narrow lanes are widened before addition.
ReduceMinmethod
public fn ReduceMin() : int32Reduces all lanes to their minimum.
ReduceMaxmethod
public fn ReduceMax() : int32Reduces all lanes to their maximum.
AsUint8x16method
public fn AsUint8x16() : uint8x16Reinterprets this 128-bit value with the destination lane shape rather than converting numerically. Floating-point NaN lanes are canonicalized on either side of the reinterpretation; NaN payload bits are not preserved.
AsInt16x8method
public fn AsInt16x8() : int16x8Reinterprets this 128-bit value with the destination lane shape rather than converting numerically. Floating-point NaN lanes are canonicalized on either side of the reinterpretation; NaN payload bits are not preserved.
AsUint16x8method
public fn AsUint16x8() : uint16x8Reinterprets this 128-bit value with the destination lane shape rather than converting numerically. Floating-point NaN lanes are canonicalized on either side of the reinterpretation; NaN payload bits are not preserved.
AsInt32x4method
public fn AsInt32x4() : int32x4Reinterprets this 128-bit value with the destination lane shape rather than converting numerically. Floating-point NaN lanes are canonicalized on either side of the reinterpretation; NaN payload bits are not preserved.
AsUint32x4method
public fn AsUint32x4() : uint32x4Reinterprets this 128-bit value with the destination lane shape rather than converting numerically. Floating-point NaN lanes are canonicalized on either side of the reinterpretation; NaN payload bits are not preserved.
AsInt64x2method
public fn AsInt64x2() : int64x2Reinterprets this 128-bit value with the destination lane shape rather than converting numerically. Floating-point NaN lanes are canonicalized on either side of the reinterpretation; NaN payload bits are not preserved.
AsUint64x2method
public fn AsUint64x2() : uint64x2Reinterprets this 128-bit value with the destination lane shape rather than converting numerically. Floating-point NaN lanes are canonicalized on either side of the reinterpretation; NaN payload bits are not preserved.
AsFloat32x4method
public fn AsFloat32x4() : float32x4Reinterprets this 128-bit value with the destination lane shape rather than converting numerically. Floating-point NaN lanes are canonicalized on either side of the reinterpretation; NaN payload bits are not preserved.
AsFloat64x2method
public fn AsFloat64x2() : float64x2Reinterprets this 128-bit value with the destination lane shape rather than converting numerically. Floating-point NaN lanes are canonicalized on either side of the reinterpretation; NaN payload bits are not preserved.
Swizzlemethod
public fn Swizzle(int8x16 indices) : int8x16Selects each output byte from this vector using the corresponding runtime index byte. Indices outside [0, 16), including negative signed index bytes, produce zero.
Loadmethod
public static fn Load(Span<uint8> data, int32 byteOffset) : int8x16Reads 16 bytes starting at byteOffset as this lane type. The complete range must fit the span or the operation panics. No alignment requirement is imposed.
LoadAlignedmethod
public static fn LoadAligned(Span<uint8> data, int32 byteOffset) : int8x16Reads 16 bytes with the same bounds checks and behavior as Load. Alignment is a hint; unaligned addresses are accepted.
Storemethod
public fn Store(Span<uint8> data, int32 byteOffset) : voidWrites all 16 bytes at byteOffset. The complete range must fit the span or the operation panics. Does not resize or retain the span.
LoadElemsmethod
public static fn LoadElems(Span<int8> data, int32 elemIndex) : int8x16Reads 16 consecutive elements starting at elemIndex. The whole element range must fit or the operation panics; indices count elements, not bytes.
StoreElemsmethod
public fn StoreElems(Span<int8> data, int32 elemIndex) : voidWrites 16 consecutive elements starting at elemIndex. The whole element range must fit or the operation panics; indices count elements, not bytes.
ToStringmethod
public fn ToString() : stringProvided by the compiler.
ToStringBuffermethod
public fn ToStringBuffer(StringBuilder builder) : int32Provided by the compiler.