Table of Contents

Interface ISPMDLane<TSelf, TNumber>

Namespace
Misaki.HighPerformance.Mathematics.SPMD
Assembly
Misaki.HighPerformance.Mathematics.SPMD.dll

Represents a single-lane or multi-lane (vectorized) SPMD value and the operations supported on it.

public interface ISPMDLane<TSelf, TNumber> : ISPMDLane, IEquatable<TSelf> where TSelf : ISPMDLane<TSelf, TNumber> where TNumber : unmanaged, INumber<TNumber>, IBinaryNumber<TNumber>, IMinMaxValue<TNumber>, IBitwiseOperators<TNumber, TNumber, TNumber>

Type Parameters

TSelf

The concrete SPMD lane type implementing this interface.

TNumber

The underlying numeric element type.

Inherited Members

Properties

AllBitsSet

Gets a lane value where all bits are set to 1 for each lane.

public static abstract TSelf AllBitsSet { get; }

Property Value

TSelf

this[int]

Gets the element value for the specified lane index.

TNumber this[int index] { get; }

Parameters

index int

The zero-based lane index.

Property Value

TNumber

MaxValue

Gets a lane value where all lanes are set to the maximum representable value of the underlying numeric type.

public static abstract TSelf MaxValue { get; }

Property Value

TSelf

MinValue

Gets a lane value where all lanes are set to the minimum representable value of the underlying numeric type.

public static abstract TSelf MinValue { get; }

Property Value

TSelf

One

Gets a lane value where all lanes are set to numeric one.

public static abstract TSelf One { get; }

Property Value

TSelf

Zero

Gets a lane value where all lanes are set to numeric zero.

public static abstract TSelf Zero { get; }

Property Value

TSelf

Methods

Abs(TSelf)

Computes the absolute value of the lane value element-wise.

public static abstract TSelf Abs(TSelf value)

Parameters

value TSelf

Returns

TSelf

The absolute lane value.

Acos(TSelf)

Computes the arccosine of each lane element.

public static abstract TSelf Acos(TSelf value)

Parameters

value TSelf

The source lane value.

Returns

TSelf

The arccosine of each lane element.

Remarks

Input is expected to be in [-1, 1]; implementations often rely on approximation polynomials combined with range reduction.

All(TSelf)

Checks if all lanes in the mask are true.

public static abstract bool All(TSelf mask)

Parameters

mask TSelf

The mask to check.

Returns

bool

True if all lanes are true; otherwise, false.

Any(TSelf)

Checks if any lane in the mask is true.

public static abstract bool Any(TSelf mask)

Parameters

mask TSelf

The mask to check.

Returns

bool

True if any lane is true; otherwise, false.

AsVector()

Converts the lane value to a vector.

Vector<TNumber> AsVector()

Returns

Vector<TNumber>

The backing vector representation.

Asin(TSelf)

Computes the arcsine of each lane element.

public static abstract TSelf Asin(TSelf value)

Parameters

value TSelf

The source lane value.

Returns

TSelf

The arcsine of each lane element.

Remarks

Implementations typically assume input is within [-1, 1] and may use polynomial approximations for performance.

Atan(TSelf)

Computes the arctangent of each lane element.

public static abstract TSelf Atan(TSelf value)

Parameters

value TSelf

The source lane value.

Returns

TSelf

The arctangent of each lane element.

Remarks

Polynomial approximations with restricted input ranges are commonly used for performance-sensitive implementations.

Atan2(TSelf, TSelf)

Computes the arctangent of y/x for each lane element.

public static abstract TSelf Atan2(TSelf y, TSelf x)

Parameters

y TSelf

The numerator lane value.

x TSelf

The denominator lane value.

Returns

TSelf

The arctangent of each lane pair.

Remarks

Implementations often rely on quadrant-aware polynomial routines and assume inputs are finite to avoid NaNs.

BitCast<TOther, TOtherNumber>()

Bitwise reinterprets the lane value as another SPMD lane type with a different underlying numeric type.

