Table of Contents

Struct WideLane<TNumber>

Namespace
Misaki.HighPerformance.Mathematics.SPMD
Assembly
Misaki.HighPerformance.Mathematics.SPMD.dll
public readonly struct WideLane<TNumber> : ISPMDLane<WideLane<TNumber>, TNumber>, ISPMDLane, IEquatable<WideLane<TNumber>> where TNumber : unmanaged, INumber<TNumber>, IBinaryNumber<TNumber>, IMinMaxValue<TNumber>, IBitwiseOperators<TNumber, TNumber, TNumber>

Type Parameters

TNumber
Implements
ISPMDLane<WideLane<TNumber>, TNumber>
Inherited Members

Constructors

WideLane(Vector<TNumber>)

public WideLane(Vector<TNumber> value)

Parameters

value Vector<TNumber>

Fields

value

public readonly Vector<TNumber> value

Field Value

Vector<TNumber>

Properties

AllBitsSet

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

public static WideLane<TNumber> AllBitsSet { get; }

Property Value

WideLane<TNumber>

this[int]

Gets the element value for the specified lane index.

public TNumber this[int index] { get; }

Parameters

index int

The zero-based lane index.

Property Value

TNumber

LaneWidth

Gets the number of lanes (vector width) for the SPMD implementation.

public static int LaneWidth { get; }

Property Value

int

MaxValue

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

public static WideLane<TNumber> MaxValue { get; }

Property Value

WideLane<TNumber>

MinValue

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

public static WideLane<TNumber> MinValue { get; }

Property Value

WideLane<TNumber>

One

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

public static WideLane<TNumber> One { get; }

Property Value

WideLane<TNumber>

Zero

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

public static WideLane<TNumber> Zero { get; }

Property Value

WideLane<TNumber>

Methods

Abs(WideLane<TNumber>)

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

