nlib
nn::nlib::simd::F128 Class Reference

The class for single-precision floating point SIMD computations using128-bit registers (MM0-XMM15 for SSE, and Q0-Q15 for NEON). More...

#include "nn/nlib/simd/SimdFloat.h"

Static Public Member Functions

template<size_t N>
static f128 SetZeroToLane (f128arg value) noexcept
 Sets lane N of value to 0.f. More...
 
Setting Values to All Lanes
static f128 SetValue (float v, each_float_tag) noexcept
 Sets four 32-bit lanes to a single-precision floating point value.
 
static f128 SetValue (uint32_t v, each_uint32_tag) noexcept
 Sets four 32-bit lanes to an unsigned 32-bit integer.
 
static f128 SetValue (float a, float b, float c, float d) noexcept
 Sets four 32-bit lanes to separate single-precision floating point numbers.
 
template<size_t N>
static f128 SetValue (f128arg value, each_select32_tag) noexcept
 Sets all lanes to the single-precision floating point value of lane N of the value argument. More...
 
static f128 SetZero () noexcept
 Sets all lanes to 0.f.
 
static f128 SetOne () noexcept
 Sets all lanes to 1.f.
 
static f128 SetNegativeOne () noexcept
 Sets all lanes to 1.f.
 
static f128 SetEpsilon () noexcept
 Sets all lanes to epsilon(1.0e-7f).
 
static f128 SetInfinity () noexcept
 Sets all lanes to positive infinity (0x7F800000U).
 
static f128 SetNaN () noexcept
 Sets all lanes to NaN(0x7FC00000U).
 
static f128 SetSignMask () noexcept
 Sets all lanes to -0.f (0x80000000U).
 
Loading From Memory
static f128 LoadA16 (const float *p) noexcept
 Loads 16 bytes of data from the 16-byte-aligned address p and sets the value. The argument type is either uintptr_t or intptr_t.
 
static f128 LoadA8 (const float *p) noexcept
 Loads 8 bytes of data from the 16-byte-aligned address p and sets the value. The argument type is either uintptr_t or intptr_t.
 
static f128 LoadA4 (const float *p) noexcept
 Loads 4 bytes of data from the 16-byte-aligned address p and sets the value. The argument type is either uintptr_t or intptr_t.
 
static f128 LoadA16 (uintptr_t p) noexcept
 Wraps LoadA16(const float* p).
 
static f128 LoadA8 (uintptr_t p) noexcept
 Wraps LoadA8(const float* p).
 
static f128 LoadA4 (uintptr_t p) noexcept
 Wraps LoadA4(const float* p) .
 
static f128 LoadA16 (intptr_t p) noexcept
 Wraps LoadA16(const float* p).
 
static f128 LoadA8 (intptr_t p) noexcept
 Wraps LoadA8(const float* p).
 
static f128 LoadA4 (intptr_t p) noexcept
 Wraps LoadA4(const float* p) .
 
Storing to Memory
static void StoreA16 (float *p, f128arg value) noexcept
 Writes the 16 bytes of data of value to the 16-byte-aligned address specified in the p parameter. The argument type is either uintptr_t or intptr_t.
 
static void StoreA8 (float *p, f128arg value) noexcept
 Writes the 8 bytes of data of value to the 16-byte-aligned address specified in the p parameter. The argument type is either uintptr_t or intptr_t.
 
static void StoreA4 (float *p, f128arg value) noexcept
 Writes the 4 bytes of data of value to the 16-byte-aligned address specified in the p parameter. The argument type is either uintptr_t or intptr_t.
 
static void StoreA16 (uintptr_t p, f128arg value) noexcept
 Wraps StoreA16(float* p, f128arg value).
 
static void StoreA8 (uintptr_t p, f128arg value) noexcept
 Wraps StoreA8(float* p, f128arg value).
 
static void StoreA4 (uintptr_t p, f128arg value) noexcept
 Wraps StoreA4(float* p, f128arg value).
 
static void StoreA16 (intptr_t p, f128arg value) noexcept
 Wraps StoreA16(float* p, f128arg value).
 
static void StoreA8 (intptr_t p, f128arg value) noexcept
 Wraps StoreA8(float* p, f128arg value).
 
static void StoreA4 (intptr_t p, f128arg value) noexcept
 Wraps StoreA4(float* p, f128arg value).
 
static void StoreLoA8 (float *p, f128arg value) noexcept
 Writes the lower 64 bits of value to the 8-byte-aligned address specified in the p parameter. The argument type is either uintptr_t or intptr_t.
 
static void StoreLoA4 (float *p, f128arg value) noexcept
 Writes the lower 64 bits of value to the 4-byte-aligned address specified in the p parameter. The argument type is either uintptr_t or intptr_t.
 
static void StoreLoA8 (uintptr_t p, f128arg value) noexcept
 Wraps StoreLoA8(float* p, f128arg value).
 
static void StoreLoA4 (uintptr_t p, f128arg value) noexcept
 Wraps StoreLoA4(float* p, f128arg value).
 
static void StoreLoA8 (intptr_t p, f128arg value) noexcept
 Wraps StoreLoA8(float* p, f128arg value).
 
static void StoreLoA4 (intptr_t p, f128arg value) noexcept
 Wraps StoreLoA4(float* p, f128arg value).
 
static void StoreHiA8 (float *p, f128arg value) noexcept
 Writes the upper 64 bits of value to the 8-byte-aligned address specified in the p parameter. The argument type is either uintptr_t or intptr_t.
 
static void StoreHiA4 (float *p, f128arg value) noexcept
 Writes the upper 64 bits of value to the 4-byte-aligned address specified in the p parameter. The argument type is either uintptr_t or intptr_t.
 
static void StoreHiA8 (uintptr_t p, f128arg value) noexcept
 Wraps StoreHiA8(float* p, f128arg value).
 
static void StoreHiA4 (uintptr_t p, f128arg value) noexcept
 Wraps StoreHiA4(float* p, f128arg value).
 
static void StoreHiA8 (intptr_t p, f128arg value) noexcept
 Wraps StoreHiA8(float* p, f128arg value).
 
static void StoreHiA4 (intptr_t p, f128arg value) noexcept
 Wraps StoreHiA4(float* p, f128arg value).
 
Integer Type Conversion
static f128 ConvertFromI128 (i128 value) noexcept
 Converts the set of 32-bit signed integers from value into single-precision floating point numbers and returns those numbers. More...
 
static i128 ConvertToI128Round (f128 value) noexcept
 Converts value into four 32-bit signed integers. The decimal portion is rounded to zero. More...
 
static i128 ConvertToI128Truncate (f128 value) noexcept
 Converts value into four 32-bit signed integers. The decimal portion is truncated to zero. More...
 
static f128 CastFromI128 (i128 value) noexcept
 Converts all of the bits of value to f128. More...
 
static i128 CastToI128 (f128 value) noexcept
 Converts all of the bits of value to i128. More...
 
template<int N>
static f128 ConvertFromFixedPoint (i128arg value) noexcept
 Converts four fixed point numbers to four single-precision floating point numbers. More...
 
template<int N>
static i128 ConvertToFixedPoint (f128arg value) noexcept
 Converts four single-precision floating point numbers to four fixed point numbers. More...
 
Addition, Subtraction, Multiplication, Division, and Absolute Values
static f128 Add (f128arg a, f128arg b) noexcept
 Adds the floating point numbers in the same lanes of a and b and returns the results.
 