TOther BitCast<TOther, TOtherNumber>() where TOther : ISPMDLane<TOther, TOtherNumber> where TOtherNumber : unmanaged, INumber<TOtherNumber>, IBinaryNumber<TOtherNumber>, IMinMaxValue<TOtherNumber>, IBitwiseOperators<TOtherNumber, TOtherNumber, TOtherNumber>

Returns

TOther

The bit-cast lane value.

Type Parameters

TOther

The type of the other SPMD lane.

TOtherNumber

The underlying numeric type of the other SPMD lane.

Cast<TOther, TOtherNumber>()

Casts the lane value to another SPMD lane type with a different underlying numeric type.

TOther Cast<TOther, TOtherNumber>() where TOther : ISPMDLane<TOther, TOtherNumber> where TOtherNumber : unmanaged, INumber<TOtherNumber>, IBinaryNumber<TOtherNumber>, IMinMaxValue<TOtherNumber>, IBitwiseOperators<TOtherNumber, TOtherNumber, TOtherNumber>

Returns

TOther

The casted lane value.

Type Parameters

TOther

The type of the other SPMD lane.

TOtherNumber

The underlying numeric type of the other SPMD lane.

Ceil(TSelf)

Computes the ceiling of each lane element.

public static abstract TSelf Ceil(TSelf value)

Parameters

value TSelf

Returns

TSelf

The smallest integral value greater than or equal to each element.

Remarks

Implementations should use Vector helpers for floating-point types when available.

Clamp(TSelf, TSelf, TSelf)

Clamps each element of the lane value between the specified minimum and maximum values.

public static abstract TSelf Clamp(TSelf value, TSelf min, TSelf max)

Parameters

value TSelf

The lane value to clamp.

min TSelf

The inclusive minimum.

max TSelf

The inclusive maximum.

Returns

TSelf

The clamped lane value.

CompressStore(TNumber*, TSelf)

Compresses the data specified by the given mask and stores the compressed result in the provided destination variable.

int CompressStore(TNumber* pDestination, TSelf mask)

Parameters

pDestination TNumber*

A pointer to the variable where the compressed data will be stored.

mask TSelf

A mask value that determines which elements are included in the compression operation.

Returns

int

The number of elements written to the destination as a result of the compression. Returns 0 if no elements are compressed.

Remarks

Implementations may use hardware-specific shuffle tables to reorder the selected lanes before storing, falling back to a scalar loop otherwise.

CompressStore(ref TNumber, TSelf)

Compresses the data specified by the given mask and stores the compressed result in the provided destination variable.

int CompressStore(ref TNumber destination, TSelf mask)

Parameters

destination TNumber

A reference to the variable where the compressed data will be stored.

mask TSelf

A mask value that determines which elements are included in the compression operation.

Returns

int

The number of elements written to the destination as a result of the compression. Returns 0 if no elements are compressed.

Remarks

Implementations may use hardware-specific shuffle tables to reorder the selected lanes before storing, falling back to a scalar loop otherwise.

CopySign(TSelf, TSelf)

Copies the sign of the second lane value to the magnitude of the first.

public static abstract TSelf CopySign(TSelf magnitude, TSelf sign)

Parameters

magnitude TSelf

The magnitude lane value.

sign TSelf

The sign lane value.

Returns

TSelf

The result of merging magnitude with sign.

Cos(TSelf)

Computes the cosine of each lane element.

public static abstract TSelf Cos(TSelf value)

Parameters

value TSelf

The source lane value.

Returns

TSelf

The cosine of each lane element.

Remarks

Implementations may rely on vectorized math intrinsics for float/double and approximate values for other types.

Create(Vector<TNumber>)

Creates a lane value from the specified vector.

public static abstract TSelf Create(Vector<TNumber> value)

Parameters

value Vector<TNumber>

The vector to create the lane value from.

Returns

TSelf

The lane value built from the vector.

Create(params ReadOnlySpan<TNumber>)

Creates a new instance of the type from the specified sequence of numeric values.

public static abstract TSelf Create(params ReadOnlySpan<TNumber> values)

Parameters

values ReadOnlySpan<TNumber>

A parameter array of read-only spans containing the numeric values to use for initialization.

