Instance Subscript (Default implementation)swift 6.0.1Swift
subscript(_:)
Extracts the scalars at specified indices to form a SIMD8.
subscript<Index>(index: SIMD8<Index>) -> SIMD8<Self.Scalar> where Index : FixedWidthInteger, Index : SIMDScalar, Self.Scalar : SIMDScalar { get }
The elements of the index vector are wrapped modulo the count of elements in this vector. Because of this, the index is always in-range and no trap can occur.
Implements
subscript(Int
) -> Self.Scalar Accesses the element at the specified index.
Other members in extension
Type members
init<S>(S
) Creates a vector from the given sequence.
init(arrayLiteral: Self.Scalar...
) Creates a vector from the specified elements.
init(from: any Decoder
) throws Creates a new vector by decoding scalars from the given decoder.
init(repeating: Self.Scalar
) A vector with the specified value in all lanes.
static func .!= (a: Self.Scalar, b: Self
) -> SIMDMask<Self.MaskStorage> Returns a vector mask with the result of a pointwise inequality comparison.
static func .!= (a: Self, b: Self.Scalar
) -> SIMDMask<Self.MaskStorage> Returns a vector mask with the result of a pointwise inequality comparison.
static func .!= (a: Self, b: Self
) -> SIMDMask<Self.MaskStorage> A vector mask with the result of a pointwise inequality comparison.
static func .== (a: Self.Scalar, b: Self
) -> SIMDMask<Self.MaskStorage> Returns a vector mask with the result of a pointwise equality comparison.
static func .== (a: Self, b: Self.Scalar
) -> SIMDMask<Self.MaskStorage> Returns a vector mask with the result of a pointwise equality comparison.
static func .== (a: Self, b: Self
) -> SIMDMask<Self.MaskStorage> A vector mask with the result of a pointwise equality comparison.
static func == (a: Self, b: Self
) -> Bool Returns a Boolean value indicating whether two vectors are equal.
Instance members
var description: String
A textual description of the vector.
var indices: Range<Int>
The valid indices for subscripting the vector.
subscript<Index>(SIMD2<Index>
) -> SIMD2<Self.Scalar> Extracts the scalars at specified indices to form a SIMD2.
subscript<Index>(SIMD3<Index>
) -> SIMD3<Self.Scalar> Extracts the scalars at specified indices to form a SIMD3.
subscript<Index>(SIMD4<Index>
) -> SIMD4<Self.Scalar> Extracts the scalars at specified indices to form a SIMD4.
subscript<Index>(SIMD16<Index>
) -> SIMD16<Self.Scalar> Extracts the scalars at specified indices to form a SIMD16.
subscript<Index>(SIMD32<Index>
) -> SIMD32<Self.Scalar> Extracts the scalars at specified indices to form a SIMD32.
subscript<Index>(SIMD64<Index>
) -> SIMD64<Self.Scalar> Extracts the scalars at specified indices to form a SIMD64.
func encode(to: any Encoder
) throws Encodes the scalars of this vector into the given encoder in an unkeyed container.
func hash(into: inout Hasher
) Hashes the elements of the vector using the given hasher.
func replace(with: Self.Scalar, where: SIMDMask<Self.MaskStorage>
) Replaces elements of this vector with
other
in the lanes wheremask
istrue
.func replace(with: Self, where: SIMDMask<Self.MaskStorage>
) Replaces elements of this vector with elements of
other
in the lanes wheremask
istrue
.func replacing(with: Self.Scalar, where: SIMDMask<Self.MaskStorage>
) -> Self Returns a copy of this vector, with elements
other
in the lanes wheremask
istrue
.func replacing(with: Self, where: SIMDMask<Self.MaskStorage>
) -> Self Returns a copy of this vector, with elements replaced by elements of
other
in the lanes wheremask
istrue
.