static f128 Sub (f128arg a, f128arg b) noexcept
 Subtracts the floating point numbers in the same lanes of a and b and returns the results.
 
static f128 Mult (f128arg a, f128arg b) noexcept
 Multiplies the floating point numbers in the same lanes of a and b and returns the results.
 
static f128 Mult (float a, f128arg b) noexcept
 Multiplies each lane of b by a and returns the results.
 
template<size_t N>
static f128 Mult (f128arg a, f128arg b, each_select32_tag) noexcept
 Performs multiplication corresponding to a[N] * b.
 
static f128 Div (f128arg a, f128arg b) noexcept
 Divides the floating point numbers in the same lanes of a and b and returns the results. If this involves division by zero, the function returns either positive infinity or negative infinity.
 
static f128 Negate (f128arg value) noexcept
 Reverses the signs of the floating-point numbers in the lanes of the value argument.
 
template<bool NegateLane0, bool NegateLane1, bool NegateLane2, bool NegateLane3>
static f128 NegateEx (f128arg value) noexcept
 Reverses the signs of the lanes of value. It's possible to set whether to reverse the sign for each lane separately. More...
 
static f128 MultAdd (f128arg a, f128arg b, f128arg c) noexcept
 Performs a product-sum operation corresponding to c + a * b.
 
static f128 MultAdd (float a, f128arg b, f128arg c) noexcept
 Performs a product-sum operation corresponding to c + a * b.
 
template<size_t N>
static f128 MultAdd (f128arg a, f128arg b, f128arg c, each_select32_tag) noexcept
 Performs a product-sum operation corresponding to c + a[N] * b.
 
static f128 MultSub (f128arg a, f128arg b, f128arg c) noexcept
 Performs a product-sum operation corresponding to c - a * b.
 
static f128 MultSub (float a, f128arg b, f128arg c) noexcept
 Performs a product-sum operation corresponding to c - a * b.
 
template<size_t N>
static f128 MultSub (f128arg a, f128arg b, f128arg c, each_select32_tag) noexcept
 Performs a product-sum operation corresponding to c - a[N] * b.
 
static f128 PairwiseAdd (f128arg a, f128arg b) noexcept
 Performs horizontal addition on a and b and collects the results into a single 128-bit value. More...
 
static f128 Abs (f128arg value) noexcept
 Computes the absolute values for the lanes of value and returns the results.
 
static f128 AbsDiff (f128arg a, f128arg b) noexcept
 Computes the absolute values for the differences between the lanes of a and b and returns the results.
 
Maximums and Minimums
static f128 Max (f128arg a, f128arg b) noexcept
 Compares the values in the same lanes of the a and b arguments, and selects and returns the larger value. More...
 
static f128 Min (f128arg a, f128arg b) noexcept
 Compares the values in the same lanes of the a and b arguments, and selects and returns the larger value. More...
 
static f128 PairwiseMax (f128arg a, f128arg b) noexcept
 Compares the values in adjacent lanes of the a and b arguments, and selects and returns the larger of them. More...
 
static f128 PairwiseMin (f128arg a, f128arg b) noexcept
 Compares the values in adjacent lanes of the a and b arguments, and selects and returns the smaller of them. More...
 
static f128 Clamp (f128arg value, f128arg min, f128arg max) noexcept
 Returns the clamped values for each lane of value, clamping each value to either min if it is less than the value of the same lane of min, or to max if it is larger than the value of the same lane of max. More...
 
static f128 Saturate (f128arg value) noexcept
 Clamps the value of each lane of value using 0.0 and 1.0.
 
Reciprocals and Square Roots
static f128 Recp (f128arg value) noexcept
 Computes the reciprocal values for each lane of value. If this involves division by zero, the function returns positive infinity. More...
 
static f128 RecpEst (f128arg value) noexcept
 Computes the reciprocal values for each lane of value relatively quickly but with low precision. If this involves division by zero, the function returns positive infinity. More...
 
static f128 Sqrt (f128arg value) noexcept
 Computes the square root for each lane of value. More...
 
static f128 SqrtEst (f128arg value) noexcept
 Computes the square root for each lane of value relatively quickly but with low precision. More...
 
static f128 RecpSqrt (f128arg value) noexcept
 Computes the reciprocal square root for each lane of value. If this involves division by zero, the function returns positive infinity. More...
 
static f128 RecpSqrtEst (f128arg value) noexcept
 Computes the reciprocal square root for each lane of value relatively quickly but with low precision. If this involves division by zero, the function returns positive infinity. More...
 
Rounding Values
static f128 Round (f128arg value) noexcept
 Computes the single-precision floating-point value for each lane of value and rounds off the decimal point. More...
 
static f128 Truncate (f128arg value) noexcept
 Computes the single-precision floating-point value for each lane of value, with the decimal portion truncated to zero. More...
 
static f128 Floor (f128arg value) noexcept
 Computes the largest integer value that is less than the single-precision floating point number in each lane of value. More...
 
static f128 Ceil (f128arg value) noexcept
 Computes the smallest integer value that is greater than the single-precision floating point number in each lane of value. More...
 
Logical Operations
static f128 And (f128arg a, f128arg b) noexcept
 Calculates the bitwise AND of the a and b arguments.
 
static f128 Or (f128arg a, f128arg b) noexcept
 Calculates the bitwise OR of the a and b arguments.
 
static f128 Xor (f128arg a, f128arg b) noexcept
 Calculates the bitwise XOR of the a and b arguments.
 
static f128 Not (f128arg a) noexcept
 Calculates the bitwise NOT of the a argument.
 
static f128 AndNot (f128arg a, f128arg b) noexcept
 Calculates the bitwise NOT of the a argument, and the bitwise AND of the b argument. More...
 
static f128 OrNot (f128arg a, f128arg b) noexcept
 Calculates the bitwise NOT of the a argument, and the bitwise OR of the b argument. More...
 
Comparisons
static f128 CmpEq (f128arg a, f128arg b) noexcept
 Compares a and b in units of single-precision floating-point numbers and sets the bits according to the results of the comparison. More...
 
static f128 CmpLt (f128arg a, f128arg b) noexcept
 Compares a and b in units of single-precision floating-point numbers and sets the bits according to the results of the comparison. More...
 
static f128 CmpLe (f128arg a, f128arg b) noexcept
 Compares a and b in units of single-precision floating-point numbers and sets the bits according to the results of the comparison. More...
 
static f128 CmpGt (f128arg a, f128arg b) noexcept
 Compares a and b in units of single-precision floating-point numbers and sets the bits according to the results of the comparison. More...
 
static f128 CmpGe (f128arg a, f128arg b) noexcept
 Compares a and b in units of single-precision floating-point numbers and sets the bits according to the results of the comparison. More...
 
static f128 CmpNe (f128arg a, f128arg b) noexcept
 Compares a and b in units of single-precision floating-point numbers and sets the bits according to the results of the comparison. More...
 
static f128 CmpNearEq (f128arg a, f128arg b, f128arg eps) noexcept
 Determines whether the difference between a and b is within eps, and sets the bits according to the results of the comparison. More...
 
static f128 InBound (f128arg value, f128arg bounds) noexcept
 Determines whether the individual absolute values of value can fit in bounds, and sets the bits according to the results of the comparison. More...
 
static f128 CmpEqZero (f128arg value) noexcept
 The same meaning as F128::CmpEq(value, F128::SetZero()).
 