Returns

TSelf

A new instance of the type initialized with the provided numeric values.

Create(TNumber)

Creates a lane value where all lanes are set to the specified value.

public static abstract TSelf Create(TNumber value)

Parameters

value TNumber

The value to set for all lanes.

Returns

TSelf

The created lane value.

Equal(TSelf, TSelf)

Compares two lane values for equality element-wise.

public static abstract TSelf Equal(TSelf a, TSelf b)

Parameters

a TSelf

The first lane value.

b TSelf

The second lane value.

Returns

TSelf

The mask representing the equality comparison result.

Exp(TSelf)

Computes the exponential of each lane element.

public static abstract TSelf Exp(TSelf value)

Parameters

value TSelf

The source lane value.

Returns

TSelf

The exponential of each lane element.

Remarks

Float and double implementations typically call into vectorized exp intrinsics; other types may fall back to scalar paths.

Exp2(TSelf)

Computes 2 raised to each lane element.

public static abstract TSelf Exp2(TSelf value)

Parameters

value TSelf

The source lane value.

Returns

TSelf

The base-2 exponential of each lane element.

Remarks

This can be implemented via Exp(TSelf) when no dedicated base-2 intrinsic exists.

Floor(TSelf)

Computes the floor of the lane value element-wise.

public static abstract TSelf Floor(TSelf value)

Parameters

value TSelf

Returns

TSelf

The lane value with each element rounded toward negative infinity.

Frac(TSelf)

Computes the fractional part of the lane value element-wise.

public static abstract TSelf Frac(TSelf value)

Parameters

value TSelf

Returns

TSelf

The fractional lane value.

Gather(TNumber*, int*, byte)

Gathers lane values from the specified base address and indices, returning a lane value where each lane is loaded from the address computed by adding the corresponding index (multiplied by the scale) to the base address.

public static abstract TSelf Gather(TNumber* pData, int* pIndices, byte scale)

Parameters

pData TNumber*

The base address from which to gather values.

pIndices int*

The pointer to the indices of the values to gather.

scale byte

The scale factor for the indices.

Returns

TSelf

The gathered lane value.

Gather(TNumber*, TSelf, byte)

Gathers lane values from the specified base address and indices, returning a lane value where each lane is loaded from the address computed by adding the corresponding index (multiplied by the scale) to the base address.

public static abstract TSelf Gather(TNumber* pData, TSelf indices, byte scale)

Parameters

pData TNumber*

The base address from which to gather values.

indices TSelf

The indices of the values to gather.

scale byte

The scale factor for the indices.

Returns

TSelf

The gathered lane value.

Gather(ref TNumber, ref int, byte)

Gathers lane values from the specified base address and indices, returning a lane value where each lane is loaded from the address computed by adding the corresponding index (multiplied by the scale) to the base address.

public static abstract TSelf Gather(ref TNumber baseAddress, ref int baseIndex, byte scale)

Parameters

baseAddress TNumber

The base address from which to gather values.

baseIndex int

The reference to the base index.

scale byte

The scale factor for the indices.

Returns

TSelf

The gathered lane value.

Gather(ref TNumber, TSelf, byte)

Gathers lane values from the specified base address and indices, returning a lane value where each lane is loaded from the address computed by adding the corresponding index (multiplied by the scale) to the base address.

public static abstract TSelf Gather(ref TNumber baseAddress, TSelf indices, byte scale)

Parameters

baseAddress TNumber

The base address from which to gather values.

indices TSelf

The indices of the values to gather.

scale byte

The scale factor for the indices.

Returns

TSelf

The gathered lane value.

GetUnsafePtr()

Gets an pointer to the lane's underlying data.

TNumber* GetUnsafePtr()

Returns

TNumber*

An pointer to the lane's underlying data.

GreaterThan(TSelf, TSelf)

Compares two lane values for greater than element-wise.

public static abstract TSelf GreaterThan(TSelf a, TSelf b)

Parameters

a TSelf

The first lane value.

b TSelf

The second lane value.

Returns

TSelf

The mask representing the greater than comparison result.

GreaterThanOrEqual(TSelf, TSelf)

