Generic Structure

SIMD8

A vector of eight scalar values.

Declaration

@frozen struct SIMD8<Scalar> where Scalar : SIMDScalar

Topics

Type Aliases

typealias SIMD8.ArrayLiteralElement

The type of the elements of an array literal.

Beta
typealias SIMD8.MaskStorage

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

Initializers

init()

Creates a vector with zero in all lanes.

init<S>(S)

Creates a vector from the given sequence.

init<Other>(SIMD8<Other>)

Creates a new vector from the given vector of floating-point values.

init<Other>(SIMD8<Other>)

Creates a new vector from the given vector of integers.

init<Other>(SIMD8<Other>, rounding: FloatingPointRoundingRule)

Creates a new vector from the given vector, rounding the given vector’s of elements using the specified rounding rule.

init(arrayLiteral: Scalar...)

Creates a vector from the specified elements.

init<Other>(clamping: SIMD8<Other>)

Creates a new vector from the given vector, clamping the values of the given vector’s elements if necessary.

init(from: Decoder)

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

init(lowHalf: SIMD4<Scalar>, highHalf: SIMD4<Scalar>)

Creates a new vector from two half-length vectors.

init(repeating: Scalar)

A vector with the specified value in all lanes.

init<Other>(truncatingIfNeeded: SIMD8<Other>)

Creates a new vector from the given vector, truncating the bit patterns of the given vector’s elements if necessary.

Instance Properties

var debugDescription: String

A textual representation of this instance, suitable for debugging.

var description: String

A textual description of the vector.

var evenHalf: SIMD4<Scalar>

A half-length vector made up of the even elements of the vector.

var hashValue: Int

The hash value.

Beta
var highHalf: SIMD4<Scalar>

A half-length vector made up of the high elements of the vector.

var indices: Range<Int>

The valid indices for subscripting the vector.

var leadingZeroBitCount: SIMD8<Scalar>
var lowHalf: SIMD4<Scalar>

A half-length vector made up of the low elements of the vector.

var nonzeroBitCount: SIMD8<Scalar>
var oddHalf: SIMD4<Scalar>

A half-length vector made up of the odd elements of the vector.

var scalarCount: Int

The number of scalars in the vector.

var trailingZeroBitCount: SIMD8<Scalar>

Type Properties

static var one: SIMD8<Scalar>

A vector with one in all lanes.

Beta
static var one: SIMD8<Scalar>

A vector with one in all lanes.

Beta
static var scalarCount: Int

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

Beta
static var zero: SIMD8<Scalar>

A vector with zero in all lanes.

static var zero: SIMD8<Scalar>

A vector with zero in all lanes.

Instance Methods

func addProduct(Scalar, SIMD8<Scalar>)
func addProduct(SIMD8<Scalar>, Scalar)
func addProduct(SIMD8<Scalar>, SIMD8<Scalar>)
func addingProduct(Scalar, SIMD8<Scalar>) -> SIMD8<Scalar>
func addingProduct(SIMD8<Scalar>, Scalar) -> SIMD8<Scalar>
func addingProduct(SIMD8<Scalar>, SIMD8<Scalar>) -> SIMD8<Scalar>
func clamp(lowerBound: SIMD8<Scalar>, upperBound: SIMD8<Scalar>)
Beta
func clamp(lowerBound: SIMD8<Scalar>, upperBound: SIMD8<Scalar>)
Beta
func encode(to: Encoder)

Encodes the scalars of this vector into the given encoder in an unkeyed container.

func formSquareRoot()
func hash(into: inout Hasher)

Hashes the elements of the vector using the given hasher.

func max() -> Scalar

Returns the greatest scalar in the vector.

Beta
func max() -> Scalar

The greatest element in the vector.

Beta
func min() -> Scalar

Returns the least scalar in the vector.

Beta
func min() -> Scalar

The least element in the vector.

Beta
func replace(with: Scalar, where: SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>)

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

func replace(with: SIMD8<Scalar>, where: SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>)

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

func replacing(with: Scalar, where: SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>) -> SIMD8<Scalar>

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

func replacing(with: SIMD8<Scalar>, where: SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>) -> SIMD8<Scalar>

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

func round(FloatingPointRoundingRule)
func rounded(FloatingPointRoundingRule) -> SIMD8<Scalar>
func squareRoot() -> SIMD8<Scalar>
func sum() -> Scalar

Returns the sum of the scalars in the vector.

Beta
func wrappedSum() -> Scalar

Returns the sum of the scalars in the vector, computed with wrapping addition.

Beta

Type Methods

static func random(in: ClosedRange<Scalar>) -> SIMD8<Scalar>

Returns a vector with random values from within the specified range in all lanes.

static func random(in: Range<Scalar>) -> SIMD8<Scalar>

Returns a vector with random values from within the specified range in all lanes.