static f128 CmpLtZero (f128arg value) noexcept
 The same meaning as F128::CmpLt(value, F128::SetZero()).
 
static f128 CmpLeZero (f128arg value) noexcept
 The same meaning as F128::CmpLe(value, F128::SetZero()).
 
static f128 CmpGtZero (f128arg value) noexcept
 The same meaning as F128::CmpGt(value, F128::SetZero()).
 
static f128 CmpGeZero (f128arg value) noexcept
 The same meaning as F128::CmpGe(value, F128::SetZero()).
 
static f128 CmpNeZero (f128arg value) noexcept
 The same meaning as F128::CmpNe(value, F128::SetZero())).
 
static f128 CmpNearEqZero (f128arg value, f128arg eps) noexcept
 The same meaning as F128::CmpNearEq(value, F128::SetZero(), eps).
 
Trigonometric Functions
static f128 AddAngle (f128arg angle1, f128arg angle2) noexcept
 Adds the four radians stored in the separate lanes. The results are normalized to values greater than and less than π. More...
 
static f128 SubAngle (f128arg angle1, f128arg angle2) noexcept
 Subtracts the four radians stored in the separate lanes. The results are normalized to values greater than and less than π. More...
 
static f128 ModAngle (f128arg value) noexcept
 Normalizes the four radians stored in each lane to values greater than and less than π.
 
static f128 Sin (f128arg value) noexcept
 Calculates the sine corresponding to the radians stored in each lane.
 
static f128 Cos (f128arg value) noexcept
 Calculates the cosine corresponding to the radians stored in each lane.
 
static f128x2 SinCos (f128arg value) noexcept
 Calculates and returns the sine and the cosine. The return value for the sine is stored in val[0], and the value for the cosine is stored in val[1].
 
static f128 Tan (f128arg value) noexcept
 Calculates the tangent corresponding to the radians stored in each lane.
 
static f128 SinH (f128arg value) noexcept
 Calculates the hyperbolic sine for each lane value.
 
static f128 CosH (f128arg value) noexcept
 Calculates the hyperbolic cosine for each lane value.
 
static f128 TanH (f128arg value) noexcept
 Calculates the hyperbolic tangent for each lane value.
 
static f128 ArcSin (f128arg value) noexcept
 Calculates the arcsine for each lane.
 
static f128 ArcCos (f128arg value) noexcept
 Calculates the arccosine for each lane.
 
static f128 ArcTan (f128arg value) noexcept
 Calculates the arctangent for each lane.
 
static f128 ArcTan2 (f128arg y, f128arg x) noexcept
 Calculates the arctangents for y / x. More...
 
static f128 Exp2 (f128arg value) noexcept
 Calculates 2 to the power of value for each lane, and stores the result in each lane. More...
 
static f128 ExpE (f128arg value) noexcept
 Calculates e to the power of value for each lane, and stores the result in each lane. More...
 
static f128 Log2 (f128arg value) noexcept
 Calculates the binary logarithm for each lane.
 
static f128 LogE (f128arg value) noexcept
 Calculates the 'e' logarithm (the natural logarithm) for each lane.
 
Interpolation
static f128 Lerp (f128arg a, f128arg b, f128arg t) noexcept
 Performs linear interpolation on the values in each lane of a and b. More...
 
static f128 Hermite (f128arg p0, f128arg v0, f128arg p1, f128arg_ex v1, f128arg_ex t) noexcept
 Performs Hermite interpolation using the specified arguments. More...
 
static f128 CatmullRom (f128arg p0, f128arg p1, f128arg p2, f128arg_ex p3, f128arg_ex t) noexcept
 Performs Catmull-Rom interpolation using the specified arguments. More...
 
static f128 BaryCentric (f128arg p0, f128arg p1, f128arg p2, f128arg_ex f, f128arg_ex g) noexcept
 Performs barycentric interpolation using the specified arguments. More...
 
Others
static int MoveMask (f128arg value) noexcept
 Consolidates the various 32-bit lanes into a 1-bit value and returns it as an integer. More...
 
static bool IsAllMaskFalse (f128arg value) noexcept
 Checks whether the results of all logical operations are all false. More...
 
static bool IsAllMaskTrue (f128arg value) noexcept
 Checks whether the results of all logical operations are all true. More...
 
static f128 Select (f128arg mask, f128arg a, f128arg b) noexcept
 Compounds a and b according to the value of mask. Use this function to avoid conditional branching. More...
 
static f128 IsNaN (f128arg value) noexcept
 If the single-precision floating-point numbers in the lane of value are non-numeric, all bits in that lane are set to 1. More...
 
static f128 IsInfinite (f128arg value) noexcept
 If the single-precision floating-point numbers in the lane of value are either positive infinity or negative infinity, all bits in that lane are set to 1. More...
 
Getting and Setting Values of Specific Lanes
template<size_t N>
static float GetFloatFromLane (f128arg value) noexcept
 Gets the single-precision floating-point numbers of lane N of value. More...
 
template<size_t N>
static uint32_t GetUint32FromLane (f128arg value) noexcept
 Gets the bit pattern of the single-precision floating-point numbers in lane N of value as a 32-bit unsigned integer. More...
 
static float GetFloatByIndex (f128arg value, size_t idx) noexcept
 Gets the single-precision floating-point numbers of lane idx of value. More...
 
static uint32_t GetUint32ByIndex (f128arg value, size_t idx) noexcept
 Gets the unsigned 32-bit integer from lane idx of value. More...
 
template<size_t N>
static f128 SetFloatToLane (f128arg value, float v) noexcept
 Returns the single-precision floating point numbers of lane N of value that were set to v. More...
 
static f128 SetFloatByIndex (f128arg value, float v, size_t i) noexcept
 Returns the single-precision floating point numbers of lane i of value that were set to v. More...
 
Sorting Elements
template<int V0, int V1, int V2, int V3>
static f128 Swizzle (f128arg value) noexcept
 Generates a new 128-bit value from four sorted single-precision floating-point numbers. You can specify -1 if arbitrary values generated do not matter. More...
 
template<int V0, int V1, int V2, int V3>
static f128 Permute (f128arg a, f128arg b) noexcept
 Generates a new 128-bit value from eight sorted single-precision floating-point numbers. You can specify -1 if arbitrary values generated do not matter. More...
 
template<bool SplatLane0, bool SplatLane1, bool SplatLane2, bool SplatLane3>
static f128 Splat (f128arg value, f128arg splat) noexcept
 Based on the settings of the template arguments, replaces the values of the lanes of value with the values of splat. All lanes must have the same splat values. More...
 
template<size_t N>
static f128 RotateLeft (f128arg value) noexcept
 Rotates four single-precision floating-point numbers to the left by the amount of N. More...
 
template<size_t N>
static f128 RotateRight (f128arg value) noexcept
 Rotates four single-precision floating-point numbers to the right by the amount of N. More...
 
template<size_t N>
static f128 ShiftRight (f128arg a, f128arg b) noexcept
 Sets the elements of b in shifted order to the portion of a that becomes empty when a is shifted to the right. More...
 

Detailed Description

The class for single-precision floating point SIMD computations using128-bit registers (MM0-XMM15 for SSE, and Q0-Q15 for NEON).

Description
Functions are implemented to independently calculate what are in general packed floating-point values.
The class can be used even in environments that do not support SSE or NEON, but with suboptimal performance.
All members of this class are static functions. The class cannot be instantiated.