Compares two lane values for greater than or equal element-wise.

public static abstract TSelf GreaterThanOrEqual(TSelf a, TSelf b)

Parameters

a TSelf

The first lane value.

b TSelf

The second lane value.

Returns

TSelf

The mask representing the greater than or equal comparison result.

Lerp(TSelf, TSelf, TSelf)

Performs linear interpolation between two lane values.

public static abstract TSelf Lerp(TSelf a, TSelf b, TSelf t)

Parameters

a TSelf

The start lane value.

b TSelf

The end lane value.

t TSelf

The interpolation factor.

Returns

TSelf

The interpolated lane value.

LessThan(TSelf, TSelf)

Compares two lane values for less than element-wise.

public static abstract TSelf LessThan(TSelf a, TSelf b)

Parameters

a TSelf

The first lane value.

b TSelf

The second lane value.

Returns

TSelf

The mask representing the less than comparison result.

LessThanOrEqual(TSelf, TSelf)

Compares two lane values for less than or equal element-wise.

public static abstract TSelf LessThanOrEqual(TSelf a, TSelf b)

Parameters

a TSelf

The first lane value.

b TSelf

The second lane value.

Returns

TSelf

The mask representing the less than or equal comparison result.

Load(TNumber*)

Loads a lane value from the specified pointer.

public static abstract TSelf Load(TNumber* pValue)

Parameters

pValue TNumber*

The pointer to load from.

Returns

TSelf

The loaded lane value.

Remarks

Unsafe pointer overloads are provided for scenarios where sequential lane data is already contiguous in memory.

Load(ref TNumber)

Loads a lane value from the specified reference.

public static abstract TSelf Load(ref TNumber value)

Parameters

value TNumber

The reference to load from.

Returns

TSelf

The loaded lane value.

Log(TSelf)

Computes the natural logarithm of each lane element.

public static abstract TSelf Log(TSelf value)

Parameters

value TSelf

The source lane value.

Returns

TSelf

The natural logarithm of each lane element.

Remarks

Vectorized logarithm instructions may only exist for floating-point types; other types should mimic the scalar behavior.

Log2(TSelf)

Computes the base-2 logarithm of each lane element.

public static abstract TSelf Log2(TSelf value)

Parameters

value TSelf

The source lane value.

Returns

TSelf

The base-2 logarithm of each lane element.

Remarks

If a dedicated base-2 intrinsic is unavailable, the implementation may compute Log(value)/Log(2).

MaskGather(TNumber*, int*, TSelf, byte)

Gathers lane values from the specified base address and indices, returning a lane value where each lane is loaded from the address computed by adding the corresponding index (multiplied by the scale) to the base address, but only for lanes where the corresponding mask bit is set; other lanes are set to zero.

public static abstract TSelf MaskGather(TNumber* pData, int* pIndices, TSelf mask, byte scale)

Parameters

pData TNumber*

The base address from which to gather values.

pIndices int*

The pointer to the indices of the values to gather.

mask TSelf

The mask value that determines which elements are included in the gathering operation.

scale byte

The scale factor for the indices.

Returns

TSelf

The gathered lane value.

MaskGather(TNumber*, TSelf, TSelf, byte)

Gathers lane values from the specified base address and indices, returning a lane value where each lane is loaded from the address computed by adding the corresponding index (multiplied by the scale) to the base address, but only for lanes where the corresponding mask bit is set; other lanes are set to zero.

public static abstract TSelf MaskGather(TNumber* pData, TSelf indices, TSelf mask, byte scale)

Parameters

pData TNumber*

The base address from which to gather values.

indices TSelf

The indices of the values to gather.

mask TSelf

The mask value that determines which elements are included in the gathering operation.

scale byte

The scale factor for the indices.

Returns

TSelf

The gathered lane value.

MaskLoad(TNumber*, TSelf)

Uses the specified mask to conditionally load lane values from the given pointer, returning a lane value where masked lanes are loaded and unmasked lanes are set to zero.

public static abstract TSelf MaskLoad(TNumber* pValue, TSelf mask)

Parameters