static func random(in: ClosedRange<Scalar>) -> SIMD8<Scalar>

Returns a vector with random values from within the specified range in all lanes.

static func random(in: Range<Scalar>) -> SIMD8<Scalar>

Returns a vector with random values from within the specified range in all lanes.

static func random<T>(in: ClosedRange<Scalar>, using: inout T) -> SIMD8<Scalar>

Returns a vector with random values from within the specified range in all lanes, using the given generator as a source for randomness.

static func random<T>(in: Range<Scalar>, using: inout T) -> SIMD8<Scalar>

Returns a vector with random values from within the specified range in all lanes, using the given generator as a source for randomness.

static func random<T>(in: ClosedRange<Scalar>, using: inout T) -> SIMD8<Scalar>

Returns a vector with random values from within the specified range in all lanes, using the given generator as a source for randomness.

static func random<T>(in: Range<Scalar>, using: inout T) -> SIMD8<Scalar>

Returns a vector with random values from within the specified range in all lanes, using the given generator as a source for randomness.

Subscripts

subscript(Int) -> Scalar

Accesses the scalar at the specified position.

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

Extracts the scalars at specified indices to form a SIMD2.

Beta
subscript<Index>(SIMD3<Index>) -> SIMD3<Scalar>

Extracts the scalars at specified indices to form a SIMD3.

Beta
subscript<Index>(SIMD4<Index>) -> SIMD4<Scalar>

Extracts the scalars at specified indices to form a SIMD4.

Beta
subscript<Index>(SIMD8<Index>) -> SIMD8<Scalar>

Extracts the scalars at specified indices to form a SIMD8.

Beta
subscript<Index>(SIMD16<Index>) -> SIMD16<Scalar>

Extracts the scalars at specified indices to form a SIMD16.

Beta
subscript<Index>(SIMD32<Index>) -> SIMD32<Scalar>

Extracts the scalars at specified indices to form a SIMD32.

Beta
subscript<Index>(SIMD64<Index>) -> SIMD64<Scalar>

Extracts the scalars at specified indices to form a SIMD64.

Beta

Operator Functions