Definition at line 80 of file SimdFloat.h.

Member Function Documentation

§ AddAngle()

nn::nlib::simd::F128::AddAngle ( f128arg  angle1,
f128arg  angle2 
)
staticnoexcept

Adds the four radians stored in the separate lanes. The results are normalized to values greater than and less than π.

Parameters
[in]angle1Four single-precision floating point numbers (radians).
[in]angle2Four single-precision floating point numbers (radians).
Returns
Four single-precision floating point numbers (radians).
Description
The radians stored in each lane for angle1 , angle2 must be greater than or equal to -π and less than π.

§ AndNot()

nn::nlib::simd::F128::AndNot ( f128arg  a,
f128arg  b 
)
staticnoexcept

Calculates the bitwise NOT of the a argument, and the bitwise AND of the b argument.

Parameters
[in]aA 128-bit value.
[in]bA 128-bit value.
Returns
Returns ~a & b.

§ ArcTan2()

nn::nlib::simd::F128::ArcTan2 ( f128arg  y,
f128arg  x 
)
staticnoexcept

Calculates the arctangents for y / x.

Parameters
[in]yFour single-precision floating point numbers.
[in]xFour single-precision floating point numbers.
Returns
Four single-precision floating point numbers (arctangents).
Description
Values like those shown below are returned for boundary values. Here /"sign(<em>y</em>)\" is a symbol for /a y.
y x Value
0 - sign(y) * π
0 + sign(y) * 0
y sign(y) * 0
y -∞ sign(y) * π
y ≠ 0 0 sign(y) * π/2
y ≠ 0 - sign(y) * (atan(y/x) + π)
±∞ x sign(y) * π/2
±∞ sign(y) * (π / 4)
±∞ -∞ sign(y) * (π * 3 / 4)
otherwise otherwise atan(y/x)

§ BaryCentric()

nn::nlib::simd::F128::BaryCentric ( f128arg  p0,
f128arg  p1,
f128arg  p2,
f128arg_ex  f,
f128arg_ex  g 
)
staticnoexcept

Performs barycentric interpolation using the specified arguments.

Parameters
[in]p0Four single-precision floating point numbers (position 0).
[in]p1Four single-precision floating point numbers (position 1).
[in]p2Four single-precision floating point numbers (position 2).
[in]fFour single-precision floating point numbers (interpolation coefficients).
[in]gFour single-precision floating point numbers (interpolation coefficients).
Returns
Returns four barycentric interpolated single-precision floating point numbers. The pseudocode is similar to the following.
rval[0] = p0[0] + f[0] * (p1[0] - p0[0]) + g[0] * (p2[0] - p0[0])
.....

§ CastFromI128()

nn::nlib::simd::F128::CastFromI128 ( i128  value)
staticnoexcept

Converts all of the bits of value to f128.

Parameters
[in]valueA128-bit value.
Returns
Four single-precision floating point numbers.

§ CastToI128()

nn::nlib::simd::F128::CastToI128 ( f128  value)
staticnoexcept

Converts all of the bits of value to i128.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
A 128-bit value.

§ CatmullRom()

nn::nlib::simd::F128::CatmullRom ( f128arg  p0,
f128arg  p1,
f128arg  p2,
f128arg_ex  p3,
f128arg_ex  t 
)
staticnoexcept

Performs Catmull-Rom interpolation using the specified arguments.

Parameters
[in]p0Four single-precision floating point numbers (position 0).
[in]p1Four single-precision floating point numbers (position 1).
[in]p2Four single-precision floating point numbers (position 2).
[in]p3Four single-precision floating point numbers (position 3).
[in]tFour single-precision floating point numbers (interpolation coefficients).
Returns
Returns four Catmull-Rom interpolated single-precision floating point numbers. The pseudocode is similar to the following.
rval[0] = (-t[0]^3 + 2 * t[0]^2 - t[0]) * p0[0] +
(3 * t[0]^3 - 5 * t[0]^2 + 2) * p1[0] +
(-3 * t[0]^3 + 4 * t[0]^2 + t) * p2[0] +
(t[0]^3 - t[0]^2)
rval[0] *= 0.5
......

§ Ceil()

nn::nlib::simd::F128::Ceil ( f128arg  value)
staticnoexcept

Computes the smallest integer value that is greater than the single-precision floating point number in each lane of value.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Returns four single-precision floating point numbers.
Description
For example, 6.54321 becomes 7.0, and -6.54321 becomes -6.0.

§ Clamp()

nn::nlib::simd::F128::Clamp ( f128arg  value,
f128arg  min,
f128arg  max 
)
staticnoexcept

Returns the clamped values for each lane of value, clamping each value to either min if it is less than the value of the same lane of min, or to max if it is larger than the value of the same lane of max.

Parameters
[in]valueFour single-precision floating point numbers.
[in]minFour single-precision floating point numbers.
[in]maxFour single-precision floating point numbers.
Returns
Returns four single-precision floating point numbers. The pseudocode is similar to the following.
if (value[0] < min[0]) rval[0] = min[0]
else if (value[0] > max[0]) rval[0] = max[0]
else rval[0] = value[0]
.....

§ CmpEq()

nn::nlib::simd::F128::CmpEq ( f128arg  a,
f128arg  b 
)
staticnoexcept

Compares a and b in units of single-precision floating-point numbers and sets the bits according to the results of the comparison.

Parameters
[in]aFour single-precision floating point numbers.
[in]bFour single-precision floating point numbers.
Returns
Four 32-bit values (a mask). The pseudocode returns values similar to the following.
r[0] = a[0] == b[0] ? 0xFFFFFFFF : 0x00000000
r[1] = a[1] == b[1] ? 0xFFFFFFFF : 0x00000000
r[2] = a[2] == b[2] ? 0xFFFFFFFF : 0x00000000
r[3] = a[3] == b[3] ? 0xFFFFFFFF : 0x00000000

§ CmpGe()

nn::nlib::simd::F128::CmpGe ( f128arg  a,
f128arg  b 
)
staticnoexcept

Compares a and b in units of single-precision floating-point numbers and sets the bits according to the results of the comparison.

Parameters
[in]aFour single-precision floating point numbers.
[in]bFour single-precision floating point numbers.
Returns
Four 32-bit values (a mask). The pseudocode returns values similar to the following.
r[0] = a[0] >= b[0] ? 0xFFFFFFFF : 0x00000000
r[1] = a[1] >= b[1] ? 0xFFFFFFFF : 0x00000000
r[2] = a[2] >= b[2] ? 0xFFFFFFFF : 0x00000000
r[3] = a[3] >= b[3] ? 0xFFFFFFFF : 0x00000000

§ CmpGt()

nn::nlib::simd::F128::CmpGt ( f128arg  a,
f128arg  b 
)
staticnoexcept

Compares a and b in units of single-precision floating-point numbers and sets the bits according to the results of the comparison.

Parameters
[in]aFour single-precision floating point numbers.
[in]bFour single-precision floating point numbers.
Returns
Four 32-bit values (a mask). The pseudocode returns values similar to the following.
r[0] = a[0] > b[0] ? 0xFFFFFFFF : 0x00000000
r[1] = a[1] > b[1] ? 0xFFFFFFFF : 0x00000000
r[2] = a[2] > b[2] ? 0xFFFFFFFF : 0x00000000
r[3] = a[3] > b[3] ? 0xFFFFFFFF : 0x00000000

§ CmpLe()