pValue TNumber*

The pointer to load from.

mask TSelf

The mask to use for conditional loading.

Returns

TSelf

The loaded lane value.

MaskLoad(ref TNumber, TSelf)

Uses the specified mask to conditionally load lane values from the given reference, returning a lane value where masked lanes are loaded and unmasked lanes are set to zero.

public static abstract TSelf MaskLoad(ref TNumber value, TSelf mask)

Parameters

value TNumber

The reference to load from.

mask TSelf

The mask to use for conditional loading.

Returns

TSelf

The loaded lane value.

MaskScatter(TNumber*, int*, TSelf)

Masks the lane value with the specified mask and scatters the result to the given base address and indices, where masked lanes are stored to the address computed by adding the corresponding index (multiplied by the scale) to the base address, and unmasked lanes are left unchanged in the destination.

void MaskScatter(TNumber* pDst, int* pIndices, TSelf mask)

Parameters

pDst TNumber*

A pointer to the base address where the data will be scattered.

pIndices int*

A pointer to the array of indices that determine the destinations of each lane.

mask TSelf

A vector of boolean values that determine which lanes to scatter.

MaskScatter(TNumber*, TSelf, TSelf)

Masks the lane value with the specified mask and scatters the result to the given base address and indices, where masked lanes are stored to the address computed by adding the corresponding index (multiplied by the scale) to the base address, and unmasked lanes are left unchanged in the destination.

void MaskScatter(TNumber* pDst, TSelf indices, TSelf mask)

Parameters

pDst TNumber*

A pointer to the base address where the data will be scattered.

indices TSelf

A vector of indices that determine the destinations of each lane.

mask TSelf

A vector of boolean values that determine which lanes to scatter.

MaskScatter(ref TNumber, int*, TSelf)

Masks the lane value with the specified mask and scatters the result to the given base address and indices, where masked lanes are stored to the address computed by adding the corresponding index (multiplied by the scale) to the base address, and unmasked lanes are left unchanged in the destination.

void MaskScatter(ref TNumber destination, int* pIndices, TSelf mask)

Parameters

destination TNumber

A reference to the variable where the scattered data will be stored.

pIndices int*

A pointer to the array of indices that determine the destinations of each lane.

mask TSelf

A vector of boolean values that determine which lanes to scatter.

MaskScatter(ref TNumber, TSelf, TSelf)

Masks the lane value with the specified mask and scatters the result to the given base address and indices, where masked lanes are stored to the address computed by adding the corresponding index (multiplied by the scale) to the base address, and unmasked lanes are left unchanged in the destination.

void MaskScatter(ref TNumber destination, TSelf indices, TSelf mask)

Parameters

destination TNumber

A reference to the variable where the scattered data will be stored.

indices TSelf

A vector of indices that determine the destinations of each lane.

mask TSelf

A vector of boolean values that determine which lanes to scatter.

MaskStore(TNumber*, TSelf)

Masks the lane value with the specified mask and stores the result to the given reference, where masked lanes are stored and unmasked lanes are left unchanged in the destination.

void MaskStore(TNumber* pDestination, TSelf mask)

Parameters

pDestination TNumber*

A pointer to the variable where the masked data will be stored.

mask TSelf

A mask value that determines which elements are included in the masking operation.

MaskStore(ref TNumber, TSelf)

Masks the lane value with the specified mask and stores the result to the given reference, where masked lanes are stored and unmasked lanes are left unchanged in the destination.

void MaskStore(ref TNumber destination, TSelf mask)

Parameters

destination TNumber

A reference to the variable where the masked data will be stored.

mask TSelf

A mask value that determines which elements are included in the masking operation.

Max(TSelf, TSelf)

Returns the maximum of the two lane values element-wise.

public static abstract TSelf Max(TSelf a, TSelf b)

Parameters

a TSelf

The first lane value.

b TSelf

The second lane value.

Returns

TSelf

The lane value containing the maximum of each element.

Min(TSelf, TSelf)

Returns the minimum of the two lane values element-wise.

public static abstract TSelf Min(TSelf a, TSelf b)

Parameters