public static WideLane<TNumber> Abs(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

Returns

WideLane<TNumber>

The absolute lane value.

Acos(WideLane<TNumber>)

Computes the arccosine of each lane element.

public static WideLane<TNumber> Acos(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

The source lane value.

Returns

WideLane<TNumber>

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(WideLane<TNumber>)

Checks if all lanes in the mask are true.

public static bool All(WideLane<TNumber> mask)

Parameters

mask WideLane<TNumber>

The mask to check.

Returns

bool

True if all lanes are true; otherwise, false.

Any(WideLane<TNumber>)

Checks if any lane in the mask is true.

public static bool Any(WideLane<TNumber> mask)

Parameters

mask WideLane<TNumber>

The mask to check.

Returns

bool

True if any lane is true; otherwise, false.

AsVector()

Converts the lane value to a vector.

public Vector<TNumber> AsVector()

Returns

Vector<TNumber>

The backing vector representation.

Asin(WideLane<TNumber>)

Computes the arcsine of each lane element.

public static WideLane<TNumber> Asin(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

The source lane value.

Returns

WideLane<TNumber>

The arcsine of each lane element.

Remarks

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

Atan(WideLane<TNumber>)

Computes the arctangent of each lane element.

public static WideLane<TNumber> Atan(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

The source lane value.

Returns

WideLane<TNumber>

The arctangent of each lane element.

Remarks

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

Atan2(WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> Atan2(WideLane<TNumber> y, WideLane<TNumber> x)

Parameters

y WideLane<TNumber>

The numerator lane value.

x WideLane<TNumber>

The denominator lane value.

Returns

WideLane<TNumber>

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.

public 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.

public 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(WideLane<TNumber>)

Computes the ceiling of each lane element.

public static WideLane<TNumber> Ceil(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

Returns

WideLane<TNumber>

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

Remarks

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

Clamp(WideLane<TNumber>, WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> Clamp(WideLane<TNumber> value, WideLane<TNumber> min, WideLane<TNumber> max)

Parameters

value WideLane<TNumber>

The lane value to clamp.

min WideLane<TNumber>

The inclusive minimum.

max WideLane<TNumber>

The inclusive maximum.

Returns

WideLane<TNumber>

The clamped lane value.

CompressStore(TNumber*, WideLane<TNumber>)

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

public int CompressStore(TNumber* pDestination, WideLane<TNumber> mask)

Parameters

pDestination TNumber*

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

mask WideLane<TNumber>

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, WideLane<TNumber>)

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

public int CompressStore(ref TNumber destination, WideLane<TNumber> mask)

Parameters

destination TNumber

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

mask WideLane<TNumber>

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(WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> CopySign(WideLane<TNumber> magnitude, WideLane<TNumber> sign)

Parameters

magnitude WideLane<TNumber>

The magnitude lane value.

sign WideLane<TNumber>

The sign lane value.

Returns

WideLane<TNumber>

The result of merging magnitude with sign.

Cos(WideLane<TNumber>)

Computes the cosine of each lane element.

public static WideLane<TNumber> Cos(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

The source lane value.

Returns

WideLane<TNumber>

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 WideLane<TNumber> Create(Vector<TNumber> value)

Parameters

value Vector<TNumber>

The vector to create the lane value from.

Returns

WideLane<TNumber>

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 WideLane<TNumber> 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

WideLane<TNumber>

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 WideLane<TNumber> Create(TNumber value)

Parameters

value TNumber

The value to set for all lanes.

Returns

WideLane<TNumber>

The created lane value.

Equal(WideLane<TNumber>, WideLane<TNumber>)

Compares two lane values for equality element-wise.

public static WideLane<TNumber> Equal(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first lane value.

b WideLane<TNumber>

The second lane value.

Returns

WideLane<TNumber>

The mask representing the equality comparison result.

Equals(WideLane<TNumber>)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(WideLane<TNumber> other)

Parameters

other WideLane<TNumber>

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Exp(WideLane<TNumber>)

Computes the exponential of each lane element.

public static WideLane<TNumber> Exp(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

The source lane value.

Returns

WideLane<TNumber>

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(WideLane<TNumber>)

Computes 2 raised to each lane element.

public static WideLane<TNumber> Exp2(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

The source lane value.

Returns

WideLane<TNumber>

The base-2 exponential of each lane element.

Remarks

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

Floor(WideLane<TNumber>)

Computes the floor of the lane value element-wise.

public static WideLane<TNumber> Floor(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

Returns

WideLane<TNumber>

The lane value with each element rounded toward negative infinity.

Frac(WideLane<TNumber>)

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

public static WideLane<TNumber> Frac(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

Returns

WideLane<TNumber>

The fractional lane value.

Gather(TNumber*, WideLane<TNumber>, 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 WideLane<TNumber> Gather(TNumber* pData, WideLane<TNumber> indices, byte scale)

Parameters

pData TNumber*

The base address from which to gather values.

indices WideLane<TNumber>

The indices of the values to gather.

scale byte

The scale factor for the indices.

Returns

WideLane<TNumber>

The gathered 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 WideLane<TNumber> 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

WideLane<TNumber>

The gathered lane value.

Gather(ref TNumber, WideLane<TNumber>, 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 WideLane<TNumber> Gather(ref TNumber baseAddress, WideLane<TNumber> indices, byte scale)

Parameters

baseAddress TNumber

The base address from which to gather values.

indices WideLane<TNumber>

The indices of the values to gather.

scale byte

The scale factor for the indices.

Returns

WideLane<TNumber>

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 WideLane<TNumber> 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

WideLane<TNumber>

The gathered lane value.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

GetUnsafePtr()

Gets an pointer to the lane's underlying data.

public TNumber* GetUnsafePtr()

Returns

TNumber*

An pointer to the lane's underlying data.

GreaterThan(WideLane<TNumber>, WideLane<TNumber>)

Compares two lane values for greater than element-wise.

public static WideLane<TNumber> GreaterThan(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first lane value.

b WideLane<TNumber>

The second lane value.

Returns

WideLane<TNumber>

The mask representing the greater than comparison result.

GreaterThanOrEqual(WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> GreaterThanOrEqual(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first lane value.

b WideLane<TNumber>

The second lane value.

Returns

WideLane<TNumber>

The mask representing the greater than or equal comparison result.

Lerp(WideLane<TNumber>, WideLane<TNumber>, WideLane<TNumber>)

Performs linear interpolation between two lane values.

public static WideLane<TNumber> Lerp(WideLane<TNumber> a, WideLane<TNumber> b, WideLane<TNumber> t)

Parameters

a WideLane<TNumber>

The start lane value.

b WideLane<TNumber>

The end lane value.

t WideLane<TNumber>

The interpolation factor.

Returns

WideLane<TNumber>

The interpolated lane value.

LessThan(WideLane<TNumber>, WideLane<TNumber>)

Compares two lane values for less than element-wise.

public static WideLane<TNumber> LessThan(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first lane value.

b WideLane<TNumber>

The second lane value.

Returns

WideLane<TNumber>

The mask representing the less than comparison result.

LessThanOrEqual(WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> LessThanOrEqual(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first lane value.

b WideLane<TNumber>

The second lane value.

Returns

WideLane<TNumber>

The mask representing the less than or equal comparison result.

Load(TNumber*)

Loads a lane value from the specified pointer.

public static WideLane<TNumber> Load(TNumber* pValue)

Parameters

pValue TNumber*

The pointer to load from.

Returns

WideLane<TNumber>

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 WideLane<TNumber> Load(ref TNumber value)

Parameters

value TNumber

The reference to load from.

Returns

WideLane<TNumber>

The loaded lane value.

Log(WideLane<TNumber>)

Computes the natural logarithm of each lane element.

public static WideLane<TNumber> Log(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

The source lane value.

Returns

WideLane<TNumber>

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(WideLane<TNumber>)

Computes the base-2 logarithm of each lane element.

public static WideLane<TNumber> Log2(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

The source lane value.

Returns

WideLane<TNumber>

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*, WideLane<TNumber>, WideLane<TNumber>, 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 WideLane<TNumber> MaskGather(TNumber* pData, WideLane<TNumber> indices, WideLane<TNumber> mask, byte scale)

Parameters

pData TNumber*

The base address from which to gather values.

indices WideLane<TNumber>

The indices of the values to gather.

mask WideLane<TNumber>

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

scale byte

The scale factor for the indices.

Returns

WideLane<TNumber>

The gathered lane value.

MaskGather(TNumber*, int*, WideLane<TNumber>, 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 WideLane<TNumber> MaskGather(TNumber* pData, int* pIndices, WideLane<TNumber> 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 WideLane<TNumber>

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

scale byte

The scale factor for the indices.

Returns

WideLane<TNumber>

The gathered lane value.

MaskLoad(TNumber*, WideLane<TNumber>)

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 WideLane<TNumber> MaskLoad(TNumber* pValue, WideLane<TNumber> mask)

Parameters

pValue TNumber*

The pointer to load from.

mask WideLane<TNumber>

The mask to use for conditional loading.

Returns

WideLane<TNumber>

The loaded lane value.

MaskLoad(ref TNumber, WideLane<TNumber>)

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 WideLane<TNumber> MaskLoad(ref TNumber value, WideLane<TNumber> mask)

Parameters

value TNumber

The reference to load from.

mask WideLane<TNumber>

The mask to use for conditional loading.

Returns

WideLane<TNumber>

The loaded lane value.

MaskScatter(TNumber*, WideLane<TNumber>, WideLane<TNumber>)

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.

public void MaskScatter(TNumber* pDst, WideLane<TNumber> indices, WideLane<TNumber> mask)

Parameters

pDst TNumber*

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

indices WideLane<TNumber>

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

mask WideLane<TNumber>

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

MaskScatter(TNumber*, int*, WideLane<TNumber>)

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.

public void MaskScatter(TNumber* pDst, int* pIndices, WideLane<TNumber> 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 WideLane<TNumber>

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

MaskScatter(ref TNumber, WideLane<TNumber>, WideLane<TNumber>)

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.

public void MaskScatter(ref TNumber destination, WideLane<TNumber> indices, WideLane<TNumber> mask)

Parameters

destination TNumber

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

indices WideLane<TNumber>

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

mask WideLane<TNumber>

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

MaskScatter(ref TNumber, int*, WideLane<TNumber>)

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.

public void MaskScatter(ref TNumber destination, int* pIndices, WideLane<TNumber> 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 WideLane<TNumber>

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

MaskStore(TNumber*, WideLane<TNumber>)

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.

public void MaskStore(TNumber* pDst, WideLane<TNumber> mask)

Parameters

pDst TNumber*
mask WideLane<TNumber>

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

MaskStore(ref TNumber, WideLane<TNumber>)

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.

public void MaskStore(ref TNumber destination, WideLane<TNumber> mask)

Parameters

destination TNumber

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

mask WideLane<TNumber>

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

Max(WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> Max(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first lane value.

b WideLane<TNumber>

The second lane value.

Returns

WideLane<TNumber>

The lane value containing the maximum of each element.

Min(WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> Min(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first lane value.

b WideLane<TNumber>

The second lane value.

Returns

WideLane<TNumber>

The lane value containing the minimum of each element.

MultiplyAdd(WideLane<TNumber>, WideLane<TNumber>, WideLane<TNumber>)

Computes a * b + c element-wise.

public static WideLane<TNumber> MultiplyAdd(WideLane<TNumber> a, WideLane<TNumber> b, WideLane<TNumber> c)

Parameters

a WideLane<TNumber>

The first multiplier.

b WideLane<TNumber>

The second multiplier.

c WideLane<TNumber>

The addend.

Returns

WideLane<TNumber>

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(WideLane<TNumber>)

Checks if no lanes in the mask are true.

public static bool None(WideLane<TNumber> mask)

Parameters

mask WideLane<TNumber>

The mask to check.

Returns

bool

True if no lanes are true; otherwise, false.

Pow(WideLane<TNumber>, WideLane<TNumber>)

Raises each lane element to the specified power.

public static WideLane<TNumber> Pow(WideLane<TNumber> x, WideLane<TNumber> y)

Parameters

x WideLane<TNumber>

The base lane value.

y WideLane<TNumber>

The exponent lane value. Cannot be negative.

Returns

WideLane<TNumber>

The power result for each lane.

Rcp(WideLane<TNumber>)

Computes the reciprocal of each lane element.

public static WideLane<TNumber> Rcp(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

Returns

WideLane<TNumber>

The reciprocal lane value.

Remarks

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

ReduceAdd(WideLane<TNumber>)

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

public static TNumber ReduceAdd(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

The lane value to reduce.

Returns

TNumber

The reduced scalar value.

ReduceMax(WideLane<TNumber>)

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

public static TNumber ReduceMax(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

The lane value to reduce.

Returns

TNumber

The reduced scalar value.

ReduceMin(WideLane<TNumber>)

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

public static TNumber ReduceMin(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

The lane value to reduce.

Returns

TNumber

The reduced scalar value.

Round(WideLane<TNumber>)

Rounds each lane element to the nearest integer value.

public static WideLane<TNumber> Round(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

Returns

WideLane<TNumber>

The rounded lane value.

Remarks

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

Rsqrt(WideLane<TNumber>)

Computes the reciprocal square root of each lane element.

public static WideLane<TNumber> Rsqrt(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

Returns

WideLane<TNumber>

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(WideLane<TNumber>)

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

public static WideLane<TNumber> Saturate(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

The lane value to saturate.

Returns

WideLane<TNumber>

The saturated lane value.

Scatter(TNumber*, WideLane<TNumber>)

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.

public void Scatter(TNumber* pDst, WideLane<TNumber> indices)

Parameters

pDst TNumber*

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

indices WideLane<TNumber>

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

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.

public 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(ref TNumber, WideLane<TNumber>)

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.

public void Scatter(ref TNumber destination, WideLane<TNumber> indices)

Parameters

destination TNumber

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

indices WideLane<TNumber>

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.

public 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.

Select(WideLane<TNumber>, WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> Select(WideLane<TNumber> conditionMask, WideLane<TNumber> ifTrue, WideLane<TNumber> ifFalse)

Parameters

conditionMask WideLane<TNumber>

The condition mask.

ifTrue WideLane<TNumber>

The value to select if true.

ifFalse WideLane<TNumber>

The value to select if false.

Returns

WideLane<TNumber>

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 WideLane<TNumber> Sequence(TNumber start, TNumber step)

Parameters

start TNumber

The starting value.

step TNumber

The step value for the sequence.

Returns

WideLane<TNumber>

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(WideLane<TNumber>)

Returns the sign of each lane element.

public static WideLane<TNumber> Sign(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

Returns

WideLane<TNumber>

-1, 0, or 1 per lane.

Sin(WideLane<TNumber>)

Computes the sine of each lane element.

public static WideLane<TNumber> Sin(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

The source lane value.

Returns

WideLane<TNumber>

The sine of each lane element.

Remarks

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

SinCos(WideLane<TNumber>, out WideLane<TNumber>, out WideLane<TNumber>)

Computes both sine and cosine of each lane element.

public static void SinCos(WideLane<TNumber> value, out WideLane<TNumber> sin, out WideLane<TNumber> cos)

Parameters

value WideLane<TNumber>

The source lane value.

sin WideLane<TNumber>
cos WideLane<TNumber>

Remarks

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

Sqrt(WideLane<TNumber>)

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

public static WideLane<TNumber> Sqrt(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

Returns

WideLane<TNumber>

The square root lane value.

Store(TNumber*)

Stores the lane value to the specified pointer.

public void Store(TNumber* pDestination)

Parameters

pDestination TNumber*

The pointer to store to.

Store(ref TNumber)

Stores the lane value to the specified reference.

public void Store(ref TNumber destination)

Parameters

destination TNumber

The reference to store to.

Tan(WideLane<TNumber>)

Computes the tangent of each lane element.

public static WideLane<TNumber> Tan(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

The source lane value.

Returns

WideLane<TNumber>

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.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Trunc(WideLane<TNumber>)

Truncates each lane element toward zero.

public static WideLane<TNumber> Trunc(WideLane<TNumber> value)

Parameters

value WideLane<TNumber>

Returns

WideLane<TNumber>

The truncated lane value.

Operators

operator +(WideLane<TNumber>, WideLane<TNumber>)

Adds two lane values element-wise.

public static WideLane<TNumber> operator +(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first lane value.

b WideLane<TNumber>

The second lane value.

Returns

WideLane<TNumber>

The lane-wise sum.

operator &(WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> operator &(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first lane value.

b WideLane<TNumber>

The second lane value.

Returns

WideLane<TNumber>

The result of the bitwise AND.

operator |(WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> operator |(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first lane value.

b WideLane<TNumber>

The second lane value.

Returns

WideLane<TNumber>

The result of the bitwise OR.

operator /(WideLane<TNumber>, WideLane<TNumber>)

Divides two lane values element-wise.

public static WideLane<TNumber> operator /(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first lane value.

b WideLane<TNumber>

The second lane value.

Returns

WideLane<TNumber>

The lane-wise quotient.

operator ==(WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> operator ==(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first value to compare.

b WideLane<TNumber>

The second value to compare.

Returns

WideLane<TNumber>

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

operator ^(WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> operator ^(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first lane value.

b WideLane<TNumber>

The second lane value.

Returns

WideLane<TNumber>

The result of the bitwise XOR.

operator >(WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> operator >(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first value to compare.

b WideLane<TNumber>

The second value to compare.

Returns

WideLane<TNumber>

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

operator >=(WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> operator >=(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first value to compare.

b WideLane<TNumber>

The second value to compare.

Returns

WideLane<TNumber>

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

implicit operator WideLane<TNumber>(TNumber)

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

public static implicit operator WideLane<TNumber>(TNumber value)

Parameters

value TNumber

The scalar numeric value to convert.

Returns

WideLane<TNumber>

operator !=(WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> operator !=(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first value to compare.

b WideLane<TNumber>

The second value to compare.

Returns

WideLane<TNumber>

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

operator <(WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> operator <(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first value to compare.

b WideLane<TNumber>

The second value to compare.

Returns

WideLane<TNumber>

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

operator <=(WideLane<TNumber>, WideLane<TNumber>)

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

public static WideLane<TNumber> operator <=(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first value to compare.

b WideLane<TNumber>

The second value to compare.

Returns

WideLane<TNumber>

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

operator %(WideLane<TNumber>, WideLane<TNumber>)

Computes the modulus of two lane values element-wise.

public static WideLane<TNumber> operator %(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first lane value.

b WideLane<TNumber>

The second lane value.

Returns

WideLane<TNumber>

The lane-wise modulus.

operator *(WideLane<TNumber>, WideLane<TNumber>)

Multiplies two lane values element-wise.

public static WideLane<TNumber> operator *(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first lane value.

b WideLane<TNumber>

The second lane value.

Returns

WideLane<TNumber>

The lane-wise product.

operator ~(WideLane<TNumber>)

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

public static WideLane<TNumber> operator ~(WideLane<TNumber> a)

Parameters

a WideLane<TNumber>

The lane value.

Returns

WideLane<TNumber>

The bitwise complement of the lane value.

operator -(WideLane<TNumber>, WideLane<TNumber>)

Subtracts two lane values element-wise.

public static WideLane<TNumber> operator -(WideLane<TNumber> a, WideLane<TNumber> b)

Parameters

a WideLane<TNumber>

The first lane value.

b WideLane<TNumber>

The second lane value.

Returns

WideLane<TNumber>

The lane-wise difference.

operator -(WideLane<TNumber>)

Negates the lane value element-wise.

public static WideLane<TNumber> operator -(WideLane<TNumber> a)

Parameters

a WideLane<TNumber>

The lane value to negate.

Returns

WideLane<TNumber>

The negated lane value.