nn::nlib::simd::F128::CmpLe ( f128arg  a,
f128arg  b 
)
staticnoexcept

Compares a and b in units of single-precision floating-point numbers and sets the bits according to the results of the comparison.

Parameters
[in]aFour single-precision floating point numbers.
[in]bFour single-precision floating point numbers.
Returns
Four 32-bit values (a mask). The pseudocode returns values similar to the following.
r[0] = a[0] <= b[0] ? 0xFFFFFFFF : 0x00000000
r[1] = a[1] <= b[1] ? 0xFFFFFFFF : 0x00000000
r[2] = a[2] <= b[2] ? 0xFFFFFFFF : 0x00000000
r[3] = a[3] <= b[3] ? 0xFFFFFFFF : 0x00000000

§ CmpLt()

nn::nlib::simd::F128::CmpLt ( f128arg  a,
f128arg  b 
)
staticnoexcept

Compares a and b in units of single-precision floating-point numbers and sets the bits according to the results of the comparison.

Parameters
[in]aFour single-precision floating point numbers.
[in]bFour single-precision floating point numbers.
Returns
Four 32-bit values (a mask). The pseudocode returns values similar to the following.
r[0] = a[0] < b[0] ? 0xFFFFFFFF : 0x00000000
r[1] = a[1] < b[1] ? 0xFFFFFFFF : 0x00000000
r[2] = a[2] < b[2] ? 0xFFFFFFFF : 0x00000000
r[3] = a[3] < b[3] ? 0xFFFFFFFF : 0x00000000

§ CmpNe()

nn::nlib::simd::F128::CmpNe ( f128arg  a,
f128arg  b 
)
staticnoexcept

Compares a and b in units of single-precision floating-point numbers and sets the bits according to the results of the comparison.

Parameters
[in]aFour single-precision floating point numbers.
[in]bFour single-precision floating point numbers.
Returns
Four 32-bit values (a mask). The pseudocode returns values similar to the following.
r[0] = a[0] != b[0] ? 0xFFFFFFFF : 0x00000000
r[1] = a[1] != b[1] ? 0xFFFFFFFF : 0x00000000
r[2] = a[2] != b[2] ? 0xFFFFFFFF : 0x00000000
r[3] = a[3] != b[3] ? 0xFFFFFFFF : 0x00000000

§ CmpNearEq()

nn::nlib::simd::F128::CmpNearEq ( f128arg  a,
f128arg  b,
f128arg  eps 
)
staticnoexcept

Determines whether the difference between a and b is within eps, and sets the bits according to the results of the comparison.

Parameters
[in]aFour single-precision floating point numbers.
[in]bFour single-precision floating point numbers.
[in]epsFour single-precision floating point numbers.
Returns
Four 32-bit values (a mask). The pseudocode returns values similar to the following.
r[0] = abs(a[0] - b[0]) < eps[0] ? 0xFFFFFFFF : 0x00000000
r[1] = abs(a[1] - b[1]) < eps[1] ? 0xFFFFFFFF : 0x00000000
r[2] = abs(a[2] - b[2]) < eps[2] ? 0xFFFFFFFF : 0x00000000
r[3] = abs(a[3] - b[3]) < eps[3] ? 0xFFFFFFFF : 0x00000000

§ ConvertFromFixedPoint()

template<int N>
nn::nlib::simd::F128::ConvertFromFixedPoint ( i128arg  value)
staticnoexcept

Converts four fixed point numbers to four single-precision floating point numbers.

Template Parameters
NThe decimal point position of fixed point numbers.
Parameters
[in]valueFour 32-bit signed integers.
Returns
Four single-precision floating point numbers.
Description
The following pseudocode represents the behavior of this function:
r[0] = static_cast<float>(value32[0]) * powf(0.5, N);
r[1] = static_cast<float>(value32[1]) * powf(0.5, N);
r[2] = static_cast<float>(value32[2]) * powf(0.5, N);
r[3] = static_cast<float>(value32[3]) * powf(0.5, N);

§ ConvertFromI128()

nn::nlib::simd::F128::ConvertFromI128 ( i128  value)
staticnoexcept

Converts the set of 32-bit signed integers from value into single-precision floating point numbers and returns those numbers.

Parameters
[in]valueFour 32-bit signed integers.
Returns
Four single-precision floating point numbers.

§ ConvertToFixedPoint()

template<int N>
nn::nlib::simd::F128::ConvertToFixedPoint ( f128arg  value)
staticnoexcept

Converts four single-precision floating point numbers to four fixed point numbers.

Template Parameters
NThe decimal point position of fixed point numbers.
Parameters
[in]valueFour single-precision floating point numbers.
Returns
Four 32-bit signed integers.
Description
The following pseudocode represents the behavior of this function:
r32[0] = static_cast<int>(value[0] * powf(2.f, N));
r32[1] = static_cast<int>(value[1] * powf(2.f, N));
r32[2] = static_cast<int>(value[2] * powf(2.f, N));
r32[3] = static_cast<int>(value[3] * powf(2.f, N));

§ ConvertToI128Round()

nn::nlib::simd::F128::ConvertToI128Round ( f128  value)
staticnoexcept

Converts value into four 32-bit signed integers. The decimal portion is rounded to zero.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Four 32-bit signed integers.

§ ConvertToI128Truncate()

nn::nlib::simd::F128::ConvertToI128Truncate ( f128  value)
staticnoexcept

Converts value into four 32-bit signed integers. The decimal portion is truncated to zero.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Four 32-bit signed integers.

§ Exp2()

nn::nlib::simd::F128::Exp2 ( f128arg  value)
staticnoexcept

Calculates 2 to the power of value for each lane, and stores the result in each lane.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Four single-precision floating point numbers.
Description
There is no checking of input arguments for this function or provision for overflows.

§ ExpE()

nn::nlib::simd::F128::ExpE ( f128arg  value)
staticnoexcept

Calculates e to the power of value for each lane, and stores the result in each lane.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Four single-precision floating point numbers.
Description
There is no checking of input arguments for this function or provision for overflows.

§ Floor()

nn::nlib::simd::F128::Floor ( f128arg  value)
staticnoexcept

Computes the largest integer value that is less than the single-precision floating point number in each lane of value.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Returns four single-precision floating point numbers.
Description
For example, 6.54321 becomes 6.0, and -6.54321 becomes -7.0.

§ GetFloatByIndex()

nn::nlib::simd::F128::GetFloatByIndex ( f128arg  value,
size_t  idx 
)
staticnoexcept

Gets the single-precision floating-point numbers of lane idx of value.

Parameters
[in]valueFour single-precision floating point numbers.
[in]idxAn integer between 0 and 3 that specifies which lane to get.
Returns
Returns the single-precision floating point numbers stored in the specified lane.

§ GetFloatFromLane()

template<size_t N>
nn::nlib::simd::F128::GetFloatFromLane ( f128arg  value)
staticnoexcept

Gets the single-precision floating-point numbers of lane N of value.

Template Parameters
TThe lane value. Specify an integer between 0 and 3.
Parameters
[in]valueFour single-precision floating point numbers.
Returns
Returns the single-precision floating point numbers stored in the specified lane.

§ GetUint32ByIndex()

nn::nlib::simd::F128::GetUint32ByIndex ( f128arg  value,
size_t  idx 
)
staticnoexcept

Gets the unsigned 32-bit integer from lane idx of value.