a TSelf

The first lane value.

b TSelf

The second lane value.

Returns

TSelf

The lane value containing the minimum of each element.

MultiplyAdd(TSelf, TSelf, TSelf)

Computes a * b + c element-wise.

public static abstract TSelf MultiplyAdd(TSelf a, TSelf b, TSelf c)

Parameters

a TSelf

The first multiplier.

b TSelf

The second multiplier.

c TSelf

The addend.

Returns

TSelf

The result of the fused multiply-add operation.

Remarks

Float and double implementations should use fused multiply-add instructions when available for both accuracy and performance.

None(TSelf)

Checks if no lanes in the mask are true.

public static abstract bool None(TSelf mask)

Parameters

mask TSelf

The mask to check.

Returns

bool

True if no lanes are true; otherwise, false.

Pow(TSelf, TSelf)

Raises each lane element to the specified power.

public static abstract TSelf Pow(TSelf x, TSelf y)

Parameters

x TSelf

The base lane value.

y TSelf

The exponent lane value. Cannot be negative.

Returns

TSelf

The power result for each lane.

Rcp(TSelf)

Computes the reciprocal of each lane element.

public static abstract TSelf Rcp(TSelf value)

Parameters

value TSelf

Returns

TSelf

The reciprocal lane value.

Remarks

Fast paths may use Sse.Reciprocal or Avx.Reciprocal when TNumber is float.

ReduceAdd(TSelf)

Reduces the lane value to a single scalar by adding all lanes together.

public static abstract TNumber ReduceAdd(TSelf value)

Parameters

value TSelf

The lane value to reduce.

Returns

TNumber

The reduced scalar value.

ReduceMax(TSelf)

Reduces the lane value to a single scalar by finding the maximum element.

public static abstract TNumber ReduceMax(TSelf value)

Parameters

value TSelf

The lane value to reduce.

Returns

TNumber

The reduced scalar value.

ReduceMin(TSelf)

Reduces the lane value to a single scalar by finding the minimum element.

public static abstract TNumber ReduceMin(TSelf value)

Parameters

value TSelf

The lane value to reduce.

Returns

TNumber

The reduced scalar value.

Round(TSelf)

Rounds each lane element to the nearest integer value.

public static abstract TSelf Round(TSelf value)

Parameters

value TSelf

Returns

TSelf

The rounded lane value.

Remarks

Implementations should prefer vectorized round intrinsics for floating-point implementations.

Rsqrt(TSelf)

Computes the reciprocal square root of each lane element.

public static abstract TSelf Rsqrt(TSelf value)

Parameters

value TSelf

Returns

TSelf

The reciprocal square root lane value.

Remarks

Float implementations may prefer hardware reciprocal-sqrt intrinsics and fallback to Create(TNumber.One)/Sqrt(x) otherwise.

Saturate(TSelf)

Saturates each element in the lane value to the 0..1 range.

public static abstract TSelf Saturate(TSelf value)

Parameters

value TSelf

The lane value to saturate.

Returns

TSelf

The saturated lane value.

Scatter(TNumber*, int*)

Scatters the lane value to the specified base address and indices, where each lane is stored to the address computed by adding the corresponding index (multiplied by the scale) to the base address.

void Scatter(TNumber* pDst, int* pIndices)

Parameters

pDst TNumber*

A pointer to the base address where the data will be scattered.

pIndices int*

A pointer to the array of indices that determine the destinations of each lane.

Scatter(TNumber*, TSelf)

Scatters the lane value to the specified base address and indices, where each lane is stored to the address computed by adding the corresponding index (multiplied by the scale) to the base address.

void Scatter(TNumber* pDst, TSelf indices)

Parameters

pDst TNumber*

A pointer to the base address where the data will be scattered.

indices TSelf

A vector of indices that determine the destinations of each lane.

Scatter(ref TNumber, int*)

Scatters the lane value to the specified base address and indices, where each lane is stored to the address computed by adding the corresponding index (multiplied by the scale) to the base address.

void Scatter(ref TNumber destination, int* pIndices)

Parameters

destination TNumber

