Generic Structure

SIMDMask

No overview available.

Declaration

@frozen struct SIMDMask<Storage> where Storage : SIMD, Storage.Scalar : FixedWidthInteger, Storage.Scalar : SignedInteger

Topics

Type Aliases

typealias SIMDMask.ArrayLiteralElement

The type of the elements of an array literal.

typealias SIMDMask.MaskStorage

The mask type resulting from pointwise comparisons of this vector type.

typealias SIMDMask.Scalar

The type of scalars in the vector space.

Initializers

init()

Creates a vector with zero in all lanes.

init<S>(S)

Creates a vector from the given sequence.

init(arrayLiteral: Bool...)

Creates a vector from the specified elements.

init(from: Decoder)

Creates a new vector by decoding scalars from the given decoder.

init(repeating: Bool)

A vector with the specified value in all lanes.

Instance Properties

var description: String

A textual description of the vector.

var hashValue: Int

The hash value.

var indices: Range<Int>

The valid indices for subscripting the vector.

var scalarCount: Int

The number of scalars, or elements, in the vector.

Type Properties

static var scalarCount: Int

The number of scalars, or elements, in a vector of this type.

Instance Methods

func encode(to: Encoder)

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: Bool, where: SIMDMask<Storage>)

Replaces elements of this vector with other in the lanes where mask is true.

func replace(with: SIMDMask<Storage>, where: SIMDMask<Storage>)

Replaces elements of this vector with elements of other in the lanes where mask is true.

func replacing(with: Bool, where: SIMDMask<Storage>) -> SIMDMask<Storage>

Returns a copy of this vector, with elements other in the lanes where mask is true.

func replacing(with: SIMDMask<Storage>, where: SIMDMask<Storage>) -> SIMDMask<Storage>

Returns a copy of this vector, with elements replaced by elements of other in the lanes where mask is true.

Type Methods

static func random() -> SIMDMask<Storage>

Returns a vector mask with true or false randomly assigned in each lane.

static func random<T>(using: inout T) -> SIMDMask<Storage>

Returns a vector mask with true or false randomly assigned in each lane, using the given generator as a source for randomness.

Subscripts

subscript(Int) -> Bool

Accesses the element at the specified index.

subscript<Index>(SIMD2<Index>) -> SIMD2<Bool>

Extracts the scalars at specified indices to form a SIMD2.

subscript<Index>(SIMD3<Index>) -> SIMD3<Bool>

Extracts the scalars at specified indices to form a SIMD3.

subscript<Index>(SIMD4<Index>) -> SIMD4<Bool>

Extracts the scalars at specified indices to form a SIMD4.

subscript<Index>(SIMD8<Index>) -> SIMD8<Bool>

Extracts the scalars at specified indices to form a SIMD8.

subscript<Index>(SIMD16<Index>) -> SIMD16<Bool>

Extracts the scalars at specified indices to form a SIMD16.

subscript<Index>(SIMD32<Index>) -> SIMD32<Bool>

Extracts the scalars at specified indices to form a SIMD32.

subscript<Index>(SIMD64<Index>) -> SIMD64<Bool>

Extracts the scalars at specified indices to form a SIMD64.

Operator Functions

static func .!= (Bool, SIMDMask<Storage>) -> SIMDMask<Storage>

Returns a vector mask with the result of a pointwise inequality comparison.

static func .!= (SIMDMask<Storage>, Bool) -> SIMDMask<Storage>

Returns a vector mask with the result of a pointwise inequality comparison.

static func .!= (SIMDMask<Storage>, SIMDMask<Storage>) -> SIMDMask<Storage>

Returns a vector mask with the result of a pointwise inequality comparison.

static func .== (Bool, SIMDMask<Storage>) -> SIMDMask<Storage>

Returns a vector mask with the result of a pointwise equality comparison.

static func .== (SIMDMask<Storage>, Bool) -> SIMDMask<Storage>

Returns a vector mask with the result of a pointwise equality comparison.

static func .== (SIMDMask<Storage>, SIMDMask<Storage>) -> SIMDMask<Storage>

Returns a vector mask with the result of a pointwise equality comparison.

static func == (SIMDMask<Storage>, SIMDMask<Storage>) -> Bool

Returns a Boolean value indicating whether two vectors are equal.

Relationships

Conforms To

See Also

Supporting Types

protocol SIMD

A SIMD vector of a fixed number of elements.

protocol SIMDScalar

A type that can be used as an element in a SIMD vector.

protocol SIMDStorage

A type that can function as storage for a SIMD vector type.