Parameters
[in]valueFour single-precision floating point numbers.
[in]idxAn integer between 0 and 3 that specifies which lane to get.
Returns
The single-precision floating-point numbers stored in the specified lane, cast to an unsigned 32-bit integer.

§ GetUint32FromLane()

template<size_t N>
nn::nlib::simd::F128::GetUint32FromLane ( f128arg  value)
staticnoexcept

Gets the bit pattern of the single-precision floating-point numbers in lane N of value as a 32-bit unsigned integer.

Template Parameters
TThe lane value. Specify an integer between 0 and 3.
Parameters
[in]valueFour single-precision floating point numbers.
Returns
Returns the 32-bit unsigned integer stored in the specified lane.

§ Hermite()

nn::nlib::simd::F128::Hermite ( f128arg  p0,
f128arg  v0,
f128arg  p1,
f128arg_ex  v1,
f128arg_ex  t 
)
staticnoexcept

Performs Hermite interpolation using the specified arguments.

Parameters
[in]p0Four single-precision floating point numbers (interpolation starting point).
[in]v0Four single-precision floating point numbers (the normal vector for p0).
[in]p1Four single-precision floating point numbers (interpolation ending point).
[in]v1Four single-precision floating point numbers (the normal vector for p1).
[in]tFour single-precision floating point numbers (interpolation coefficients).
Returns
Returns four Hermite interpolated single-precision floating point numbers. The pseudocode is similar to the following.
rval[0] = (2 * t[0]^3 - 3 * t[0]^2 + 1) * p0[0] +
(t[0]^3 - 2 * t[0]^2 + t[0]) * v0[0] +
(-2 * t[0]^3 + 3 * t[0]^2) * p1[0] +
(t[0]^3 - t[0]^2) * v1[0]
.....

§ InBound()

nn::nlib::simd::F128::InBound ( f128arg  value,
f128arg  bounds 
)
staticnoexcept

Determines whether the individual absolute values of value can fit in bounds, and sets the bits according to the results of the comparison.

Parameters
[in]valueFour single-precision floating point numbers.
[in]boundsFour single-precision floating point numbers.
Returns
Four 32-bit values (a mask). The pseudocode returns values similar to the following.
r[0] = abs(value[0]) < bounds[0] ? 0xFFFFFFFF : 0x00000000
r[1] = abs(value[1]) < bounds[1] ? 0xFFFFFFFF : 0x00000000
r[2] = abs(value[2]) < bounds[2] ? 0xFFFFFFFF : 0x00000000
r[3] = abs(value[3]) < bounds[3] ? 0xFFFFFFFF : 0x00000000

§ IsAllMaskFalse()

nn::nlib::simd::F128::IsAllMaskFalse ( f128arg  value)
staticnoexcept

Checks whether the results of all logical operations are all false.

Parameters
[in]valueFour floating point numbers.
Returns
Returns true if all lanes are false, and false otherwise.
Description
Because this function is relatively light compared to MoveMask(), you can use it to examine the results of logical operations ahead of time, as shown below.
if (!I128::IsAllMaskFalse(value)) {
int mask = I128::MoveMask(value);
// The process on the mask.
....
}
The bits that are actually inspected may differ, depending on the architecture. (In some cases, not all of the bits are inspected.) Use this function on the result of a comparison operation (or the compounding of those results using logical operations).

§ IsAllMaskTrue()

nn::nlib::simd::F128::IsAllMaskTrue ( f128arg  value)
staticnoexcept

Checks whether the results of all logical operations are all true.

Parameters
[in]valueFour floating point numbers.
Returns
Returns true if all lanes are true, and false otherwise.
Description
Because this function is relatively light compared to MoveMask(), you can use it to examine the results of logical operations ahead of time, as shown below.
if (!I128::IsAllMaskTrue(value)) {
int mask = I128::MoveMask(value);
// The process on the mask.
....
}
The bits that are actually inspected may differ, depending on the architecture. (In some cases, not all of the bits are inspected.) Use this function on the result of a comparison operation (or the compounding of those results using logical operations).

§ IsInfinite()

nn::nlib::simd::F128::IsInfinite ( f128arg  value)
staticnoexcept

If the single-precision floating-point numbers in the lane of value are either positive infinity or negative infinity, all bits in that lane are set to 1.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Four single-precision floating point numbers (mask). The pseudocode returns values like the following.
r[0] = isinf(value[0]) ? 0xFFFFFFFF : 0
r[1] = isinf(value[0]) ? 0xFFFFFFFF : 0
r[2] = isinf(value[0]) ? 0xFFFFFFFF : 0
r[3] = isinf(value[0]) ? 0xFFFFFFFF : 0

§ IsNaN()

nn::nlib::simd::F128::IsNaN ( f128arg  value)
staticnoexcept

If the single-precision floating-point numbers in the lane of value are non-numeric, all bits in that lane are set to 1.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Four single-precision floating point numbers (mask). The pseudocode returns values like the following.
r[0] = isnan(value[0]) ? 0xFFFFFFFF : 0
r[1] = isnan(value[0]) ? 0xFFFFFFFF : 0
r[2] = isnan(value[0]) ? 0xFFFFFFFF : 0
r[3] = isnan(value[0]) ? 0xFFFFFFFF : 0

§ Lerp()

nn::nlib::simd::F128::Lerp ( f128arg  a,
f128arg  b,
f128arg  t 
)
staticnoexcept

Performs linear interpolation on the values in each lane of a and b.

Parameters
[in]aFour single-precision floating point numbers.
[in]bFour single-precision floating point numbers.
[in]tFour single-precision floating point numbers.
Returns
Returns four linearly interpolated single-precision floating point numbers. The pseudocode is similar to the following.
rval[0] = a[0] + t[0] * (b[0] - a[0])
rval[1] = a[1] + t[1] * (b[1] - a[1])
rval[2] = a[2] + t[2] * (b[2] - a[2])
rval[3] = a[3] + t[3] * (b[3] - a[3])

§ Max()

nn::nlib::simd::F128::Max ( f128arg  a,
f128arg  b 
)
staticnoexcept

Compares the values in the same lanes of the a and b arguments, and selects and returns the larger value.

Parameters
[in]aFour single-precision floating point numbers.
[in]bFour single-precision floating point numbers.
Returns
Returns four single-precision floating point numbers. The pseudocode is similar to the following.
r[0] = a[0] > b[0] ? a[0] : b[0]
r[1] = a[1] > b[1] ? a[1] : b[1]
r[2] = a[2] > b[2] ? a[2] : b[2]
r[3] = a[3] > b[3] ? a[3] : b[3]

§ Min()

nn::nlib::simd::F128::Min ( f128arg  a,
f128arg  b 
)
staticnoexcept

Compares the values in the same lanes of the a and b arguments, and selects and returns the larger value.

Parameters
[in]aFour single-precision floating point numbers.
[in]bFour single-precision floating point numbers.
Returns
Returns four single-precision floating point numbers. The pseudocode is similar to the following.
r[0] = a[0] < b[0] ? a[0] : b[0]
r[1] = a[1] < b[1] ? a[1] : b[1]
r[2] = a[2] < b[2] ? a[2] : b[2]
r[3] = a[3] < b[3] ? a[3] : b[3]

§ MoveMask()

nn::nlib::simd::F128::MoveMask ( f128arg  value)
staticnoexcept

Consolidates the various 32-bit lanes into a 1-bit value and returns it as an integer.