A reference to the variable where the scattered data will be stored.

pIndices int*

A pointer to the array of indices that determine the destinations of each lane.

Scatter(ref TNumber, TSelf)

Scatters the lane value to the specified base address and indices, where each lane is stored to the address computed by adding the corresponding index (multiplied by the scale) to the base address.

void Scatter(ref TNumber destination, TSelf indices)

Parameters

destination TNumber

A reference to the variable where the scattered data will be stored.

indices TSelf

A vector of indices that determine the destinations of each lane.

Select(TSelf, TSelf, TSelf)

Selects values from two lane values based on a condition mask.

public static abstract TSelf Select(TSelf conditionMask, TSelf ifTrue, TSelf ifFalse)

Parameters

conditionMask TSelf

The condition mask.

ifTrue TSelf

The value to select if true.

ifFalse TSelf

The value to select if false.

Returns

TSelf

The selected lane value.

Sequence(TNumber, TNumber)

Creates a lane value with a sequence starting from the specified value with the given step.

public static abstract TSelf Sequence(TNumber start, TNumber step)

Parameters

start TNumber

The starting value.

step TNumber

The step value for the sequence.

Returns

TSelf

The lane value containing the arithmetic sequence.

Remarks

Implementations may rely on vector creation helpers and assume that the resulting sequence length matches LaneWidth.

Sign(TSelf)

Returns the sign of each lane element.

public static abstract TSelf Sign(TSelf value)

Parameters

value TSelf

Returns

TSelf

-1, 0, or 1 per lane.

Sin(TSelf)

Computes the sine of each lane element.

public static abstract TSelf Sin(TSelf value)

Parameters

value TSelf

The source lane value.

Returns

TSelf

The sine of each lane element.

Remarks

Implementations may rely on vectorized math intrinsics for float/double and approximate values for other types.

SinCos(TSelf, out TSelf, out TSelf)

Computes both sine and cosine of each lane element.

public static abstract void SinCos(TSelf value, out TSelf sin, out TSelf cos)

Parameters

value TSelf

The source lane value.

sin TSelf
cos TSelf

Remarks

Implementations returning both sin and cos simultaneously can reuse intermediate values for better performance.

Sqrt(TSelf)

Computes the square root of the lane value element-wise.

public static abstract TSelf Sqrt(TSelf value)

Parameters

value TSelf

Returns

TSelf

The square root lane value.

Store(TNumber*)

Stores the lane value to the specified pointer.

void Store(TNumber* pDestination)

Parameters

pDestination TNumber*

The pointer to store to.

Store(ref TNumber)

Stores the lane value to the specified reference.

void Store(ref TNumber destination)

Parameters

destination TNumber

The reference to store to.

Tan(TSelf)

Computes the tangent of each lane element.

public static abstract TSelf Tan(TSelf value)

Parameters

value TSelf

The source lane value.

Returns

TSelf

The tangent of each lane element.

Remarks

Many implementations use polynomial approximations and assume the input is reduced to [-pi/4, pi/4] for accuracy.

Trunc(TSelf)

Truncates each lane element toward zero.

public static abstract TSelf Trunc(TSelf value)

Parameters

value TSelf

Returns

TSelf

The truncated lane value.

Operators

operator +(TSelf, TSelf)

Adds two lane values element-wise.

public static abstract TSelf operator +(TSelf a, TSelf b)

Parameters

a TSelf

The first lane value.

b TSelf

The second lane value.

Returns

TSelf

The lane-wise sum.

operator &(TSelf, TSelf)

Computes the bitwise AND of two lane values element-wise.

public static abstract TSelf operator &(TSelf a, TSelf b)

Parameters

a TSelf

The first lane value.

b TSelf

The second lane value.

Returns

TSelf

The result of the bitwise AND.

operator |(TSelf, TSelf)

Computes the bitwise OR of two lane values element-wise.

public static abstract TSelf operator |(TSelf a, TSelf b)

Parameters

a TSelf

The first lane value.

b TSelf

The second lane value.

Returns

TSelf

The result of the bitwise OR.

operator /(TSelf, TSelf)

Divides two lane values element-wise.