static func % (Scalar, SIMD8<Scalar>) -> SIMD8<Scalar>
static func % (SIMD8<Scalar>, Scalar) -> SIMD8<Scalar>
static func % (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMD8<Scalar>
static func %= (inout SIMD8<Scalar>, Scalar)
static func %= (inout SIMD8<Scalar>, SIMD8<Scalar>)
static func & (Scalar, SIMD8<Scalar>) -> SIMD8<Scalar>
static func & (SIMD8<Scalar>, Scalar) -> SIMD8<Scalar>
static func & (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMD8<Scalar>
static func &* (Scalar, SIMD8<Scalar>) -> SIMD8<Scalar>
static func &* (SIMD8<Scalar>, Scalar) -> SIMD8<Scalar>
static func &* (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMD8<Scalar>
static func &*= (inout SIMD8<Scalar>, Scalar)
static func &*= (inout SIMD8<Scalar>, SIMD8<Scalar>)
static func &+ (Scalar, SIMD8<Scalar>) -> SIMD8<Scalar>
static func &+ (SIMD8<Scalar>, Scalar) -> SIMD8<Scalar>
static func &+ (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMD8<Scalar>
static func &+= (inout SIMD8<Scalar>, Scalar)
static func &+= (inout SIMD8<Scalar>, SIMD8<Scalar>)
static func &- (Scalar, SIMD8<Scalar>) -> SIMD8<Scalar>
static func &- (SIMD8<Scalar>, Scalar) -> SIMD8<Scalar>
static func &- (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMD8<Scalar>
static func &-= (inout SIMD8<Scalar>, Scalar)
static func &-= (inout SIMD8<Scalar>, SIMD8<Scalar>)
static func &<< (Scalar, SIMD8<Scalar>) -> SIMD8<Scalar>
static func &<< (SIMD8<Scalar>, Scalar) -> SIMD8<Scalar>
static func &<< (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMD8<Scalar>
static func &<<= (inout SIMD8<Scalar>, Scalar)
static func &<<= (inout SIMD8<Scalar>, SIMD8<Scalar>)
static func &= (inout SIMD8<Scalar>, Scalar)
static func &= (inout SIMD8<Scalar>, SIMD8<Scalar>)
static func &>> (Scalar, SIMD8<Scalar>) -> SIMD8<Scalar>
static func &>> (SIMD8<Scalar>, Scalar) -> SIMD8<Scalar>
static func &>> (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMD8<Scalar>
static func &>>= (inout SIMD8<Scalar>, Scalar)
static func &>>= (inout SIMD8<Scalar>, SIMD8<Scalar>)
static func * (Scalar, SIMD8<Scalar>) -> SIMD8<Scalar>
static func * (SIMD8<Scalar>, Scalar) -> SIMD8<Scalar>
static func * (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMD8<Scalar>
static func *= (inout SIMD8<Scalar>, Scalar)
static func *= (inout SIMD8<Scalar>, SIMD8<Scalar>)
static func + (Scalar, SIMD8<Scalar>) -> SIMD8<Scalar>
static func + (SIMD8<Scalar>, Scalar) -> SIMD8<Scalar>
static func + (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMD8<Scalar>
static func += (inout SIMD8<Scalar>, Scalar)
static func += (inout SIMD8<Scalar>, SIMD8<Scalar>)
static func - (SIMD8<Scalar>) -> SIMD8<Scalar>
static func - (Scalar, SIMD8<Scalar>) -> SIMD8<Scalar>
static func - (SIMD8<Scalar>, Scalar) -> SIMD8<Scalar>
static func - (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMD8<Scalar>
static func -= (inout SIMD8<Scalar>, Scalar)
static func -= (inout SIMD8<Scalar>, SIMD8<Scalar>)
static func .!= (Scalar, SIMD8<Scalar>) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

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

static func .!= (SIMD8<Scalar>, Scalar) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

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

static func .!= (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

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

static func .< (Scalar, SIMD8<Scalar>) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

Returns a vector mask with the result of a pointwise less than comparison.

static func .< (SIMD8<Scalar>, Scalar) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

Returns a vector mask with the result of a pointwise less than comparison.

static func .< (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

Returns a vector mask with the result of a pointwise less than comparison.

static func .<= (Scalar, SIMD8<Scalar>) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

Returns a vector mask with the result of a pointwise less than or equal comparison.

static func .<= (SIMD8<Scalar>, Scalar) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

Returns a vector mask with the result of a pointwise less than or equal comparison.

static func .<= (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

Returns a vector mask with the result of a pointwise less than or equal comparison.

static func .== (Scalar, SIMD8<Scalar>) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

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

static func .== (SIMD8<Scalar>, Scalar) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

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

static func .== (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

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

static func .> (Scalar, SIMD8<Scalar>) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

Returns a vector mask with the result of a pointwise greater than comparison.

static func .> (SIMD8<Scalar>, Scalar) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

Returns a vector mask with the result of a pointwise greater than comparison.

static func .> (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

Returns a vector mask with the result of a pointwise greater than comparison.

static func .>= (Scalar, SIMD8<Scalar>) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

Returns a vector mask with the result of a pointwise greater than or equal comparison.

static func .>= (SIMD8<Scalar>, Scalar) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

Returns a vector mask with the result of a pointwise greater than or equal comparison.

static func .>= (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMDMask<SIMD8<Scalar.SIMDMaskScalar>>

Returns a vector mask with the result of a pointwise greater than or equal comparison.

static func / (Scalar, SIMD8<Scalar>) -> SIMD8<Scalar>
static func / (SIMD8<Scalar>, Scalar) -> SIMD8<Scalar>
static func / (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMD8<Scalar>
static func / (Scalar, SIMD8<Scalar>) -> SIMD8<Scalar>
static func / (SIMD8<Scalar>, Scalar) -> SIMD8<Scalar>
static func / (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMD8<Scalar>
static func /= (inout SIMD8<Scalar>, Scalar)
static func /= (inout SIMD8<Scalar>, SIMD8<Scalar>)
static func /= (inout SIMD8<Scalar>, Scalar)
static func /= (inout SIMD8<Scalar>, SIMD8<Scalar>)
static func == (SIMD8<Scalar>, SIMD8<Scalar>) -> Bool

Returns a Boolean value indicating whether two vectors are equal.

static func ^ (Scalar, SIMD8<Scalar>) -> SIMD8<Scalar>
static func ^ (SIMD8<Scalar>, Scalar) -> SIMD8<Scalar>
static func ^ (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMD8<Scalar>
static func ^= (inout SIMD8<Scalar>, Scalar)
static func ^= (inout SIMD8<Scalar>, SIMD8<Scalar>)
static func | (Scalar, SIMD8<Scalar>) -> SIMD8<Scalar>
static func | (SIMD8<Scalar>, Scalar) -> SIMD8<Scalar>
static func | (SIMD8<Scalar>, SIMD8<Scalar>) -> SIMD8<Scalar>
static func |= (inout SIMD8<Scalar>, Scalar)
static func |= (inout SIMD8<Scalar>, SIMD8<Scalar>)
static func ~ (SIMD8<Scalar>) -> SIMD8<Scalar>

Relationships

See Also

SIMD Vectors

struct SIMD2

A vector of two scalar values.

struct SIMD3

A vector of three scalar values.

struct SIMD4

A vector of four scalar values.

struct SIMD16

A vector of 16 scalar values.

struct SIMD32

A vector of 32 scalar values.

struct SIMD64

A vector of 64 scalar values.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software