Parameters
[in]valueFour floating point numbers (mask).
Returns
The pseudocode returns values similar to the following.
int rval = 0;
// Here, value is treated as an integer.
rval |= value[0] == 0xFFFFFFFFU ? 1 : 0
rval |= value[1] == 0xFFFFFFFFU ? 2 : 0
rval |= value[2] == 0xFFFFFFFFU ? 4 : 0
rval |= value[3] == 0xFFFFFFFFU ? 8 : 0
Description
The bits reflected in the result vary depending on the architecture.
  • For SSE 4.1 (_mm_movemask_ps, MOVMSKPS), the result reflects the value of the most significant bit.
  • For NEON, the result reflects the sampling of different bits in different lanes.
  • For general architectures, 1 is set if all bits are standing, and 0 is set otherwise.
In either case, the process works as intended if the result of a comparison operation is used as the input.

§ NegateEx()

template<bool NegateLane0, bool NegateLane1, bool NegateLane2, bool NegateLane3>
nn::nlib::simd::F128::NegateEx ( f128arg  value)
staticnoexcept

Reverses the signs of the lanes of value. It's possible to set whether to reverse the sign for each lane separately.

Template Parameters
NegateLane0If true, reverses the sign in lane 0.
NegateLane1If true, reverses the sign in lane 1.
NegateLane2If true, reverses the sign in lane 2.
NegateLane3If true, reverses the sign in lane 3.
Parameters
[in]valueFour single-precision floating point numbers.
Returns
The four single-precision floating point numbers with the sign reversed in each lane.
Description
Performs processes as shown in the following pseudocode.
ret[0] = NagateLane0 ? -value[0] : value[0];
ret[1] = NagateLane1 ? -value[1] : value[1];
ret[2] = NagateLane2 ? -value[2] : value[2];
ret[3] = NagateLane3 ? -value[3] : value[3];
return ret;

§ OrNot()

nn::nlib::simd::F128::OrNot ( f128arg  a,
f128arg  b 
)
staticnoexcept

Calculates the bitwise NOT of the a argument, and the bitwise OR of the b argument.

Parameters
[in]aA 128-bit value.
[in]bA 128-bit value.
Returns
Returns ~a | b.

§ PairwiseAdd()

nn::nlib::simd::F128::PairwiseAdd ( f128arg  a,
f128arg  b 
)
staticnoexcept

Performs horizontal addition on a and b and collects the results into a single 128-bit value.

Parameters
[in]aFour single-precision floating point numbers.
[in]bFour single-precision floating point numbers.
Returns
The pseudocode returns values similar to the following.
r[0] = a[0] + a[1]
r[1] = a[2] + a[3]
r[2] = b[0] + b[1]
r[3] = b[2] + b[3]

§ PairwiseMax()

nn::nlib::simd::F128::PairwiseMax ( f128arg  a,
f128arg  b 
)
staticnoexcept

Compares the values in adjacent lanes of the a and b arguments, and selects and returns the larger of them.

Parameters
[in]aFour single-precision floating point numbers.
[in]bFour single-precision floating point numbers.
Returns
Returns four single-precision floating point numbers. The pseudocode is similar to the following.
r[0] = a[0] > a[1] ? a[0] : a[1]
r[1] = a[2] > a[3] ? a[2] : a[3]
r[2] = b[0] > b[1] ? b[0] : b[1]
r[3] = b[2] > b[3] ? b[2] : b[3]

§ PairwiseMin()

nn::nlib::simd::F128::PairwiseMin ( f128arg  a,
f128arg  b 
)
staticnoexcept

Compares the values in adjacent lanes of the a and b arguments, and selects and returns the smaller of them.

Parameters
[in]aFour single-precision floating point numbers.
[in]bFour single-precision floating point numbers.
Returns
Returns four single-precision floating point numbers. The pseudocode is similar to the following.
r[0] = a[0] < a[1] ? a[0] : a[1]
r[1] = a[2] < a[3] ? a[2] : a[3]
r[2] = b[0] < b[1] ? b[0] : b[1]
r[3] = b[2] < b[3] ? b[2] : b[3]

§ Permute()

template<int V0, int V1, int V2, int V3>
nn::nlib::simd::F128::Permute ( f128arg  a,
f128arg  b 
)
staticnoexcept

Generates a new 128-bit value from eight sorted single-precision floating-point numbers. You can specify -1 if arbitrary values generated do not matter.

Template Parameters
V0Either the lane number (0-7) or the value of -1 to copy to the lane 0 for the new 128-bit value.
V1Either the lane number (0-7) or the value of -1 to copy to the lane 1 for the new 128-bit value.
V2Either the lane number (0-7) or the value of -1 to copy to the lane 2 for the new 128-bit value.
V3Either the lane number (0-7) or the value of -1 to copy to the lane 3 for the new 128-bit value.
Parameters
[in]aFour sortable single-precision floating-point numbers.
[in]bFour sortable single-precision floating-point numbers.
Returns
The new 128-bit value.
Description
Specifies a lane number 0-3 to copy from a, or a lane number 4-7 to copy from b.
An illustration for the behavior is shown below. The selectors V0, V1, V2, and V3 select arbitrary lanes and store values to lanes for return values.
dot_inline_dotgraph_17.png

§ Recp()

nn::nlib::simd::F128::Recp ( f128arg  value)
staticnoexcept

Computes the reciprocal values for each lane of value. If this involves division by zero, the function returns positive infinity.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Returns four single-precision floating point numbers. The pseudocode is similar to the following.
rval[0] = 1.0 / value[0]
rval[1] = 1.0 / value[1]
rval[2] = 1.0 / value[2]
rval[3] = 1.0 / value[3]

§ RecpEst()

nn::nlib::simd::F128::RecpEst ( f128arg  value)
staticnoexcept

Computes the reciprocal values for each lane of value relatively quickly but with low precision. If this involves division by zero, the function returns positive infinity.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Returns four single-precision floating point numbers.

§ RecpSqrt()

nn::nlib::simd::F128::RecpSqrt ( f128arg  value)
staticnoexcept

Computes the reciprocal square root for each lane of value. If this involves division by zero, the function returns positive infinity.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Returns four single-precision floating point numbers. The pseudocode is similar to the following.
rval[0] = sqrt(1.0 / value[0])
rval[1] = sqrt(1.0 / value[1])
rval[2] = sqrt(1.0 / value[2])
rval[3] = sqrt(1.0 / value[3])

§ RecpSqrtEst()

nn::nlib::simd::F128::RecpSqrtEst ( f128arg  value)
staticnoexcept

Computes the reciprocal square root for each lane of value relatively quickly but with low precision. If this involves division by zero, the function returns positive infinity.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Returns four single-precision floating point numbers.

§ RotateLeft()

template<size_t N>
nn::nlib::simd::F128::RotateLeft ( f128arg  value)
inlinestaticnoexcept

Rotates four single-precision floating-point numbers to the left by the amount of N.

Template Parameters
NEither 0, 1, or 2.
Parameters
[in]valueThe four single-precision floating point numbers to rotate.
Returns
The four rotated single-precision floating point numbers.
Description
Note that the small lane number value is to the right. Implemented with the Swizzle() function wrapped.
The following figure illustrates the behavior when N = 1.
dot_inline_dotgraph_18.png

Definition at line 320 of file SimdFloat.h.

§ RotateRight()

template<size_t N>
nn::nlib::simd::F128::RotateRight ( f128arg  value)
inlinestaticnoexcept

Rotates four single-precision floating-point numbers to the right by the amount of N.