public static abstract TSelf operator /(TSelf a, TSelf b)

Parameters

a TSelf

The first lane value.

b TSelf

The second lane value.

Returns

TSelf

The lane-wise quotient.

operator ==(TSelf, TSelf)

Determines whether two instances of the type are equal component-wise.

public static abstract TSelf operator ==(TSelf a, TSelf b)

Parameters

a TSelf

The first value to compare.

b TSelf

The second value to compare.

Returns

TSelf

All bits set where the elements are equal; otherwise, all bits cleared.

operator ^(TSelf, TSelf)

Computes the bitwise XOR of two lane values element-wise.

public static abstract TSelf operator ^(TSelf a, TSelf b)

Parameters

a TSelf

The first lane value.

b TSelf

The second lane value.

Returns

TSelf

The result of the bitwise XOR.

operator >(TSelf, TSelf)

Determines whether one instance of the type is greater than another instance component-wise.

public static abstract TSelf operator >(TSelf a, TSelf b)

Parameters

a TSelf

The first value to compare.

b TSelf

The second value to compare.

Returns

TSelf

A value indicating whether the first parameter is greater than the second parameter.

operator >=(TSelf, TSelf)

Determines whether the first operand is greater than or equal to the second operand component-wise.

public static abstract TSelf operator >=(TSelf a, TSelf b)

Parameters

a TSelf

The first value to compare.

b TSelf

The second value to compare.

Returns

TSelf

All bits set where the first parameter is greater than or equal to the second parameter; otherwise, all bits cleared.

implicit operator TSelf(TNumber)

Implicitly converts a scalar numeric value to a lane value where all lanes are set to that value.

public static abstract implicit operator TSelf(TNumber value)

Parameters

value TNumber

The scalar numeric value to convert.

Returns

TSelf

operator !=(TSelf, TSelf)

Determines whether two instances of the type are not equal component-wise.

public static abstract TSelf operator !=(TSelf a, TSelf b)

Parameters

a TSelf

The first value to compare.

b TSelf

The second value to compare.

Returns

TSelf

All bits set where the elements are not equal; otherwise, all bits cleared.

operator <(TSelf, TSelf)

Determines whether one instance of the type is less than another instance component-wise.

public static abstract TSelf operator <(TSelf a, TSelf b)

Parameters

a TSelf

The first value to compare.

b TSelf

The second value to compare.

Returns

TSelf

All bits set where the first parameter is less than the second parameter; otherwise, all bits cleared.

operator <=(TSelf, TSelf)

Determines whether the first operand is less than or equal to the second operand component-wise.

public static abstract TSelf operator <=(TSelf a, TSelf b)

Parameters

a TSelf

The first value to compare.

b TSelf

The second value to compare.

Returns

TSelf

All bits set where the first parameter is less than or equal to the second parameter; otherwise, all bits cleared.

operator %(TSelf, TSelf)

Computes the modulus of two lane values element-wise.

public static abstract TSelf operator %(TSelf a, TSelf b)

Parameters

a TSelf

The first lane value.

b TSelf

The second lane value.

Returns

TSelf

The lane-wise modulus.

operator *(TSelf, TSelf)

Multiplies two lane values element-wise.

public static abstract TSelf operator *(TSelf a, TSelf b)

Parameters

a TSelf

The first lane value.

b TSelf

The second lane value.

Returns

TSelf

The lane-wise product.

operator ~(TSelf)

Computes the bitwise NOT of a lane value element-wise.

public static abstract TSelf operator ~(TSelf a)

Parameters

a TSelf

The lane value.

Returns

TSelf

The bitwise complement of the lane value.

operator -(TSelf, TSelf)

Subtracts two lane values element-wise.

public static abstract TSelf operator -(TSelf a, TSelf b)

Parameters

a TSelf

The first lane value.

b TSelf

The second lane value.

Returns

TSelf

The lane-wise difference.

operator -(TSelf)

Negates the lane value element-wise.

public static abstract TSelf operator -(TSelf a)

Parameters

a TSelf

The lane value to negate.

Returns

TSelf

The negated lane value.