Template Parameters
NEither 0, 1, or 2.
Parameters
[in]valueThe four single-precision floating point numbers to rotate.
Returns
The four rotated single-precision floating point numbers.
Description
Note that the small lane number value is to the right. Implemented with the Swizzle() function wrapped.
The following figure illustrates the behavior when N = 1.
dot_inline_dotgraph_19.png

Definition at line 327 of file SimdFloat.h.

§ Round()

nn::nlib::simd::F128::Round ( f128arg  value)
staticnoexcept

Computes the single-precision floating-point value for each lane of value and rounds off the decimal point.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Returns four single-precision floating point numbers.
Description
For example, 6.54321 becomes 7.0, and -7.0.54321 becomes -6.0.

§ Select()

nn::nlib::simd::F128::Select ( f128arg  mask,
f128arg  a,
f128arg  b 
)
staticnoexcept

Compounds a and b according to the value of mask. Use this function to avoid conditional branching.

Parameters
[in]maskFour 32 bit wide masks.
[in]aFour single-precision floating point numbers.
[in]bFour single-precision floating point numbers.
Returns
The compounded value of the a and b arguments. The pseudocode returns values similar to the following.
r[0] = mask[0] == 0xFFFFFFFFU ? a[0] : b[0]
r[1] = mask[1] == 0xFFFFFFFFU ? a[1] : b[1]
r[1] = mask[2] == 0xFFFFFFFFU ? a[2] : b[2]
r[3] = mask[3] == 0xFFFFFFFFU ? a[3] : b[3]
Description
If all bits of mask are 1, stores the lanes of a. If all bits are 0, stores the lanes of b. For other values, the behavior depends on the architecture.
It works as intended if mask is the result of a comparison operation (or the compounding of those results using logical operations).

§ SetFloatByIndex()

nn::nlib::simd::F128::SetFloatByIndex ( f128arg  value,
float  v,
size_t  i 
)
staticnoexcept

Returns the single-precision floating point numbers of lane i of value that were set to v.

Parameters
[in]valueFour single-precision floating point numbers.
[in]vSingle-precision floating-point number.
[in]iAn integer between 0 and 3 specifying which lane to get.
Returns
Four single-precision floating point numbers.

§ SetFloatToLane()

template<size_t N>
nn::nlib::simd::F128::SetFloatToLane ( f128arg  value,
float  v 
)
staticnoexcept

Returns the single-precision floating point numbers of lane N of value that were set to v.

Template Parameters
TThe lane value. Specify an integer between 0 and 3.
Parameters
[in]valueFour single-precision floating point numbers.
[in]vSingle-precision floating-point number.
Returns
Four single-precision floating point numbers.

§ SetValue()

template<size_t N>
nn::nlib::simd::F128::SetValue ( f128arg  value,
each_select32_tag   
)
staticnoexcept

Sets all lanes to the single-precision floating point value of lane N of the value argument.

Template Parameters
NThe lane.
Parameters
[in]valueThe 128-bit value.
Returns
The 128-bit value that was set.

§ SetZeroToLane()

template<size_t N>
nn::nlib::simd::F128::SetZeroToLane ( f128arg  value)
staticnoexcept

Sets lane N of value to 0.f.

Template Parameters
NThe lane.
Parameters
[in]valueFour single-precision floating point numbers.
Returns
The value in lane N of the value where 0.f was set.

§ ShiftRight()

template<size_t N>
nn::nlib::simd::F128::ShiftRight ( f128arg  a,
f128arg  b 
)
inlinestaticnoexcept

Sets the elements of b in shifted order to the portion of a that becomes empty when a is shifted to the right.

Template Parameters
NEither 0, 1, or 2.
Parameters
[in]aFour single-precision floating point numbers to shift.
[in]bFour single-precision floating point numbers to shift.
Returns
Four shifted single-precision floating point numbers.
Description
Note that the small lane number value is to the right. Implemented with the Permute() function wrapped.
The following figure illustrates the behavior when N = 1.
dot_inline_dotgraph_20.png

Definition at line 333 of file SimdFloat.h.

§ Splat()

template<bool SplatLane0, bool SplatLane1, bool SplatLane2, bool SplatLane3>
nn::nlib::simd::F128::Splat ( f128arg  value,
f128arg  splat 
)
staticnoexcept

Based on the settings of the template arguments, replaces the values of the lanes of value with the values of splat. All lanes must have the same splat values.

Template Parameters
SplatLane0Set to true to replace lane 0 of value with splat.
SplatLane1Set to true to replace lane 1 of value with splat.
SplatLane2Set to true to replace lane 2 of value with splat.
SplatLane3Set to true to replace lane 3 of value with splat.
Parameters
[in]valueFour single-precision floating point numbers.
[in]splatFour single-precision floating-point numbers. (All lanes have the same values.)
Returns
The new 128-bit value.
Description
In some cases, this is more efficient than the same process using F128::Permute.

§ Sqrt()

nn::nlib::simd::F128::Sqrt ( f128arg  value)
staticnoexcept

Computes the square root for each lane of value.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Returns four single-precision floating point numbers. The pseudocode is similar to the following.
rval[0] = sqrt(value[0])
rval[1] = sqrt(value[1])
rval[2] = sqrt(value[2])
rval[3] = sqrt(value[3])

§ SqrtEst()

nn::nlib::simd::F128::SqrtEst ( f128arg  value)
staticnoexcept

Computes the square root for each lane of value relatively quickly but with low precision.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Returns four single-precision floating point numbers.

§ SubAngle()

nn::nlib::simd::F128::SubAngle ( f128arg  angle1,
f128arg  angle2 
)
staticnoexcept

Subtracts the four radians stored in the separate lanes. The results are normalized to values greater than and less than π.

Parameters
[in]angle1Four single-precision floating point numbers (radians).
[in]angle2Four single-precision floating point numbers (radians).
Returns
Four single-precision floating point numbers (radians).
Description
The radians stored in each lane for angle1 , angle2 must be greater than or equal to -π and less than π.

§ Swizzle()

template<int V0, int V1, int V2, int V3>
nn::nlib::simd::F128::Swizzle ( f128arg  value)
staticnoexcept

Generates a new 128-bit value from four sorted single-precision floating-point numbers. You can specify -1 if arbitrary values generated do not matter.

Template Parameters
V0Either the lane number (0-3) or the value of -1 to copy to the lane 0 for the new 128-bit value.
V1Either the lane number (0-3) or the value of -1 to copy to the lane 1 for the new 128-bit value.
V2Either the lane number (0-3) or the value of -1 to copy to the lane 2 for the new 128-bit value.
V3Either the lane number (0-3) or the value of -1 to copy to the lane 3 for the new 128-bit value.
Parameters
[in]valueFour sortable single-precision floating-point numbers.
Returns
The new 128-bit value.
Description
An illustration for the behavior is shown below. The selectors V0, V1, V2, and V3 select arbitrary lanes and store values to lanes for return values.
dot_inline_dotgraph_21.png

§ Truncate()

nn::nlib::simd::F128::Truncate ( f128arg  value)
staticnoexcept

Computes the single-precision floating-point value for each lane of value, with the decimal portion truncated to zero.

Parameters
[in]valueFour single-precision floating point numbers.
Returns
Returns four single-precision floating point numbers.
Description
For example, 6.54321 becomes 6.0, and -6.54321 becomes -6.0.0.

The documentation for this class was generated from the following files: