Gromacs
2022.2
|
Provides an architecture-independent way of doing SIMD coding.
Overview of the SIMD implementation is provided in Single-instruction Multiple-data (SIMD) coding. The details are documented in gromacs/simd/simd.h and the reference implementation impl_reference.h.
Namespaces | |
gmx | |
Generic GROMACS namespace. | |
gmx::test::anonymous_namespace{simd_math.cpp} | |
Constant width-4 double precision SIMD types and instructions | |
static Simd4Double gmx_simdcall | gmx::load4 (const double *m) |
Load 4 double values from aligned memory into SIMD4 variable. More... | |
static void gmx_simdcall | gmx::store4 (double *m, Simd4Double a) |
Store the contents of SIMD4 double to aligned memory m. More... | |
static Simd4Double gmx_simdcall | gmx::load4U (const double *m) |
Load SIMD4 double from unaligned memory. More... | |
static void gmx_simdcall | gmx::store4U (double *m, Simd4Double a) |
Store SIMD4 double to unaligned memory. More... | |
static Simd4Double gmx_simdcall | gmx::simd4SetZeroD () |
Set all SIMD4 double elements to 0. More... | |
static Simd4Double gmx_simdcall | gmx::operator& (Simd4Double a, Simd4Double b) |
Bitwise and for two SIMD4 double variables. More... | |
static Simd4Double gmx_simdcall | gmx::andNot (Simd4Double a, Simd4Double b) |
Bitwise andnot for two SIMD4 double variables. c=(~a) & b. More... | |
static Simd4Double gmx_simdcall | gmx::operator| (Simd4Double a, Simd4Double b) |
Bitwise or for two SIMD4 doubles. More... | |
static Simd4Double gmx_simdcall | gmx::operator^ (Simd4Double a, Simd4Double b) |
Bitwise xor for two SIMD4 double variables. More... | |
static Simd4Double gmx_simdcall | gmx::operator+ (Simd4Double a, Simd4Double b) |
Add two double SIMD4 variables. More... | |
static Simd4Double gmx_simdcall | gmx::operator- (Simd4Double a, Simd4Double b) |
Subtract two SIMD4 variables. More... | |
static Simd4Double gmx_simdcall | gmx::operator- (Simd4Double a) |
SIMD4 floating-point negate. More... | |
static Simd4Double gmx_simdcall | gmx::operator* (Simd4Double a, Simd4Double b) |
Multiply two SIMD4 variables. More... | |
static Simd4Double gmx_simdcall | gmx::fma (Simd4Double a, Simd4Double b, Simd4Double c) |
SIMD4 Fused-multiply-add. Result is a*b+c. More... | |
static Simd4Double gmx_simdcall | gmx::fms (Simd4Double a, Simd4Double b, Simd4Double c) |
SIMD4 Fused-multiply-subtract. Result is a*b-c. More... | |
static Simd4Double gmx_simdcall | gmx::fnma (Simd4Double a, Simd4Double b, Simd4Double c) |
SIMD4 Fused-negated-multiply-add. Result is -a*b+c. More... | |
static Simd4Double gmx_simdcall | gmx::fnms (Simd4Double a, Simd4Double b, Simd4Double c) |
SIMD4 Fused-negated-multiply-subtract. Result is -a*b-c. More... | |
static Simd4Double gmx_simdcall | gmx::rsqrt (Simd4Double x) |
SIMD4 1.0/sqrt(x) lookup. More... | |
static Simd4Double gmx_simdcall | gmx::abs (Simd4Double a) |
SIMD4 Floating-point abs(). More... | |
static Simd4Double gmx_simdcall | gmx::max (Simd4Double a, Simd4Double b) |
Set each SIMD4 element to the largest from two variables. More... | |
static Simd4Double gmx_simdcall | gmx::min (Simd4Double a, Simd4Double b) |
Set each SIMD4 element to the largest from two variables. More... | |
static Simd4Double gmx_simdcall | gmx::round (Simd4Double a) |
SIMD4 Round to nearest integer value (in floating-point format). More... | |
static Simd4Double gmx_simdcall | gmx::trunc (Simd4Double a) |
Truncate SIMD4, i.e. round towards zero - common hardware instruction. More... | |
static double gmx_simdcall | gmx::dotProduct (Simd4Double a, Simd4Double b) |
Return dot product of two double precision SIMD4 variables. More... | |
static void gmx_simdcall | gmx::transpose (Simd4Double *v0, Simd4Double *v1, Simd4Double *v2, Simd4Double *v3) |
SIMD4 double transpose. More... | |
static Simd4DBool gmx_simdcall | gmx::operator== (Simd4Double a, Simd4Double b) |
a==b for SIMD4 double More... | |
static Simd4DBool gmx_simdcall | gmx::operator!= (Simd4Double a, Simd4Double b) |
a!=b for SIMD4 double More... | |
static Simd4DBool gmx_simdcall | gmx::operator< (Simd4Double a, Simd4Double b) |
a<b for SIMD4 double More... | |
static Simd4DBool gmx_simdcall | gmx::operator<= (Simd4Double a, Simd4Double b) |
a<=b for SIMD4 double. More... | |
static Simd4DBool gmx_simdcall | gmx::operator&& (Simd4DBool a, Simd4DBool b) |
Logical and on single precision SIMD4 booleans. More... | |
static Simd4DBool gmx_simdcall | gmx::operator|| (Simd4DBool a, Simd4DBool b) |
Logical or on single precision SIMD4 booleans. More... | |
static bool gmx_simdcall | gmx::anyTrue (Simd4DBool a) |
Returns non-zero if any of the boolean in SIMD4 a is True, otherwise 0. More... | |
static Simd4Double gmx_simdcall | gmx::selectByMask (Simd4Double a, Simd4DBool mask) |
Select from single precision SIMD4 variable where boolean is true. More... | |
static Simd4Double gmx_simdcall | gmx::selectByNotMask (Simd4Double a, Simd4DBool mask) |
Select from single precision SIMD4 variable where boolean is false. More... | |
static Simd4Double gmx_simdcall | gmx::blend (Simd4Double a, Simd4Double b, Simd4DBool sel) |
Vector-blend SIMD4 selection. More... | |
static double gmx_simdcall | gmx::reduce (Simd4Double a) |
Return sum of all elements in SIMD4 double variable. More... | |
Constant width-4 single precision SIMD types and instructions | |
static Simd4Float gmx_simdcall | gmx::load4 (const float *m) |
Load 4 float values from aligned memory into SIMD4 variable. More... | |
static void gmx_simdcall | gmx::store4 (float *m, Simd4Float a) |
Store the contents of SIMD4 float to aligned memory m. More... | |
static Simd4Float gmx_simdcall | gmx::load4U (const float *m) |
Load SIMD4 float from unaligned memory. More... | |
static void gmx_simdcall | gmx::store4U (float *m, Simd4Float a) |
Store SIMD4 float to unaligned memory. More... | |
static Simd4Float gmx_simdcall | gmx::simd4SetZeroF () |
Set all SIMD4 float elements to 0. More... | |
static Simd4Float gmx_simdcall | gmx::operator& (Simd4Float a, Simd4Float b) |
Bitwise and for two SIMD4 float variables. More... | |
static Simd4Float gmx_simdcall | gmx::andNot (Simd4Float a, Simd4Float b) |
Bitwise andnot for two SIMD4 float variables. c=(~a) & b. More... | |
static Simd4Float gmx_simdcall | gmx::operator| (Simd4Float a, Simd4Float b) |
Bitwise or for two SIMD4 floats. More... | |
static Simd4Float gmx_simdcall | gmx::operator^ (Simd4Float a, Simd4Float b) |
Bitwise xor for two SIMD4 float variables. More... | |
static Simd4Float gmx_simdcall | gmx::operator+ (Simd4Float a, Simd4Float b) |
Add two float SIMD4 variables. More... | |
static Simd4Float gmx_simdcall | gmx::operator- (Simd4Float a, Simd4Float b) |
Subtract two SIMD4 variables. More... | |
static Simd4Float gmx_simdcall | gmx::operator- (Simd4Float a) |
SIMD4 floating-point negate. More... | |
static Simd4Float gmx_simdcall | gmx::operator* (Simd4Float a, Simd4Float b) |
Multiply two SIMD4 variables. More... | |
static Simd4Float gmx_simdcall | gmx::fma (Simd4Float a, Simd4Float b, Simd4Float c) |
SIMD4 Fused-multiply-add. Result is a*b+c. More... | |
static Simd4Float gmx_simdcall | gmx::fms (Simd4Float a, Simd4Float b, Simd4Float c) |
SIMD4 Fused-multiply-subtract. Result is a*b-c. More... | |
static Simd4Float gmx_simdcall | gmx::fnma (Simd4Float a, Simd4Float b, Simd4Float c) |
SIMD4 Fused-negated-multiply-add. Result is -a*b+c. More... | |
static Simd4Float gmx_simdcall | gmx::fnms (Simd4Float a, Simd4Float b, Simd4Float c) |
SIMD4 Fused-negated-multiply-subtract. Result is -a*b-c. More... | |
static Simd4Float gmx_simdcall | gmx::rsqrt (Simd4Float x) |
SIMD4 1.0/sqrt(x) lookup. More... | |
static Simd4Float gmx_simdcall | gmx::abs (Simd4Float a) |
SIMD4 Floating-point fabs(). More... | |
static Simd4Float gmx_simdcall | gmx::max (Simd4Float a, Simd4Float b) |
Set each SIMD4 element to the largest from two variables. More... | |
static Simd4Float gmx_simdcall | gmx::min (Simd4Float a, Simd4Float b) |
Set each SIMD4 element to the largest from two variables. More... | |
static Simd4Float gmx_simdcall | gmx::round (Simd4Float a) |
SIMD4 Round to nearest integer value (in floating-point format). More... | |
static Simd4Float gmx_simdcall | gmx::trunc (Simd4Float a) |
Truncate SIMD4, i.e. round towards zero - common hardware instruction. More... | |
static float gmx_simdcall | gmx::dotProduct (Simd4Float a, Simd4Float b) |
Return dot product of two single precision SIMD4 variables. More... | |
static void gmx_simdcall | gmx::transpose (Simd4Float *v0, Simd4Float *v1, Simd4Float *v2, Simd4Float *v3) |
SIMD4 float transpose. More... | |
static Simd4FBool gmx_simdcall | gmx::operator== (Simd4Float a, Simd4Float b) |
a==b for SIMD4 float More... | |
static Simd4FBool gmx_simdcall | gmx::operator!= (Simd4Float a, Simd4Float b) |
a!=b for SIMD4 float More... | |
static Simd4FBool gmx_simdcall | gmx::operator< (Simd4Float a, Simd4Float b) |
a<b for SIMD4 float More... | |
static Simd4FBool gmx_simdcall | gmx::operator<= (Simd4Float a, Simd4Float b) |
a<=b for SIMD4 float. More... | |
static Simd4FBool gmx_simdcall | gmx::operator&& (Simd4FBool a, Simd4FBool b) |
Logical and on single precision SIMD4 booleans. More... | |
static Simd4FBool gmx_simdcall | gmx::operator|| (Simd4FBool a, Simd4FBool b) |
Logical or on single precision SIMD4 booleans. More... | |
static bool gmx_simdcall | gmx::anyTrue (Simd4FBool a) |
Returns non-zero if any of the boolean in SIMD4 a is True, otherwise 0. More... | |
static Simd4Float gmx_simdcall | gmx::selectByMask (Simd4Float a, Simd4FBool mask) |
Select from single precision SIMD4 variable where boolean is true. More... | |
static Simd4Float gmx_simdcall | gmx::selectByNotMask (Simd4Float a, Simd4FBool mask) |
Select from single precision SIMD4 variable where boolean is false. More... | |
static Simd4Float gmx_simdcall | gmx::blend (Simd4Float a, Simd4Float b, Simd4FBool sel) |
Vector-blend SIMD4 selection. More... | |
static float gmx_simdcall | gmx::reduce (Simd4Float a) |
Return sum of all elements in SIMD4 float variable. More... | |
SIMD implementation load/store operations for double precision floating point | |
static SimdDouble gmx_simdcall | gmx::simdLoad (const double *m, SimdDoubleTag={}) |
Load GMX_SIMD_DOUBLE_WIDTH numbers from aligned memory. More... | |
static void gmx_simdcall | gmx::store (double *m, SimdDouble a) |
Store the contents of SIMD double variable to aligned memory m. More... | |
static SimdDouble gmx_simdcall | gmx::simdLoadU (const double *m, SimdDoubleTag={}) |
Load SIMD double from unaligned memory. More... | |
static void gmx_simdcall | gmx::storeU (double *m, SimdDouble a) |
Store SIMD double to unaligned memory. More... | |
static SimdDouble gmx_simdcall | gmx::setZeroD () |
Set all SIMD double variable elements to 0.0. More... | |
SIMD implementation load/store operations for integers (corresponding to double) | |
static SimdDInt32 gmx_simdcall | gmx::simdLoad (const std::int32_t *m, SimdDInt32Tag) |
Load aligned SIMD integer data, width corresponds to gmx::SimdDouble. More... | |
static void gmx_simdcall | gmx::store (std::int32_t *m, SimdDInt32 a) |
Store aligned SIMD integer data, width corresponds to gmx::SimdDouble. More... | |
static SimdDInt32 gmx_simdcall | gmx::simdLoadU (const std::int32_t *m, SimdDInt32Tag) |
Load unaligned integer SIMD data, width corresponds to gmx::SimdDouble. More... | |
static void gmx_simdcall | gmx::storeU (std::int32_t *m, SimdDInt32 a) |
Store unaligned SIMD integer data, width corresponds to gmx::SimdDouble. More... | |
static SimdDInt32 gmx_simdcall | gmx::setZeroDI () |
Set all SIMD (double) integer variable elements to 0. More... | |
template<int index> | |
static std::int32_t gmx_simdcall | gmx::extract (SimdDInt32 a) |
Extract element with index i from gmx::SimdDInt32. More... | |
SIMD implementation double precision floating-point bitwise logical operations | |
static SimdDouble gmx_simdcall | gmx::operator& (SimdDouble a, SimdDouble b) |
Bitwise and for two SIMD double variables. More... | |
static SimdDouble gmx_simdcall | gmx::andNot (SimdDouble a, SimdDouble b) |
Bitwise andnot for SIMD double. More... | |
static SimdDouble gmx_simdcall | gmx::operator| (SimdDouble a, SimdDouble b) |
Bitwise or for SIMD double. More... | |
static SimdDouble gmx_simdcall | gmx::operator^ (SimdDouble a, SimdDouble b) |
Bitwise xor for SIMD double. More... | |
SIMD implementation double precision floating-point arithmetics | |
static SimdDouble gmx_simdcall | gmx::operator+ (SimdDouble a, SimdDouble b) |
Add two double SIMD variables. More... | |
static SimdDouble gmx_simdcall | gmx::operator- (SimdDouble a, SimdDouble b) |
Subtract two double SIMD variables. More... | |
static SimdDouble gmx_simdcall | gmx::operator- (SimdDouble a) |
SIMD double precision negate. More... | |
static SimdDouble gmx_simdcall | gmx::operator* (SimdDouble a, SimdDouble b) |
Multiply two double SIMD variables. More... | |
static SimdDouble gmx_simdcall | gmx::fma (SimdDouble a, SimdDouble b, SimdDouble c) |
SIMD double Fused-multiply-add. Result is a*b+c. More... | |
static SimdDouble gmx_simdcall | gmx::fms (SimdDouble a, SimdDouble b, SimdDouble c) |
SIMD double Fused-multiply-subtract. Result is a*b-c. More... | |
static SimdDouble gmx_simdcall | gmx::fnma (SimdDouble a, SimdDouble b, SimdDouble c) |
SIMD double Fused-negated-multiply-add. Result is -a*b+c. More... | |
static SimdDouble gmx_simdcall | gmx::fnms (SimdDouble a, SimdDouble b, SimdDouble c) |
SIMD double Fused-negated-multiply-subtract. Result is -a*b-c. More... | |
static SimdDouble gmx_simdcall | gmx::rsqrt (SimdDouble x) |
double SIMD 1.0/sqrt(x) lookup. More... | |
static SimdDouble gmx_simdcall | gmx::rcp (SimdDouble x) |
SIMD double 1.0/x lookup. More... | |
static SimdDouble gmx_simdcall | gmx::maskAdd (SimdDouble a, SimdDouble b, SimdDBool m) |
Add two double SIMD variables, masked version. More... | |
static SimdDouble gmx_simdcall | gmx::maskzMul (SimdDouble a, SimdDouble b, SimdDBool m) |
Multiply two double SIMD variables, masked version. More... | |
static SimdDouble gmx_simdcall | gmx::maskzFma (SimdDouble a, SimdDouble b, SimdDouble c, SimdDBool m) |
SIMD double fused multiply-add, masked version. More... | |
static SimdDouble gmx_simdcall | gmx::maskzRsqrt (SimdDouble x, SimdDBool m) |
SIMD double 1.0/sqrt(x) lookup, masked version. More... | |
static SimdDouble gmx_simdcall | gmx::maskzRcp (SimdDouble x, SimdDBool m) |
SIMD double 1.0/x lookup, masked version. More... | |
static SimdDouble gmx_simdcall | gmx::abs (SimdDouble a) |
SIMD double floating-point fabs(). More... | |
static SimdDouble gmx_simdcall | gmx::max (SimdDouble a, SimdDouble b) |
Set each SIMD double element to the largest from two variables. More... | |
static SimdDouble gmx_simdcall | gmx::min (SimdDouble a, SimdDouble b) |
Set each SIMD double element to the smallest from two variables. More... | |
static SimdDouble gmx_simdcall | gmx::round (SimdDouble a) |
SIMD double round to nearest integer value (in floating-point format). More... | |
static SimdDouble gmx_simdcall | gmx::trunc (SimdDouble a) |
Truncate SIMD double, i.e. round towards zero - common hardware instruction. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdDouble gmx_simdcall | gmx::frexp (SimdDouble value, SimdDInt32 *exponent) |
Extract (integer) exponent and fraction from double precision SIMD. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdDouble gmx_simdcall | gmx::ldexp (SimdDouble value, SimdDInt32 exponent) |
Multiply a SIMD double value by the number 2 raised to an exp power. More... | |
static double gmx_simdcall | gmx::reduce (SimdDouble a) |
Return sum of all elements in SIMD double variable. More... | |
SIMD implementation double precision floating-point comparison, boolean, selection. | |
static SimdDBool gmx_simdcall | gmx::operator== (SimdDouble a, SimdDouble b) |
SIMD a==b for double SIMD. More... | |
static SimdDBool gmx_simdcall | gmx::operator!= (SimdDouble a, SimdDouble b) |
SIMD a!=b for double SIMD. More... | |
static SimdDBool gmx_simdcall | gmx::operator< (SimdDouble a, SimdDouble b) |
SIMD a<b for double SIMD. More... | |
static SimdDBool gmx_simdcall | gmx::operator<= (SimdDouble a, SimdDouble b) |
SIMD a<=b for double SIMD. More... | |
static SimdDBool gmx_simdcall | gmx::testBits (SimdDouble a) |
Return true if any bits are set in the single precision SIMD. More... | |
static SimdDBool gmx_simdcall | gmx::operator&& (SimdDBool a, SimdDBool b) |
Logical and on double precision SIMD booleans. More... | |
static SimdDBool gmx_simdcall | gmx::operator|| (SimdDBool a, SimdDBool b) |
Logical or on double precision SIMD booleans. More... | |
static bool gmx_simdcall | gmx::anyTrue (SimdDBool a) |
Returns non-zero if any of the boolean in SIMD a is True, otherwise 0. More... | |
static SimdDouble gmx_simdcall | gmx::selectByMask (SimdDouble a, SimdDBool mask) |
Select from double precision SIMD variable where boolean is true. More... | |
static SimdDouble gmx_simdcall | gmx::selectByNotMask (SimdDouble a, SimdDBool mask) |
Select from double precision SIMD variable where boolean is false. More... | |
static SimdDouble gmx_simdcall | gmx::blend (SimdDouble a, SimdDouble b, SimdDBool sel) |
Vector-blend SIMD double selection. More... | |
SIMD implementation integer (corresponding to double) bitwise logical operations | |
static SimdDInt32 gmx_simdcall | gmx::operator& (SimdDInt32 a, SimdDInt32 b) |
Integer SIMD bitwise and. More... | |
static SimdDInt32 gmx_simdcall | gmx::andNot (SimdDInt32 a, SimdDInt32 b) |
Integer SIMD bitwise not/complement. More... | |
static SimdDInt32 gmx_simdcall | gmx::operator| (SimdDInt32 a, SimdDInt32 b) |
Integer SIMD bitwise or. More... | |
static SimdDInt32 gmx_simdcall | gmx::operator^ (SimdDInt32 a, SimdDInt32 b) |
Integer SIMD bitwise xor. More... | |
SIMD implementation integer (corresponding to double) arithmetics | |
static SimdDInt32 gmx_simdcall | gmx::operator+ (SimdDInt32 a, SimdDInt32 b) |
Add SIMD integers. More... | |
static SimdDInt32 gmx_simdcall | gmx::operator- (SimdDInt32 a, SimdDInt32 b) |
Subtract SIMD integers. More... | |
static SimdDInt32 gmx_simdcall | gmx::operator* (SimdDInt32 a, SimdDInt32 b) |
Multiply SIMD integers. More... | |
SIMD implementation integer (corresponding to double) comparisons, boolean selection | |
static SimdDIBool gmx_simdcall | gmx::operator== (SimdDInt32 a, SimdDInt32 b) |
Equality comparison of two integers corresponding to double values. More... | |
static SimdDIBool gmx_simdcall | gmx::operator< (SimdDInt32 a, SimdDInt32 b) |
Less-than comparison of two SIMD integers corresponding to double values. More... | |
static SimdDIBool gmx_simdcall | gmx::testBits (SimdDInt32 a) |
Check if any bit is set in each element. More... | |
static SimdDIBool gmx_simdcall | gmx::operator&& (SimdDIBool a, SimdDIBool b) |
Logical AND on SimdDIBool. More... | |
static SimdDIBool gmx_simdcall | gmx::operator|| (SimdDIBool a, SimdDIBool b) |
Logical OR on SimdDIBool. More... | |
static bool gmx_simdcall | gmx::anyTrue (SimdDIBool a) |
Returns true if any of the boolean in x is True, otherwise 0. More... | |
static SimdDInt32 gmx_simdcall | gmx::selectByMask (SimdDInt32 a, SimdDIBool mask) |
Select from gmx::SimdDInt32 variable where boolean is true. More... | |
static SimdDInt32 gmx_simdcall | gmx::selectByNotMask (SimdDInt32 a, SimdDIBool mask) |
Select from gmx::SimdDInt32 variable where boolean is false. More... | |
static SimdDInt32 gmx_simdcall | gmx::blend (SimdDInt32 a, SimdDInt32 b, SimdDIBool sel) |
Vector-blend SIMD integer selection. More... | |
SIMD implementation conversion operations | |
static SimdDInt32 gmx_simdcall | gmx::cvtR2I (SimdDouble a) |
Round double precision floating point to integer. More... | |
static SimdDInt32 gmx_simdcall | gmx::cvttR2I (SimdDouble a) |
Truncate double precision floating point to integer. More... | |
static SimdDouble gmx_simdcall | gmx::cvtI2R (SimdDInt32 a) |
Convert integer to double precision floating point. More... | |
static SimdDIBool gmx_simdcall | gmx::cvtB2IB (SimdDBool a) |
Convert from double precision boolean to corresponding integer boolean. More... | |
static SimdDBool gmx_simdcall | gmx::cvtIB2B (SimdDIBool a) |
Convert from integer boolean to corresponding double precision boolean. More... | |
static SimdDouble gmx_simdcall | gmx::cvtF2D (SimdFloat gmx_unused f) |
Convert SIMD float to double. More... | |
static SimdFloat gmx_simdcall | gmx::cvtD2F (SimdDouble gmx_unused d) |
Convert SIMD double to float. More... | |
static void gmx_simdcall | gmx::cvtF2DD (SimdFloat gmx_unused f, SimdDouble gmx_unused *d0, SimdDouble gmx_unused *d1) |
Convert SIMD float to double. More... | |
static SimdFloat gmx_simdcall | gmx::cvtDD2F (SimdDouble gmx_unused d0, SimdDouble gmx_unused d1) |
Convert SIMD double to float. More... | |
static SimdFInt32 gmx_simdcall | gmx::cvtR2I (SimdFloat a) |
Round single precision floating point to integer. More... | |
static SimdFInt32 gmx_simdcall | gmx::cvttR2I (SimdFloat a) |
Truncate single precision floating point to integer. More... | |
static SimdFloat gmx_simdcall | gmx::cvtI2R (SimdFInt32 a) |
Convert integer to single precision floating point. More... | |
static SimdFIBool gmx_simdcall | gmx::cvtB2IB (SimdFBool a) |
Convert from single precision boolean to corresponding integer boolean. More... | |
static SimdFBool gmx_simdcall | gmx::cvtIB2B (SimdFIBool a) |
Convert from integer boolean to corresponding single precision boolean. More... | |
SIMD implementation load/store operations for single precision floating point | |
static SimdFloat gmx_simdcall | gmx::simdLoad (const float *m, SimdFloatTag={}) |
Load GMX_SIMD_FLOAT_WIDTH float numbers from aligned memory. More... | |
static void gmx_simdcall | gmx::store (float *m, SimdFloat a) |
Store the contents of SIMD float variable to aligned memory m. More... | |
static SimdFloat gmx_simdcall | gmx::simdLoadU (const float *m, SimdFloatTag={}) |
Load SIMD float from unaligned memory. More... | |
static void gmx_simdcall | gmx::storeU (float *m, SimdFloat a) |
Store SIMD float to unaligned memory. More... | |
static SimdFloat gmx_simdcall | gmx::setZeroF () |
Set all SIMD float variable elements to 0.0. More... | |
SIMD implementation load/store operations for integers (corresponding to float) | |
static SimdFInt32 gmx_simdcall | gmx::simdLoad (const std::int32_t *m, SimdFInt32Tag) |
Load aligned SIMD integer data, width corresponds to gmx::SimdFloat. More... | |
static void gmx_simdcall | gmx::store (std::int32_t *m, SimdFInt32 a) |
Store aligned SIMD integer data, width corresponds to gmx::SimdFloat. More... | |
static SimdFInt32 gmx_simdcall | gmx::simdLoadU (const std::int32_t *m, SimdFInt32Tag) |
Load unaligned integer SIMD data, width corresponds to gmx::SimdFloat. More... | |
static void gmx_simdcall | gmx::storeU (std::int32_t *m, SimdFInt32 a) |
Store unaligned SIMD integer data, width corresponds to gmx::SimdFloat. More... | |
static SimdFInt32 gmx_simdcall | gmx::setZeroFI () |
Set all SIMD (float) integer variable elements to 0. More... | |
template<int index> | |
static std::int32_t gmx_simdcall | gmx::extract (SimdFInt32 a) |
Extract element with index i from gmx::SimdFInt32. More... | |
SIMD implementation single precision floating-point bitwise logical operations | |
static SimdFloat gmx_simdcall | gmx::operator& (SimdFloat a, SimdFloat b) |
Bitwise and for two SIMD float variables. More... | |
static SimdFloat gmx_simdcall | gmx::andNot (SimdFloat a, SimdFloat b) |
Bitwise andnot for SIMD float. More... | |
static SimdFloat gmx_simdcall | gmx::operator| (SimdFloat a, SimdFloat b) |
Bitwise or for SIMD float. More... | |
static SimdFloat gmx_simdcall | gmx::operator^ (SimdFloat a, SimdFloat b) |
Bitwise xor for SIMD float. More... | |
SIMD implementation single precision floating-point arithmetics | |
static SimdFloat gmx_simdcall | gmx::operator+ (SimdFloat a, SimdFloat b) |
Add two float SIMD variables. More... | |
static SimdFloat gmx_simdcall | gmx::operator- (SimdFloat a, SimdFloat b) |
Subtract two float SIMD variables. More... | |
static SimdFloat gmx_simdcall | gmx::operator- (SimdFloat a) |
SIMD single precision negate. More... | |
static SimdFloat gmx_simdcall | gmx::operator* (SimdFloat a, SimdFloat b) |
Multiply two float SIMD variables. More... | |
static SimdFloat gmx_simdcall | gmx::fma (SimdFloat a, SimdFloat b, SimdFloat c) |
SIMD float Fused-multiply-add. Result is a*b+c. More... | |
static SimdFloat gmx_simdcall | gmx::fms (SimdFloat a, SimdFloat b, SimdFloat c) |
SIMD float Fused-multiply-subtract. Result is a*b-c. More... | |
static SimdFloat gmx_simdcall | gmx::fnma (SimdFloat a, SimdFloat b, SimdFloat c) |
SIMD float Fused-negated-multiply-add. Result is -a*b+c. More... | |
static SimdFloat gmx_simdcall | gmx::fnms (SimdFloat a, SimdFloat b, SimdFloat c) |
SIMD float Fused-negated-multiply-subtract. Result is -a*b-c. More... | |
static SimdFloat gmx_simdcall | gmx::rsqrt (SimdFloat x) |
SIMD float 1.0/sqrt(x) lookup. More... | |
static SimdFloat gmx_simdcall | gmx::rcp (SimdFloat x) |
SIMD float 1.0/x lookup. More... | |
static SimdFloat gmx_simdcall | gmx::maskAdd (SimdFloat a, SimdFloat b, SimdFBool m) |
Add two float SIMD variables, masked version. More... | |
static SimdFloat gmx_simdcall | gmx::maskzMul (SimdFloat a, SimdFloat b, SimdFBool m) |
Multiply two float SIMD variables, masked version. More... | |
static SimdFloat gmx_simdcall | gmx::maskzFma (SimdFloat a, SimdFloat b, SimdFloat c, SimdFBool m) |
SIMD float fused multiply-add, masked version. More... | |
static SimdFloat gmx_simdcall | gmx::maskzRsqrt (SimdFloat x, SimdFBool m) |
SIMD float 1.0/sqrt(x) lookup, masked version. More... | |
static SimdFloat gmx_simdcall | gmx::maskzRcp (SimdFloat x, SimdFBool m) |
SIMD float 1.0/x lookup, masked version. More... | |
static SimdFloat gmx_simdcall | gmx::abs (SimdFloat a) |
SIMD float Floating-point abs(). More... | |
static SimdFloat gmx_simdcall | gmx::max (SimdFloat a, SimdFloat b) |
Set each SIMD float element to the largest from two variables. More... | |
static SimdFloat gmx_simdcall | gmx::min (SimdFloat a, SimdFloat b) |
Set each SIMD float element to the smallest from two variables. More... | |
static SimdFloat gmx_simdcall | gmx::round (SimdFloat a) |
SIMD float round to nearest integer value (in floating-point format). More... | |
static SimdFloat gmx_simdcall | gmx::trunc (SimdFloat a) |
Truncate SIMD float, i.e. round towards zero - common hardware instruction. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdFloat gmx_simdcall | gmx::frexp (SimdFloat value, SimdFInt32 *exponent) |
Extract (integer) exponent and fraction from single precision SIMD. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdFloat gmx_simdcall | gmx::ldexp (SimdFloat value, SimdFInt32 exponent) |
Multiply a SIMD float value by the number 2 raised to an exp power. More... | |
static float gmx_simdcall | gmx::reduce (SimdFloat a) |
Return sum of all elements in SIMD float variable. More... | |
SIMD implementation single precision floating-point comparisons, boolean, selection. | |
static SimdFBool gmx_simdcall | gmx::operator== (SimdFloat a, SimdFloat b) |
SIMD a==b for single SIMD. More... | |
static SimdFBool gmx_simdcall | gmx::operator!= (SimdFloat a, SimdFloat b) |
SIMD a!=b for single SIMD. More... | |
static SimdFBool gmx_simdcall | gmx::operator< (SimdFloat a, SimdFloat b) |
SIMD a<b for single SIMD. More... | |
static SimdFBool gmx_simdcall | gmx::operator<= (SimdFloat a, SimdFloat b) |
SIMD a<=b for single SIMD. More... | |
static SimdFBool gmx_simdcall | gmx::testBits (SimdFloat a) |
Return true if any bits are set in the single precision SIMD. More... | |
static SimdFBool gmx_simdcall | gmx::operator&& (SimdFBool a, SimdFBool b) |
Logical and on single precision SIMD booleans. More... | |
static SimdFBool gmx_simdcall | gmx::operator|| (SimdFBool a, SimdFBool b) |
Logical or on single precision SIMD booleans. More... | |
static bool gmx_simdcall | gmx::anyTrue (SimdFBool a) |
Returns non-zero if any of the boolean in SIMD a is True, otherwise 0. More... | |
static SimdFloat gmx_simdcall | gmx::selectByMask (SimdFloat a, SimdFBool mask) |
Select from single precision SIMD variable where boolean is true. More... | |
static SimdFloat gmx_simdcall | gmx::selectByNotMask (SimdFloat a, SimdFBool mask) |
Select from single precision SIMD variable where boolean is false. More... | |
static SimdFloat gmx_simdcall | gmx::blend (SimdFloat a, SimdFloat b, SimdFBool sel) |
Vector-blend SIMD float selection. More... | |
SIMD implementation integer (corresponding to float) bitwise logical operations | |
static SimdFInt32 gmx_simdcall | gmx::operator& (SimdFInt32 a, SimdFInt32 b) |
Integer SIMD bitwise and. More... | |
static SimdFInt32 gmx_simdcall | gmx::andNot (SimdFInt32 a, SimdFInt32 b) |
Integer SIMD bitwise not/complement. More... | |
static SimdFInt32 gmx_simdcall | gmx::operator| (SimdFInt32 a, SimdFInt32 b) |
Integer SIMD bitwise or. More... | |
static SimdFInt32 gmx_simdcall | gmx::operator^ (SimdFInt32 a, SimdFInt32 b) |
Integer SIMD bitwise xor. More... | |
SIMD implementation integer (corresponding to float) arithmetics | |
static SimdFInt32 gmx_simdcall | gmx::operator+ (SimdFInt32 a, SimdFInt32 b) |
Add SIMD integers. More... | |
static SimdFInt32 gmx_simdcall | gmx::operator- (SimdFInt32 a, SimdFInt32 b) |
Subtract SIMD integers. More... | |
static SimdFInt32 gmx_simdcall | gmx::operator* (SimdFInt32 a, SimdFInt32 b) |
Multiply SIMD integers. More... | |
SIMD implementation integer (corresponding to float) comparisons, boolean, selection | |
static SimdFIBool gmx_simdcall | gmx::operator== (SimdFInt32 a, SimdFInt32 b) |
Equality comparison of two integers corresponding to float values. More... | |
static SimdFIBool gmx_simdcall | gmx::operator< (SimdFInt32 a, SimdFInt32 b) |
Less-than comparison of two SIMD integers corresponding to float values. More... | |
static SimdFIBool gmx_simdcall | gmx::testBits (SimdFInt32 a) |
Check if any bit is set in each element. More... | |
static SimdFIBool gmx_simdcall | gmx::operator&& (SimdFIBool a, SimdFIBool b) |
Logical AND on SimdFIBool. More... | |
static SimdFIBool gmx_simdcall | gmx::operator|| (SimdFIBool a, SimdFIBool b) |
Logical OR on SimdFIBool. More... | |
static bool gmx_simdcall | gmx::anyTrue (SimdFIBool a) |
Returns true if any of the boolean in x is True, otherwise 0. More... | |
static SimdFInt32 gmx_simdcall | gmx::selectByMask (SimdFInt32 a, SimdFIBool mask) |
Select from gmx::SimdFInt32 variable where boolean is true. More... | |
static SimdFInt32 gmx_simdcall | gmx::selectByNotMask (SimdFInt32 a, SimdFIBool mask) |
Select from gmx::SimdFInt32 variable where boolean is false. More... | |
static SimdFInt32 gmx_simdcall | gmx::blend (SimdFInt32 a, SimdFInt32 b, SimdFIBool sel) |
Vector-blend SIMD integer selection. More... | |
Higher-level SIMD utility functions, double precision. | |
These include generic functions to work with triplets of data, typically coordinates, and a few utility functions to load and update data in the nonbonded kernels. These functions should be available on all implementations. | |
static const int | gmx::c_simdBestPairAlignmentDouble = 2 |
Best alignment to use for aligned pairs of double data. More... | |
template<int align> | |
static void gmx_simdcall | gmx::gatherLoadTranspose (const double *base, const std::int32_t offset[], SimdDouble *v0, SimdDouble *v1, SimdDouble *v2, SimdDouble *v3) |
Load 4 consecutive double from each of GMX_SIMD_DOUBLE_WIDTH offsets, and transpose into 4 SIMD double variables. More... | |
template<int align> | |
static void gmx_simdcall | gmx::gatherLoadTranspose (const double *base, const std::int32_t offset[], SimdDouble *v0, SimdDouble *v1) |
Load 2 consecutive double from each of GMX_SIMD_DOUBLE_WIDTH offsets, and transpose into 2 SIMD double variables. More... | |
template<int align> | |
static void gmx_simdcall | gmx::gatherLoadUTranspose (const double *base, const std::int32_t offset[], SimdDouble *v0, SimdDouble *v1, SimdDouble *v2) |
Load 3 consecutive doubles from each of GMX_SIMD_DOUBLE_WIDTH offsets, and transpose into 3 SIMD double variables. More... | |
template<int align> | |
static void gmx_simdcall | gmx::transposeScatterStoreU (double *base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) |
Transpose and store 3 SIMD doubles to 3 consecutive addresses at GMX_SIMD_DOUBLE_WIDTH offsets. More... | |
template<int align> | |
static void gmx_simdcall | gmx::transposeScatterIncrU (double *base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) |
Transpose and add 3 SIMD doubles to 3 consecutive addresses at GMX_SIMD_DOUBLE_WIDTH offsets. More... | |
template<int align> | |
static void gmx_simdcall | gmx::transposeScatterDecrU (double *base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) |
Transpose and subtract 3 SIMD doubles to 3 consecutive addresses at GMX_SIMD_DOUBLE_WIDTH offsets. More... | |
static void gmx_simdcall | gmx::expandScalarsToTriplets (SimdDouble scalar, SimdDouble *triplets0, SimdDouble *triplets1, SimdDouble *triplets2) |
Expand each element of double SIMD variable into three identical consecutive elements in three SIMD outputs. More... | |
template<int align> | |
static void gmx_simdcall | gmx::gatherLoadBySimdIntTranspose (const double *base, SimdDInt32 offset, SimdDouble *v0, SimdDouble *v1, SimdDouble *v2, SimdDouble *v3) |
Load 4 consecutive doubles from each of GMX_SIMD_DOUBLE_WIDTH offsets specified by a SIMD integer, transpose into 4 SIMD double variables. More... | |
template<int align> | |
static void gmx_simdcall | gmx::gatherLoadUBySimdIntTranspose (const double *base, SimdDInt32 offset, SimdDouble *v0, SimdDouble *v1) |
Load 2 consecutive doubles from each of GMX_SIMD_DOUBLE_WIDTH offsets (unaligned) specified by SIMD integer, transpose into 2 SIMD doubles. More... | |
template<int align> | |
static void gmx_simdcall | gmx::gatherLoadBySimdIntTranspose (const double *base, SimdDInt32 offset, SimdDouble *v0, SimdDouble *v1) |
Load 2 consecutive doubles from each of GMX_SIMD_DOUBLE_WIDTH offsets specified by a SIMD integer, transpose into 2 SIMD double variables. More... | |
static double gmx_simdcall | gmx::reduceIncr4ReturnSum (double *m, SimdDouble v0, SimdDouble v1, SimdDouble v2, SimdDouble v3) |
Reduce each of four SIMD doubles, add those values to four consecutive doubles in memory, return sum. More... | |
Higher-level SIMD utilities accessing partial (half-width) SIMD doubles. | |
See the single-precision versions for documentation. Since double precision is typically half the width of single, this double version is likely only useful with 512-bit and larger implementations. | |
static SimdDouble gmx_simdcall | gmx::loadDualHsimd (const double *m0, const double *m1) |
Load low & high parts of SIMD double from different locations. More... | |
static SimdDouble gmx_simdcall | gmx::loadDuplicateHsimd (const double *m) |
Load half-SIMD-width double data, spread to both halves. More... | |
static SimdDouble gmx_simdcall | gmx::loadU1DualHsimd (const double *m) |
Load two doubles, spread 1st in low half, 2nd in high half. More... | |
static void gmx_simdcall | gmx::storeDualHsimd (double *m0, double *m1, SimdDouble a) |
Store low & high parts of SIMD double to different locations. More... | |
static void gmx_simdcall | gmx::incrDualHsimd (double *m0, double *m1, SimdDouble a) |
Add each half of SIMD variable to separate memory adresses. More... | |
static void gmx_simdcall | gmx::decr3Hsimd (double *m, SimdDouble a0, SimdDouble a1, SimdDouble a2) |
Add the two halves of three SIMD doubles, subtract the sum from three half-SIMD-width consecutive doubles in memory. More... | |
template<int align> | |
static void gmx_simdcall | gmx::gatherLoadTransposeHsimd (const double *base0, const double *base1, std::int32_t offset[], SimdDouble *v0, SimdDouble *v1) |
Load 2 consecutive doubles from each of GMX_SIMD_DOUBLE_WIDTH/2 offsets, transpose into SIMD double (low half from base0, high from base1). More... | |
static double gmx_simdcall | gmx::reduceIncr4ReturnSumHsimd (double *m, SimdDouble v0, SimdDouble v1) |
Reduce the 4 half-SIMD-with doubles in 2 SIMD variables (sum halves), increment four consecutive doubles in memory, return sum. More... | |
static SimdDouble gmx_simdcall | gmx::loadUNDuplicate4 (const double *m) |
Load N doubles and duplicate them 4 times each. More... | |
static SimdDouble gmx_simdcall | gmx::load4DuplicateN (const double *m) |
Load 4 doubles and duplicate them N times each. More... | |
static SimdDouble gmx_simdcall | gmx::loadU4NOffset (const double *m, int offset) |
Load doubles in blocks of 4 at fixed offsets. More... | |
Higher-level SIMD utility functions, single precision. | |
These include generic functions to work with triplets of data, typically coordinates, and a few utility functions to load and update data in the nonbonded kernels. These functions should be available on all implementations, although some wide SIMD implementations (width>=8) also provide special optional versions to work with half or quarter registers to improve the performance in the nonbonded kernels. | |
static const int | gmx::c_simdBestPairAlignmentFloat = 2 |
Best alignment to use for aligned pairs of float data. More... | |
template<int align> | |
static void gmx_simdcall | gmx::gatherLoadTranspose (const float *base, const std::int32_t offset[], SimdFloat *v0, SimdFloat *v1, SimdFloat *v2, SimdFloat *v3) |
Load 4 consecutive floats from each of GMX_SIMD_FLOAT_WIDTH offsets, and transpose into 4 SIMD float variables. More... | |
template<int align> | |
static void gmx_simdcall | gmx::gatherLoadTranspose (const float *base, const std::int32_t offset[], SimdFloat *v0, SimdFloat *v1) |
Load 2 consecutive floats from each of GMX_SIMD_FLOAT_WIDTH offsets, and transpose into 2 SIMD float variables. More... | |
template<int align> | |
static void gmx_simdcall | gmx::gatherLoadUTranspose (const float *base, const std::int32_t offset[], SimdFloat *v0, SimdFloat *v1, SimdFloat *v2) |
Load 3 consecutive floats from each of GMX_SIMD_FLOAT_WIDTH offsets, and transpose into 3 SIMD float variables. More... | |
template<int align> | |
static void gmx_simdcall | gmx::transposeScatterStoreU (float *base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) |
Transpose and store 3 SIMD floats to 3 consecutive addresses at GMX_SIMD_FLOAT_WIDTH offsets. More... | |
template<int align> | |
static void gmx_simdcall | gmx::transposeScatterIncrU (float *base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) |
Transpose and add 3 SIMD floats to 3 consecutive addresses at GMX_SIMD_FLOAT_WIDTH offsets. More... | |
template<int align> | |
static void gmx_simdcall | gmx::transposeScatterDecrU (float *base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) |
Transpose and subtract 3 SIMD floats to 3 consecutive addresses at GMX_SIMD_FLOAT_WIDTH offsets. More... | |
static void gmx_simdcall | gmx::expandScalarsToTriplets (SimdFloat scalar, SimdFloat *triplets0, SimdFloat *triplets1, SimdFloat *triplets2) |
Expand each element of float SIMD variable into three identical consecutive elements in three SIMD outputs. More... | |
template<int align> | |
static void gmx_simdcall | gmx::gatherLoadBySimdIntTranspose (const float *base, SimdFInt32 offset, SimdFloat *v0, SimdFloat *v1, SimdFloat *v2, SimdFloat *v3) |
Load 4 consecutive floats from each of GMX_SIMD_FLOAT_WIDTH offsets specified by a SIMD integer, transpose into 4 SIMD float variables. More... | |
template<int align> | |
static void gmx_simdcall | gmx::gatherLoadUBySimdIntTranspose (const float *base, SimdFInt32 offset, SimdFloat *v0, SimdFloat *v1) |
Load 2 consecutive floats from each of GMX_SIMD_FLOAT_WIDTH offsets (unaligned) specified by SIMD integer, transpose into 2 SIMD floats. More... | |
template<int align> | |
static void gmx_simdcall | gmx::gatherLoadBySimdIntTranspose (const float *base, SimdFInt32 offset, SimdFloat *v0, SimdFloat *v1) |
Load 2 consecutive floats from each of GMX_SIMD_FLOAT_WIDTH offsets specified by a SIMD integer, transpose into 2 SIMD float variables. More... | |
static float gmx_simdcall | gmx::reduceIncr4ReturnSum (float *m, SimdFloat v0, SimdFloat v1, SimdFloat v2, SimdFloat v3) |
Reduce each of four SIMD floats, add those values to four consecutive floats in memory, return sum. More... | |
Higher-level SIMD utilities accessing partial (half-width) SIMD floats. | |
These functions are optional. The are only useful for SIMD implementation where the width is 8 or larger, and where it would be inefficient to process 4*8, 8*8, or more, interactions in parallel. Currently, only Intel provides very wide SIMD implementations, but these also come with excellent support for loading, storing, accessing and shuffling parts of the register in so-called 'lanes' of 4 bytes each. We can use this to load separate parts into the low/high halves of the register in the inner loop of the nonbonded kernel, which e.g. makes it possible to process 4*4 nonbonded interactions as a pattern of 2*8. We can also use implementations with width 16 or greater. To make this more generic, when GMX_SIMD_HAVE_HSIMD_UTIL_REAL is 1, the SIMD implementation provides seven special routines that:
Remember: this is ONLY used when the native SIMD width is large. You will just waste time if you implement it for normal 16-byte SIMD architectures. This is part of the new C++ SIMD interface, so these functions are only available when using C++. Since some Gromacs code reliying on the SIMD module is still C (not C++), we have kept the C-style naming for now - this will change once we are entirely C++. | |
static SimdFloat gmx_simdcall | gmx::loadDualHsimd (const float *m0, const float *m1) |
Load low & high parts of SIMD float from different locations. More... | |
static SimdFloat gmx_simdcall | gmx::loadDuplicateHsimd (const float *m) |
Load half-SIMD-width float data, spread to both halves. More... | |
static SimdFloat gmx_simdcall | gmx::loadU1DualHsimd (const float *m) |
Load two floats, spread 1st in low half, 2nd in high half. More... | |
static void gmx_simdcall | gmx::storeDualHsimd (float *m0, float *m1, SimdFloat a) |
Store low & high parts of SIMD float to different locations. More... | |
static void gmx_simdcall | gmx::incrDualHsimd (float *m0, float *m1, SimdFloat a) |
Add each half of SIMD variable to separate memory adresses. More... | |
static void gmx_simdcall | gmx::decr3Hsimd (float *m, SimdFloat a0, SimdFloat a1, SimdFloat a2) |
Add the two halves of three SIMD floats, subtract the sum from three half-SIMD-width consecutive floats in memory. More... | |
template<int align> | |
static void gmx_simdcall | gmx::gatherLoadTransposeHsimd (const float *base0, const float *base1, const std::int32_t offset[], SimdFloat *v0, SimdFloat *v1) |
Load 2 consecutive floats from each of GMX_SIMD_FLOAT_WIDTH/2 offsets, transpose into SIMD float (low half from base0, high from base1). More... | |
static float gmx_simdcall | gmx::reduceIncr4ReturnSumHsimd (float *m, SimdFloat v0, SimdFloat v1) |
Reduce the 4 half-SIMD-with floats in 2 SIMD variables (sum halves), increment four consecutive floats in memory, return sum. More... | |
static SimdFloat gmx_simdcall | gmx::loadUNDuplicate4 (const float *m) |
Load N floats and duplicate them 4 times each. More... | |
static SimdFloat gmx_simdcall | gmx::load4DuplicateN (const float *m) |
Load 4 floats and duplicate them N times each. More... | |
static SimdFloat gmx_simdcall | gmx::loadU4NOffset (const float *m, int offset) |
Load floats in blocks of 4 at fixed offsets. More... | |
SIMD predefined macros to describe high-level capabilities | |
These macros are used to describe the features available in default Gromacs real precision. They are set from the lower-level implementation files that have macros describing single and double precision individually, as well as the implementation details. | |
#define | GMX_SIMD_HAVE_REAL GMX_SIMD_HAVE_FLOAT |
1 if SimdReal is available, otherwise 0. More... | |
#define | GMX_SIMD_REAL_WIDTH GMX_SIMD_FLOAT_WIDTH |
Width of SimdReal. More... | |
#define | GMX_SIMD_HAVE_INT32_EXTRACT GMX_SIMD_HAVE_FINT32_EXTRACT |
1 if support is available for extracting elements from SimdInt32, otherwise 0 More... | |
#define | GMX_SIMD_HAVE_INT32_LOGICAL GMX_SIMD_HAVE_FINT32_LOGICAL |
1 if logical ops are supported on SimdInt32, otherwise 0. More... | |
#define | GMX_SIMD_HAVE_INT32_ARITHMETICS GMX_SIMD_HAVE_FINT32_ARITHMETICS |
1 if arithmetic ops are supported on SimdInt32, otherwise 0. More... | |
#define | GMX_SIMD_HAVE_GATHER_LOADU_BYSIMDINT_TRANSPOSE_REAL GMX_SIMD_HAVE_GATHER_LOADU_BYSIMDINT_TRANSPOSE_FLOAT |
1 if gmx::simdGatherLoadUBySimdIntTranspose is present, otherwise 0 More... | |
#define | GMX_SIMD_HAVE_HSIMD_UTIL_REAL GMX_SIMD_HAVE_HSIMD_UTIL_FLOAT |
1 if real half-register load/store/reduce utils present, otherwise 0 More... | |
#define | GMX_SIMD4_HAVE_REAL GMX_SIMD4_HAVE_FLOAT |
1 if Simd4Real is available, otherwise 0. More... | |
Single precision SIMD math functions | |
| |
static SimdFloat gmx_simdcall | gmx::copysign (SimdFloat x, SimdFloat y) |
Composes floating point value with the magnitude of x and the sign of y. More... | |
static SimdFloat gmx_simdcall | gmx::rsqrtIter (SimdFloat lu, SimdFloat x) |
Perform one Newton-Raphson iteration to improve 1/sqrt(x) for SIMD float. More... | |
static SimdFloat gmx_simdcall | gmx::invsqrt (SimdFloat x) |
Calculate 1/sqrt(x) for SIMD float. More... | |
static void gmx_simdcall | gmx::invsqrtPair (SimdFloat x0, SimdFloat x1, SimdFloat *out0, SimdFloat *out1) |
Calculate 1/sqrt(x) for two SIMD floats. More... | |
static SimdFloat gmx_simdcall | gmx::rcpIter (SimdFloat lu, SimdFloat x) |
Perform one Newton-Raphson iteration to improve 1/x for SIMD float. More... | |
static SimdFloat gmx_simdcall | gmx::inv (SimdFloat x) |
Calculate 1/x for SIMD float. More... | |
static SimdFloat gmx_simdcall | gmx::operator/ (SimdFloat nom, SimdFloat denom) |
Division for SIMD floats. More... | |
static SimdFloat | gmx::maskzInvsqrt (SimdFloat x, SimdFBool m) |
Calculate 1/sqrt(x) for masked entries of SIMD float. More... | |
static SimdFloat gmx_simdcall | gmx::maskzInv (SimdFloat x, SimdFBool m) |
Calculate 1/x for SIMD float, masked version. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdFloat gmx_simdcall | gmx::sqrt (SimdFloat x) |
Calculate sqrt(x) for SIMD floats. More... | |
static SimdFloat gmx_simdcall | gmx::cbrt (SimdFloat x) |
Cube root for SIMD floats. More... | |
static SimdFloat gmx_simdcall | gmx::invcbrt (SimdFloat x) |
Inverse cube root for SIMD floats. More... | |
static SimdFloat gmx_simdcall | gmx::log2 (SimdFloat x) |
SIMD float log2(x). This is the base-2 logarithm. More... | |
static SimdFloat gmx_simdcall | gmx::log (SimdFloat x) |
SIMD float log(x). This is the natural logarithm. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdFloat gmx_simdcall | gmx::exp2 (SimdFloat x) |
SIMD float 2^x. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdFloat gmx_simdcall | gmx::exp (SimdFloat x) |
SIMD float exp(x). More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdFloat gmx_simdcall | gmx::pow (SimdFloat x, SimdFloat y) |
SIMD float pow(x,y) More... | |
static SimdFloat gmx_simdcall | gmx::erf (SimdFloat x) |
SIMD float erf(x). More... | |
static SimdFloat gmx_simdcall | gmx::erfc (SimdFloat x) |
SIMD float erfc(x). More... | |
static void gmx_simdcall | gmx::sincos (SimdFloat x, SimdFloat *sinval, SimdFloat *cosval) |
SIMD float sin & cos. More... | |
static SimdFloat gmx_simdcall | gmx::sin (SimdFloat x) |
SIMD float sin(x). More... | |
static SimdFloat gmx_simdcall | gmx::cos (SimdFloat x) |
SIMD float cos(x). More... | |
static SimdFloat gmx_simdcall | gmx::tan (SimdFloat x) |
SIMD float tan(x). More... | |
static SimdFloat gmx_simdcall | gmx::asin (SimdFloat x) |
SIMD float asin(x). More... | |
static SimdFloat gmx_simdcall | gmx::acos (SimdFloat x) |
SIMD float acos(x). More... | |
static SimdFloat gmx_simdcall | gmx::atan (SimdFloat x) |
SIMD float asin(x). More... | |
static SimdFloat gmx_simdcall | gmx::atan2 (SimdFloat y, SimdFloat x) |
SIMD float atan2(y,x). More... | |
static SimdFloat gmx_simdcall | gmx::pmeForceCorrection (SimdFloat z2) |
Calculate the force correction due to PME analytically in SIMD float. More... | |
static SimdFloat gmx_simdcall | gmx::pmePotentialCorrection (SimdFloat z2) |
Calculate the potential correction due to PME analytically in SIMD float. More... | |
Double precision SIMD math functions | |
| |
static SimdDouble gmx_simdcall | gmx::copysign (SimdDouble x, SimdDouble y) |
Composes floating point value with the magnitude of x and the sign of y. More... | |
static SimdDouble gmx_simdcall | gmx::rsqrtIter (SimdDouble lu, SimdDouble x) |
Perform one Newton-Raphson iteration to improve 1/sqrt(x) for SIMD double. More... | |
static SimdDouble gmx_simdcall | gmx::invsqrt (SimdDouble x) |
Calculate 1/sqrt(x) for SIMD double. More... | |
static void gmx_simdcall | gmx::invsqrtPair (SimdDouble x0, SimdDouble x1, SimdDouble *out0, SimdDouble *out1) |
Calculate 1/sqrt(x) for two SIMD doubles. More... | |
static SimdDouble gmx_simdcall | gmx::rcpIter (SimdDouble lu, SimdDouble x) |
Perform one Newton-Raphson iteration to improve 1/x for SIMD double. More... | |
static SimdDouble gmx_simdcall | gmx::inv (SimdDouble x) |
Calculate 1/x for SIMD double. More... | |
static SimdDouble gmx_simdcall | gmx::operator/ (SimdDouble nom, SimdDouble denom) |
Division for SIMD doubles. More... | |
static SimdDouble | gmx::maskzInvsqrt (SimdDouble x, SimdDBool m) |
Calculate 1/sqrt(x) for masked entries of SIMD double. More... | |
static SimdDouble gmx_simdcall | gmx::maskzInv (SimdDouble x, SimdDBool m) |
Calculate 1/x for SIMD double, masked version. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdDouble gmx_simdcall | gmx::sqrt (SimdDouble x) |
Calculate sqrt(x) for SIMD doubles. More... | |
static SimdDouble gmx_simdcall | gmx::cbrt (SimdDouble x) |
Cube root for SIMD doubles. More... | |
static SimdDouble gmx_simdcall | gmx::invcbrt (SimdDouble x) |
Inverse cube root for SIMD doubles. More... | |
static SimdDouble gmx_simdcall | gmx::log2 (SimdDouble x) |
SIMD double log2(x). This is the base-2 logarithm. More... | |
static SimdDouble gmx_simdcall | gmx::log (SimdDouble x) |
SIMD double log(x). This is the natural logarithm. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdDouble gmx_simdcall | gmx::exp2 (SimdDouble x) |
SIMD double 2^x. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdDouble gmx_simdcall | gmx::exp (SimdDouble x) |
SIMD double exp(x). More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdDouble gmx_simdcall | gmx::pow (SimdDouble x, SimdDouble y) |
SIMD double pow(x,y) More... | |
static SimdDouble gmx_simdcall | gmx::erf (SimdDouble x) |
SIMD double erf(x). More... | |
static SimdDouble gmx_simdcall | gmx::erfc (SimdDouble x) |
SIMD double erfc(x). More... | |
static void gmx_simdcall | gmx::sincos (SimdDouble x, SimdDouble *sinval, SimdDouble *cosval) |
SIMD double sin & cos. More... | |
static SimdDouble gmx_simdcall | gmx::sin (SimdDouble x) |
SIMD double sin(x). More... | |
static SimdDouble gmx_simdcall | gmx::cos (SimdDouble x) |
SIMD double cos(x). More... | |
static SimdDouble gmx_simdcall | gmx::tan (SimdDouble x) |
SIMD double tan(x). More... | |
static SimdDouble gmx_simdcall | gmx::asin (SimdDouble x) |
SIMD double asin(x). More... | |
static SimdDouble gmx_simdcall | gmx::acos (SimdDouble x) |
SIMD double acos(x). More... | |
static SimdDouble gmx_simdcall | gmx::atan (SimdDouble x) |
SIMD double asin(x). More... | |
static SimdDouble gmx_simdcall | gmx::atan2 (SimdDouble y, SimdDouble x) |
SIMD double atan2(y,x). More... | |
static SimdDouble gmx_simdcall | gmx::pmeForceCorrection (SimdDouble z2) |
Calculate the force correction due to PME analytically in SIMD double. More... | |
static SimdDouble gmx_simdcall | gmx::pmePotentialCorrection (SimdDouble z2) |
Calculate the potential correction due to PME analytically in SIMD double. More... | |
SIMD math functions for double prec. data, single prec. accuracy | |
| |
static SimdDouble gmx_simdcall | gmx::invsqrtSingleAccuracy (SimdDouble x) |
Calculate 1/sqrt(x) for SIMD double, but in single accuracy. More... | |
static SimdDouble | gmx::maskzInvsqrtSingleAccuracy (SimdDouble x, SimdDBool m) |
1/sqrt(x) for masked-in entries of SIMD double, but in single accuracy. More... | |
static void gmx_simdcall | gmx::invsqrtPairSingleAccuracy (SimdDouble x0, SimdDouble x1, SimdDouble *out0, SimdDouble *out1) |
Calculate 1/sqrt(x) for two SIMD doubles, but single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::invSingleAccuracy (SimdDouble x) |
Calculate 1/x for SIMD double, but in single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::maskzInvSingleAccuracy (SimdDouble x, SimdDBool m) |
1/x for masked entries of SIMD double, single accuracy. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdDouble gmx_simdcall | gmx::sqrtSingleAccuracy (SimdDouble x) |
Calculate sqrt(x) (correct for 0.0) for SIMD double, with single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::cbrtSingleAccuracy (SimdDouble x) |
Cube root for SIMD doubles, single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::invcbrtSingleAccuracy (SimdDouble x) |
Inverse cube root for SIMD doubles, single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::log2SingleAccuracy (SimdDouble x) |
SIMD log2(x). Double precision SIMD data, single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::logSingleAccuracy (SimdDouble x) |
SIMD log(x). Double precision SIMD data, single accuracy. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdDouble gmx_simdcall | gmx::exp2SingleAccuracy (SimdDouble x) |
SIMD 2^x. Double precision SIMD, single accuracy. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdDouble gmx_simdcall | gmx::expSingleAccuracy (SimdDouble x) |
SIMD exp(x). Double precision SIMD, single accuracy. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdDouble gmx_simdcall | gmx::powSingleAccuracy (SimdDouble x, SimdDouble y) |
SIMD pow(x,y). Double precision SIMD data, single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::erfSingleAccuracy (SimdDouble x) |
SIMD erf(x). Double precision SIMD data, single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::erfcSingleAccuracy (SimdDouble x) |
SIMD erfc(x). Double precision SIMD data, single accuracy. More... | |
static void gmx_simdcall | gmx::sinCosSingleAccuracy (SimdDouble x, SimdDouble *sinval, SimdDouble *cosval) |
SIMD sin & cos. Double precision SIMD data, single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::sinSingleAccuracy (SimdDouble x) |
SIMD sin(x). Double precision SIMD data, single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::cosSingleAccuracy (SimdDouble x) |
SIMD cos(x). Double precision SIMD data, single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::tanSingleAccuracy (SimdDouble x) |
SIMD tan(x). Double precision SIMD data, single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::asinSingleAccuracy (SimdDouble x) |
SIMD asin(x). Double precision SIMD data, single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::acosSingleAccuracy (SimdDouble x) |
SIMD acos(x). Double precision SIMD data, single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::atanSingleAccuracy (SimdDouble x) |
SIMD asin(x). Double precision SIMD data, single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::atan2SingleAccuracy (SimdDouble y, SimdDouble x) |
SIMD atan2(y,x). Double precision SIMD data, single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::pmeForceCorrectionSingleAccuracy (SimdDouble z2) |
Analytical PME force correction, double SIMD data, single accuracy. More... | |
static SimdDouble gmx_simdcall | gmx::pmePotentialCorrectionSingleAccuracy (SimdDouble z2) |
Analytical PME potential correction, double SIMD data, single accuracy. More... | |
SIMD4 math functions | |
| |
static Simd4Float gmx_simdcall | gmx::rsqrtIter (Simd4Float lu, Simd4Float x) |
Perform one Newton-Raphson iteration to improve 1/sqrt(x) for SIMD4 float. More... | |
static Simd4Float gmx_simdcall | gmx::invsqrt (Simd4Float x) |
Calculate 1/sqrt(x) for SIMD4 float. More... | |
static Simd4Double gmx_simdcall | gmx::rsqrtIter (Simd4Double lu, Simd4Double x) |
Perform one Newton-Raphson iteration to improve 1/sqrt(x) for SIMD4 double. More... | |
static Simd4Double gmx_simdcall | gmx::invsqrt (Simd4Double x) |
Calculate 1/sqrt(x) for SIMD4 double. More... | |
static Simd4Double gmx_simdcall | gmx::invsqrtSingleAccuracy (Simd4Double x) |
Calculate 1/sqrt(x) for SIMD4 double, but in single accuracy. More... | |
Classes | |
class | gmx::Simd4Double |
SIMD4 double type. More... | |
class | gmx::Simd4DBool |
SIMD4 variable type to use for logical comparisons on doubles. More... | |
class | gmx::Simd4Float |
SIMD4 float type. More... | |
class | gmx::Simd4FBool |
SIMD4 variable type to use for logical comparisons on floats. More... | |
class | gmx::SimdDouble |
Double SIMD variable. Available if GMX_SIMD_HAVE_DOUBLE is 1. More... | |
class | gmx::SimdDInt32 |
Integer SIMD variable type to use for conversions to/from double. More... | |
class | gmx::SimdDBool |
Boolean type for double SIMD data. More... | |
class | gmx::SimdDIBool |
Boolean type for integer datatypes corresponding to double SIMD. More... | |
class | gmx::SimdFloat |
Float SIMD variable. Available if GMX_SIMD_HAVE_FLOAT is 1. More... | |
class | gmx::SimdFInt32 |
Integer SIMD variable type to use for conversions to/from float. More... | |
class | gmx::SimdFBool |
Boolean type for float SIMD data. More... | |
class | gmx::SimdFIBool |
Boolean type for integer datatypes corresponding to float SIMD. More... | |
class | gmx::test::SimdBaseTest |
Base class for SIMD test fixtures. More... | |
class | gmx::test::SimdTest |
Test fixture for SIMD tests. More... | |
class | gmx::test::Simd4Test |
Test fixture for SIMD4 tests - contains test settings. More... | |
class | gmx::test::anonymous_namespace{simd_floatingpoint_util.cpp}::SimdFloatingpointUtilTest |
Test fixture for higher-level floating-point utility functions. More... | |
Macros | |
#define | GMX_EXPECT_SIMD_REAL_EQ(ref, tst) EXPECT_PRED_FORMAT2(compareSimdEq, ref, tst) |
Test if a SIMD real is bitwise identical to reference SIMD value. | |
#define | GMX_EXPECT_SIMD_EQ(ref, tst) EXPECT_PRED_FORMAT2(compareSimdEq, ref, tst) |
Test if a SIMD is bitwise identical to reference SIMD value. | |
#define | GMX_EXPECT_SIMD_REAL_NEAR(ref, tst) EXPECT_PRED_FORMAT2(compareSimdRealUlp, ref, tst) |
Test if a SIMD real is within tolerance of reference SIMD value. | |
#define | GMX_EXPECT_SIMD_INT_EQ(ref, tst) EXPECT_PRED_FORMAT2(compareSimdEq, ref, tst) |
Macro that checks SIMD integer expression against SIMD or reference int. More... | |
#define | GMX_EXPECT_SIMD4_REAL_EQ(ref, tst) EXPECT_PRED_FORMAT2(compareSimd4RealEq, ref, tst) |
Test if a SIMD4 real is bitwise identical to reference SIMD4 value. | |
#define | GMX_EXPECT_SIMD4_REAL_NEAR(ref, tst) EXPECT_PRED_FORMAT2(compareSimd4RealUlp, ref, tst) |
Test if a SIMD4 real is within tolerance of reference SIMD4 value. | |
#define | GMX_EXPECT_SIMD_FUNC_NEAR(refFunc, tstFunc, compareSettings) EXPECT_PRED_FORMAT3(compareSimdMathFunction, refFunc, tstFunc, compareSettings) |
Test approximate equality of SIMD vs reference version of a function. More... | |
Typedefs | |
typedef Simd4Test | gmx::test::anonymous_namespace{simd4_floatingpoint.cpp}::Simd4FloatingpointTest |
Test fixture for SIMD4 floating-point operations (identical to the SIMD4 Simd4Test) | |
typedef Simd4Test | gmx::test::anonymous_namespace{simd4_vector_operations.cpp}::Simd4VectorOperationsTest |
Test fixture for SIMD4 vector operations (identical to the SIMD4 Simd4Test) | |
typedef SimdTest | gmx::test::anonymous_namespace{simd_floatingpoint.cpp}::SimdFloatingpointTest |
Test fixture for floating-point tests (identical to the generic SimdTest) | |
typedef SimdTest | gmx::test::anonymous_namespace{simd_integer.cpp}::SimdIntegerTest |
Test fixture for integer tests (identical to the generic SimdTest) | |
typedef SimdTest | gmx::test::anonymous_namespace{simd_vector_operations.cpp}::SimdVectorOperationsTest |
Test fixture for vector operations tests (identical to the generic SimdTest) More... | |
Functions | |
static SimdFloat gmx_simdcall | gmx::invsqrtSingleAccuracy (SimdFloat x) |
Calculate 1/sqrt(x) for SIMD float, only targeting single accuracy. More... | |
static SimdFloat | gmx::maskzInvsqrtSingleAccuracy (SimdFloat x, SimdFBool m) |
Calculate 1/sqrt(x) for masked SIMD floats, only targeting single accuracy. More... | |
static void gmx_simdcall | gmx::invsqrtPairSingleAccuracy (SimdFloat x0, SimdFloat x1, SimdFloat *out0, SimdFloat *out1) |
Calculate 1/sqrt(x) for two SIMD floats, only targeting single accuracy. More... | |
static SimdFloat gmx_simdcall | gmx::invSingleAccuracy (SimdFloat x) |
Calculate 1/x for SIMD float, only targeting single accuracy. More... | |
static SimdFloat | gmx::maskzInvSingleAccuracy (SimdFloat x, SimdFBool m) |
Calculate 1/x for masked SIMD floats, only targeting single accuracy. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdFloat gmx_simdcall | gmx::sqrtSingleAccuracy (SimdFloat x) |
Calculate sqrt(x) for SIMD float, always targeting single accuracy. More... | |
static SimdFloat gmx_simdcall | gmx::cbrtSingleAccuracy (SimdFloat x) |
Calculate cbrt(x) for SIMD float, always targeting single accuracy. More... | |
static SimdFloat gmx_simdcall | gmx::invcbrtSingleAccuracy (SimdFloat x) |
Calculate 1/cbrt(x) for SIMD float, always targeting single accuracy. More... | |
static SimdFloat gmx_simdcall | gmx::log2SingleAccuracy (SimdFloat x) |
SIMD float log2(x), only targeting single accuracy. This is the base-2 logarithm. More... | |
static SimdFloat gmx_simdcall | gmx::logSingleAccuracy (SimdFloat x) |
SIMD float log(x), only targeting single accuracy. This is the natural logarithm. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdFloat gmx_simdcall | gmx::exp2SingleAccuracy (SimdFloat x) |
SIMD float 2^x, only targeting single accuracy. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdFloat gmx_simdcall | gmx::expSingleAccuracy (SimdFloat x) |
SIMD float e^x, only targeting single accuracy. More... | |
template<MathOptimization opt = MathOptimization::Safe> | |
static SimdFloat gmx_simdcall | gmx::powSingleAccuracy (SimdFloat x, SimdFloat y) |
SIMD pow(x,y), only targeting single accuracy. More... | |
static SimdFloat gmx_simdcall | gmx::erfSingleAccuracy (SimdFloat x) |
SIMD float erf(x), only targeting single accuracy. More... | |
static SimdFloat gmx_simdcall | gmx::erfcSingleAccuracy (SimdFloat x) |
SIMD float erfc(x), only targeting single accuracy. More... | |
static void gmx_simdcall | gmx::sinCosSingleAccuracy (SimdFloat x, SimdFloat *sinval, SimdFloat *cosval) |
SIMD float sin & cos, only targeting single accuracy. More... | |
static SimdFloat gmx_simdcall | gmx::sinSingleAccuracy (SimdFloat x) |
SIMD float sin(x), only targeting single accuracy. More... | |
static SimdFloat gmx_simdcall | gmx::cosSingleAccuracy (SimdFloat x) |
SIMD float cos(x), only targeting single accuracy. More... | |
static SimdFloat gmx_simdcall | gmx::tanSingleAccuracy (SimdFloat x) |
SIMD float tan(x), only targeting single accuracy. More... | |
static SimdFloat gmx_simdcall | gmx::asinSingleAccuracy (SimdFloat x) |
SIMD float asin(x), only targeting single accuracy. More... | |
static SimdFloat gmx_simdcall | gmx::acosSingleAccuracy (SimdFloat x) |
SIMD float acos(x), only targeting single accuracy. More... | |
static SimdFloat gmx_simdcall | gmx::atanSingleAccuracy (SimdFloat x) |
SIMD float atan(x), only targeting single accuracy. More... | |
static SimdFloat gmx_simdcall | gmx::atan2SingleAccuracy (SimdFloat y, SimdFloat x) |
SIMD float atan2(y,x), only targeting single accuracy. More... | |
static SimdFloat gmx_simdcall | gmx::pmeForceCorrectionSingleAccuracy (SimdFloat z2) |
SIMD Analytic PME force correction, only targeting single accuracy. More... | |
static SimdFloat gmx_simdcall | gmx::pmePotentialCorrectionSingleAccuracy (SimdFloat z2) |
SIMD Analytic PME potential correction, only targeting single accuracy. More... | |
static Simd4Float gmx_simdcall | gmx::invsqrtSingleAccuracy (Simd4Float x) |
Calculate 1/sqrt(x) for SIMD4 float, only targeting single accuracy. More... | |
template<typename T , typename TSimd , int simdWidth> | |
void | gmx::test::anonymous_namespace{bootstrap_loadstore.cpp}::loadStoreTester (TSimd gmx_simdcall loadFn(const T *mem), void gmx_simdcall storeFn(T *mem, TSimd), const int loadOffset, const int storeOffset) |
Generic routine to test load & store of SIMD, and check for side effects. More... | |
template<typename T , typename TSimd > | |
TSimd gmx_simdcall | gmx::test::anonymous_namespace{bootstrap_loadstore.cpp}::loadWrapper (const T *m) |
Wrapper to handle proxy objects returned by some load functions. More... | |
template<typename T , typename TSimd > | |
TSimd gmx_simdcall | gmx::test::anonymous_namespace{bootstrap_loadstore.cpp}::loadUWrapper (const T *m) |
Wrapper to handle proxy objects returned by some loadU functions. More... | |
::std::vector< real > | gmx::test::simdReal2Vector (SimdReal simd) |
Convert SIMD real to std::vector<real>. More... | |
SimdReal | gmx::test::vector2SimdReal (const std::vector< real > &v) |
Return floating-point SIMD value from std::vector<real>. More... | |
SimdReal | gmx::test::setSimdRealFrom3R (real r0, real r1, real r2) |
Set SIMD register contents from three real values. More... | |
SimdReal | gmx::test::setSimdRealFrom1R (real value) |
Set SIMD register contents from single real value. More... | |
std::vector< std::int32_t > | gmx::test::simdInt2Vector (SimdInt32 simd) |
Convert SIMD integer to std::vector<int>. More... | |
SimdInt32 | gmx::test::vector2SimdInt (const std::vector< std::int32_t > &v) |
Return 32-bit integer SIMD value from std::vector<int>. More... | |
SimdInt32 | gmx::test::setSimdIntFrom3I (int i0, int i1, int i2) |
Set SIMD register contents from three int values. More... | |
SimdInt32 | gmx::test::setSimdIntFrom1I (int value) |
Set SIMD register contents from single integer value. More... | |
::std::vector< real > | gmx::test::simd4Real2Vector (Simd4Real simd4) |
Convert SIMD4 real to std::vector<real>. More... | |
Simd4Real | gmx::test::vector2Simd4Real (const std::vector< real > &v) |
Return floating-point SIMD4 value from std::vector<real>. More... | |
Simd4Real | gmx::test::setSimd4RealFrom3R (real r0, real r1, real r2) |
Set SIMD4 register contents from three real values. More... | |
Simd4Real | gmx::test::setSimd4RealFrom1R (real value) |
Set SIMD4 register contents from single real value. More... | |
static SimdFloat gmx_simdcall | gmx::iprod (SimdFloat ax, SimdFloat ay, SimdFloat az, SimdFloat bx, SimdFloat by, SimdFloat bz) |
SIMD float inner product of multiple float vectors. More... | |
static SimdFloat gmx_simdcall | gmx::norm2 (SimdFloat ax, SimdFloat ay, SimdFloat az) |
SIMD float norm squared of multiple vectors. More... | |
static void gmx_simdcall | gmx::cprod (SimdFloat ax, SimdFloat ay, SimdFloat az, SimdFloat bx, SimdFloat by, SimdFloat bz, SimdFloat *cx, SimdFloat *cy, SimdFloat *cz) |
SIMD float cross-product of multiple vectors. More... | |
static SimdDouble gmx_simdcall | gmx::iprod (SimdDouble ax, SimdDouble ay, SimdDouble az, SimdDouble bx, SimdDouble by, SimdDouble bz) |
SIMD double inner product of multiple double vectors. More... | |
static SimdDouble gmx_simdcall | gmx::norm2 (SimdDouble ax, SimdDouble ay, SimdDouble az) |
SIMD double norm squared of multiple vectors. More... | |
static void gmx_simdcall | gmx::cprod (SimdDouble ax, SimdDouble ay, SimdDouble az, SimdDouble bx, SimdDouble by, SimdDouble bz, SimdDouble *cx, SimdDouble *cy, SimdDouble *cz) |
SIMD double cross-product of multiple vectors. More... | |
static Simd4Float gmx_simdcall | gmx::norm2 (Simd4Float ax, Simd4Float ay, Simd4Float az) |
SIMD4 float norm squared of multiple vectors. More... | |
static Simd4Double gmx_simdcall | gmx::norm2 (Simd4Double ax, Simd4Double ay, Simd4Double az) |
SIMD4 double norm squared of multiple vectors. More... | |
::testing::AssertionResult | gmx::test::SimdBaseTest::compareVectorRealUlp (const char *refExpr, const char *tstExpr, const std::vector< real > &ref, const std::vector< real > &tst) const |
Compare two std::vector<real> for approximate equality. More... | |
::testing::AssertionResult | gmx::test::SimdTest::compareSimdRealUlp (const char *refExpr, const char *tstExpr, SimdReal ref, SimdReal tst) |
Compare two real SIMD variables for approximate equality. More... | |
::testing::AssertionResult | gmx::test::SimdTest::compareSimdEq (const char *refExpr, const char *tstExpr, SimdReal ref, SimdReal tst) |
Compare two real SIMD variables for exact equality. More... | |
::testing::AssertionResult | gmx::test::SimdTest::compareSimdEq (const char *refExpr, const char *tstExpr, SimdInt32 ref, SimdInt32 tst) |
Compare two 32-bit integer SIMD variables. More... | |
::testing::AssertionResult | gmx::test::Simd4Test::compareSimd4RealUlp (const char *refExpr, const char *tstExpr, Simd4Real ref, Simd4Real tst) |
Compare two real SIMD4 variables for approximate equality. More... | |
::testing::AssertionResult | gmx::test::Simd4Test::compareSimd4RealEq (const char *refExpr, const char *tstExpr, Simd4Real ref, Simd4Real tst) |
Compare two real SIMD4 variables for exact equality. More... | |
static std::vector< real > | gmx::test::SimdMathTest::generateTestPoints (Range range, std::size_t points) |
Generate test point vector. More... | |
::testing::AssertionResult | gmx::test::SimdMathTest::compareSimdMathFunction (const char *refFuncExpr, const char *simdFuncExpr, const char *compareSettingsExpr, real refFunc(real x), SimdReal gmx_simdcall simdFunc(SimdReal x), const CompareSettings &compareSettings) |
Implementation routine to compare SIMD vs reference functions. More... | |
static void | gmx::test::SimdMathTest::generateTestPointsTest () |
Test routine for the test point vector generation. | |
Variables | |
constexpr real | gmx::test::czero = 0.0 |
zero | |
constexpr real | gmx::test::c0 = 0.3333333333333333 |
test constant 0.0 + 1.0/3.0 | |
constexpr real | gmx::test::c1 = 1.7142857142857144 |
test constant 1.0 + 5.0/7.0 | |
constexpr real | gmx::test::c2 = 2.6923076923076925 |
test constant 2.0 + 9.0/13.0 | |
constexpr real | gmx::test::c3 = 3.8947368421052633 |
test constant 3.0 + 17.0/19.0 | |
constexpr real | gmx::test::c4 = 4.793103448275862 |
test constant 4.0 + 23.0/29.0 | |
constexpr real | gmx::test::c5 = 5.837837837837838 |
test constant 5.0 + 31.0/37.0 | |
constexpr real | gmx::test::c6 = 6.953488372093023 |
test constant 6.0 + 41.0/43.0 | |
constexpr real | gmx::test::c7 = 7.886792452830189 |
test constant 7.0 + 47.0/53.0 | |
constexpr real | gmx::test::c8 = 8.967213114754099 |
test constant 8.0 + 59.0/61.0 | |
const SimdReal | gmx::test::rSimd_c0c1c2 = setSimdRealFrom3R(c0, c1, c2) |
c0,c1,c2 repeated | |
const SimdReal | gmx::test::rSimd_c3c4c5 = setSimdRealFrom3R(c3, c4, c5) |
c3,c4,c5 repeated | |
const SimdReal | gmx::test::rSimd_c6c7c8 = setSimdRealFrom3R(c6, c7, c8) |
c6,c7,c8 repeated | |
const SimdReal | gmx::test::rSimd_c3c0c4 = setSimdRealFrom3R(c3, c0, c4) |
c3,c0,c4 repeated | |
const SimdReal | gmx::test::rSimd_c4c6c8 = setSimdRealFrom3R(c4, c6, c8) |
c4,c6,c8 repeated | |
const SimdReal | gmx::test::rSimd_c7c2c3 = setSimdRealFrom3R(c7, c2, c3) |
c7,c2,c3 repeated | |
const SimdReal | gmx::test::rSimd_m0m1m2 = setSimdRealFrom3R(-c0, -c1, -c2) |
-c0,-c1,-c2 repeated | |
const SimdReal | gmx::test::rSimd_m3m0m4 = setSimdRealFrom3R(-c3, -c0, -c4) |
-c3,-c0,-c4 repeated | |
const SimdReal | gmx::test::rSimd_2p25 = setSimdRealFrom1R(2.25) |
Value that rounds down. | |
const SimdReal | gmx::test::rSimd_3p25 = setSimdRealFrom1R(3.25) |
Value that rounds down. | |
const SimdReal | gmx::test::rSimd_3p75 = setSimdRealFrom1R(3.75) |
Value that rounds up. | |
const SimdReal | gmx::test::rSimd_m2p25 = setSimdRealFrom1R(-2.25) |
Negative value that rounds up. | |
const SimdReal | gmx::test::rSimd_m3p25 = setSimdRealFrom1R(-3.25) |
Negative value that rounds up. | |
const SimdReal | gmx::test::rSimd_m3p75 = setSimdRealFrom1R(-3.75) |
Negative value that rounds down. More... | |
const SimdReal | gmx::test::rSimd_Exp |
Three large floating-point values whose exponents are >32. More... | |
const SimdReal | gmx::test::rSimd_logicalA = setSimdRealFrom1R(1.3333282470703125) |
Bit pattern to test logical ops. | |
const SimdReal | gmx::test::rSimd_logicalB = setSimdRealFrom1R(1.79998779296875) |
Bit pattern to test logical ops. | |
const SimdReal | gmx::test::rSimd_logicalResultAnd = setSimdRealFrom1R(1.26666259765625) |
Result or bitwise 'and' of A and B. | |
const SimdReal | gmx::test::rSimd_logicalResultOr = setSimdRealFrom1R(1.8666534423828125) |
Result or bitwise 'or' of A and B. | |
const SimdInt32 | gmx::test::iSimd_1_2_3 = setSimdIntFrom3I(1, 2, 3) |
Three generic ints. | |
const SimdInt32 | gmx::test::iSimd_4_5_6 = setSimdIntFrom3I(4, 5, 6) |
Three generic ints. | |
const SimdInt32 | gmx::test::iSimd_7_8_9 = setSimdIntFrom3I(7, 8, 9) |
Three generic ints. | |
const SimdInt32 | gmx::test::iSimd_5_7_9 = setSimdIntFrom3I(5, 7, 9) |
iSimd_1_2_3 + iSimd_4_5_6. | |
const SimdInt32 | gmx::test::iSimd_1M_2M_3M = setSimdIntFrom3I(1000000, 2000000, 3000000) |
Term1 for 32bit add/sub. | |
const SimdInt32 | gmx::test::iSimd_4M_5M_6M = setSimdIntFrom3I(4000000, 5000000, 6000000) |
Term2 for 32bit add/sub. | |
const SimdInt32 | gmx::test::iSimd_5M_7M_9M = setSimdIntFrom3I(5000000, 7000000, 9000000) |
iSimd_1M_2M_3M + iSimd_4M_5M_6M. | |
const SimdInt32 | gmx::test::iSimd_0xF0F0F0F0 = setSimdIntFrom1I(0xF0F0F0F0) |
Bitpattern to test integer logical operations. | |
const SimdInt32 | gmx::test::iSimd_0xCCCCCCCC = setSimdIntFrom1I(0xCCCCCCCC) |
Bitpattern to test integer logical operations. | |
const SimdReal | gmx::test::rSimd_Bits1 |
Pattern F0 repeated to fill single/double. | |
const SimdReal | gmx::test::rSimd_Bits2 |
Pattern CC repeated to fill single/double. | |
const SimdReal | gmx::test::rSimd_Bits3 |
Pattern C0 repeated to fill single/double. | |
const SimdReal | gmx::test::rSimd_Bits4 |
Pattern 0C repeated to fill single/double. | |
const SimdReal | gmx::test::rSimd_Bits5 |
Pattern FC repeated to fill single/double. | |
const SimdReal | gmx::test::rSimd_Bits6 |
Pattern 3C repeated to fill single/double. | |
const Simd4Real | gmx::test::rSimd4_c0c1c2 = setSimd4RealFrom3R(c0, c1, c2) |
c0,c1,c2 repeated | |
const Simd4Real | gmx::test::rSimd4_c3c4c5 = setSimd4RealFrom3R(c3, c4, c5) |
c3,c4,c5 repeated | |
const Simd4Real | gmx::test::rSimd4_c6c7c8 = setSimd4RealFrom3R(c6, c7, c8) |
c6,c7,c8 repeated | |
const Simd4Real | gmx::test::rSimd4_c3c0c4 = setSimd4RealFrom3R(c3, c0, c4) |
c3,c0,c4 repeated | |
const Simd4Real | gmx::test::rSimd4_c4c6c8 = setSimd4RealFrom3R(c4, c6, c8) |
c4,c6,c8 repeated | |
const Simd4Real | gmx::test::rSimd4_c7c2c3 = setSimd4RealFrom3R(c7, c2, c3) |
c7,c2,c3 repeated | |
const Simd4Real | gmx::test::rSimd4_m0m1m2 = setSimd4RealFrom3R(-c0, -c1, -c2) |
-c0,-c1,-c2 repeated | |
const Simd4Real | gmx::test::rSimd4_m3m0m4 = setSimd4RealFrom3R(-c3, -c0, -c4) |
-c3,-c0,-c4 repeated | |
const Simd4Real | gmx::test::rSimd4_2p25 = setSimd4RealFrom1R(2.25) |
Value that rounds down. | |
const Simd4Real | gmx::test::rSimd4_3p75 = setSimd4RealFrom1R(3.75) |
Value that rounds up. | |
const Simd4Real | gmx::test::rSimd4_m2p25 = setSimd4RealFrom1R(-2.25) |
Negative value that rounds up. | |
const Simd4Real | gmx::test::rSimd4_m3p75 = setSimd4RealFrom1R(-3.75) |
Negative value that rounds down. More... | |
const Simd4Real | gmx::test::rSimd4_logicalA = setSimd4RealFrom1R(1.3333282470703125) |
Bit pattern to test logical ops. | |
const Simd4Real | gmx::test::rSimd4_logicalB = setSimd4RealFrom1R(1.79998779296875) |
Bit pattern to test logical ops. | |
const Simd4Real | gmx::test::rSimd4_logicalResultAnd = setSimd4RealFrom1R(1.26666259765625) |
Result or bitwise 'and' of A and B. | |
const Simd4Real | gmx::test::rSimd4_logicalResultOr = setSimd4RealFrom1R(1.8666534423828125) |
Result or bitwise 'or' of A and B. | |
const Simd4Real | gmx::test::rSimd4_Exp |
Three large floating-point values whose exponents are >32. | |
const Simd4Real | gmx::test::rSimd4_Bits1 |
Pattern F0 repeated to fill single/double. | |
const Simd4Real | gmx::test::rSimd4_Bits2 |
Pattern CC repeated to fill single/double. | |
const Simd4Real | gmx::test::rSimd4_Bits3 |
Pattern C0 repeated to fill single/double. | |
const Simd4Real | gmx::test::rSimd4_Bits4 |
Pattern 0C repeated to fill single/double. | |
const Simd4Real | gmx::test::rSimd4_Bits5 |
Pattern FC repeated to fill single/double. | |
const Simd4Real | gmx::test::rSimd4_Bits6 |
Pattern 3C repeated to fill single/double. | |
static int | gmx::test::SimdBaseTest::s_nPoints = 10000 |
Number of test points to use, settable on command line. More... | |
Directories | |
directory | simd |
SIMD intrinsics interface (simd) | |
directory | tests |
Unit tests for SIMD intrinsics interface (simd). | |
Files | |
file | impl_reference.h |
Reference SIMD implementation, including SIMD documentation. | |
file | impl_reference_definitions.h |
Reference SIMD implementation, including SIMD documentation. | |
file | impl_reference_general.h |
Reference SIMD implementation, general utility functions. | |
file | impl_reference_simd4_double.h |
Reference implementation, SIMD4 single precision. | |
file | impl_reference_simd4_float.h |
Reference implementation, SIMD4 single precision. | |
file | impl_reference_simd_double.h |
Reference implementation, SIMD double precision. | |
file | impl_reference_simd_float.h |
Reference implementation, SIMD single precision. | |
file | impl_reference_util_double.h |
Reference impl., higher-level double prec. SIMD utility functions. | |
file | impl_reference_util_float.h |
Reference impl., higher-level single prec. SIMD utility functions. | |
file | scalar.h |
Scalar float functions corresponding to GROMACS SIMD functions. | |
file | scalar_math.h |
Scalar math functions mimicking GROMACS SIMD math functions. | |
file | scalar_util.h |
Scalar utility functions mimicking GROMACS SIMD utility functions. | |
file | simd.h |
Definitions, capabilities, and wrappers for SIMD module. | |
file | simd_math.h |
Math functions for SIMD datatypes. | |
file | simd_memory.h |
Declares SimdArrayRef. | |
file | support.cpp |
Implements SIMD architecture support query routines. | |
file | support.h |
Functions to query compiled and supported SIMD architectures. | |
file | base.h |
Declares common base class for testing SIMD and SIMD4. | |
file | bootstrap_loadstore.cpp |
Separate test of SIMD load/store, before we use them in the SIMD test classes. | |
file | data.h |
Common test data constants for SIMD, SIMD4 and scalar tests. | |
file | simd.h |
Declares fixture for testing of normal SIMD (not SIMD4) functionality. | |
file | simd4.h |
Declares fixture for testing of SIMD4 functionality. | |
file | simd_memory.cpp |
Tests for gmx::ArrayRef for SIMD types. | |
file | vector_operations.h |
SIMD operations corresponding to Gromacs rvec datatypes. | |
#define GMX_EXPECT_SIMD_FUNC_NEAR | ( | refFunc, | |
tstFunc, | |||
compareSettings | |||
) | EXPECT_PRED_FORMAT3(compareSimdMathFunction, refFunc, tstFunc, compareSettings) |
Test approximate equality of SIMD vs reference version of a function.
This macro takes vanilla C and SIMD flavors of a function and tests it with the number of points, range, and tolerances specified by the test fixture class.
The third option controls the range, tolerances, and match settings.
#define GMX_EXPECT_SIMD_INT_EQ | ( | ref, | |
tst | |||
) | EXPECT_PRED_FORMAT2(compareSimdEq, ref, tst) |
Macro that checks SIMD integer expression against SIMD or reference int.
If the reference argument is a scalar integer it will be expanded into the width of the SIMD register and tested against all elements.
#define GMX_SIMD4_HAVE_REAL GMX_SIMD4_HAVE_FLOAT |
1 if Simd4Real is available, otherwise 0.
GMX_SIMD4_HAVE_DOUBLE if GMX_DOUBLE is 1, otherwise GMX_SIMD4_HAVE_FLOAT.
#define GMX_SIMD_HAVE_GATHER_LOADU_BYSIMDINT_TRANSPOSE_REAL GMX_SIMD_HAVE_GATHER_LOADU_BYSIMDINT_TRANSPOSE_FLOAT |
1 if gmx::simdGatherLoadUBySimdIntTranspose is present, otherwise 0
GMX_SIMD_HAVE_GATHER_LOADU_BYSIMDINT_TRANSPOSE_DOUBLE if GMX_DOUBLE is 1, otherwise GMX_SIMD_HAVE_GATHER_LOADU_BYSIMDINT_TRANSPOSE_FLOAT.
#define GMX_SIMD_HAVE_HSIMD_UTIL_REAL GMX_SIMD_HAVE_HSIMD_UTIL_FLOAT |
1 if real half-register load/store/reduce utils present, otherwise 0
GMX_SIMD_HAVE_HSIMD_UTIL_DOUBLE if GMX_DOUBLE is 1, otherwise GMX_SIMD_HAVE_HSIMD_UTIL_FLOAT.
#define GMX_SIMD_HAVE_INT32_ARITHMETICS GMX_SIMD_HAVE_FINT32_ARITHMETICS |
1 if arithmetic ops are supported on SimdInt32, otherwise 0.
GMX_SIMD_HAVE_DINT32_ARITHMETICS if GMX_DOUBLE is 1, otherwise GMX_SIMD_HAVE_FINT32_ARITHMETICS.
#define GMX_SIMD_HAVE_INT32_EXTRACT GMX_SIMD_HAVE_FINT32_EXTRACT |
1 if support is available for extracting elements from SimdInt32, otherwise 0
GMX_SIMD_HAVE_DINT32_EXTRACT if GMX_DOUBLE is 1, otherwise GMX_SIMD_HAVE_FINT32_EXTRACT.
#define GMX_SIMD_HAVE_INT32_LOGICAL GMX_SIMD_HAVE_FINT32_LOGICAL |
1 if logical ops are supported on SimdInt32, otherwise 0.
GMX_SIMD_HAVE_DINT32_LOGICAL if GMX_DOUBLE is 1, otherwise GMX_SIMD_HAVE_FINT32_LOGICAL.
#define GMX_SIMD_HAVE_REAL GMX_SIMD_HAVE_FLOAT |
1 if SimdReal is available, otherwise 0.
GMX_SIMD_HAVE_DOUBLE if GMX_DOUBLE is 1, otherwise GMX_SIMD_HAVE_FLOAT.
#define GMX_SIMD_REAL_WIDTH GMX_SIMD_FLOAT_WIDTH |
Width of SimdReal.
GMX_SIMD_DOUBLE_WIDTH if GMX_DOUBLE is 1, otherwise GMX_SIMD_FLOAT_WIDTH.
typedef SimdTest gmx::test::anonymous_namespace{simd_vector_operations.cpp}::SimdVectorOperationsTest |
Test fixture for vector operations tests (identical to the generic SimdTest)
|
inlinestatic |
SIMD4 Floating-point fabs().
a | any floating point values |
|
inlinestatic |
|
inlinestatic |
SIMD float Floating-point abs().
a | any floating point values |
|
inlinestatic |
SIMD double floating-point fabs().
a | any floating point values |
|
inlinestatic |
SIMD float acos(x).
x | The argument to evaluate acos for |
|
inlinestatic |
SIMD double acos(x).
x | The argument to evaluate acos for |
|
inlinestatic |
SIMD acos(x). Double precision SIMD data, single accuracy.
x | The argument to evaluate acos for |
|
inlinestatic |
SIMD float acos(x), only targeting single accuracy.
x | The argument to evaluate acos for |
|
inlinestatic |
Bitwise andnot for two SIMD4 double variables. c=(~a) & b.
Available if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Bitwise andnot for two SIMD4 float variables. c=(~a) & b.
Available if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Bitwise andnot for SIMD float.
Available if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Bitwise andnot for SIMD double.
Available if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Integer SIMD bitwise not/complement.
Available if GMX_SIMD_HAVE_FINT32_LOGICAL is 1.
a | integer SIMD |
b | integer SIMD |
|
inlinestatic |
Integer SIMD bitwise not/complement.
Available if GMX_SIMD_HAVE_DINT32_LOGICAL is 1.
a | integer SIMD |
b | integer SIMD |
|
inlinestatic |
Returns non-zero if any of the boolean in SIMD4 a is True, otherwise 0.
a | Logical variable. |
The actual return value for truth will depend on the architecture, so any non-zero value is considered truth.
|
inlinestatic |
Returns non-zero if any of the boolean in SIMD4 a is True, otherwise 0.
a | Logical variable. |
The actual return value for truth will depend on the architecture, so any non-zero value is considered truth.
|
inlinestatic |
Returns non-zero if any of the boolean in SIMD a is True, otherwise 0.
a | Logical variable. |
The actual return value for truth will depend on the architecture, so any non-zero value is considered truth.
|
inlinestatic |
Returns non-zero if any of the boolean in SIMD a is True, otherwise 0.
a | Logical variable. |
The actual return value for truth will depend on the architecture, so any non-zero value is considered truth.
|
inlinestatic |
Returns true if any of the boolean in x is True, otherwise 0.
Available if GMX_SIMD_HAVE_FINT32_ARITHMETICS is 1.
The actual return value for "any true" will depend on the architecture. Any non-zero value should be considered truth.
a | SIMD boolean |
|
inlinestatic |
Returns true if any of the boolean in x is True, otherwise 0.
Available if GMX_SIMD_HAVE_DINT32_ARITHMETICS is 1.
The actual return value for "any true" will depend on the architecture. Any non-zero value should be considered truth.
a | SIMD boolean |
|
inlinestatic |
SIMD float asin(x).
x | The argument to evaluate asin for |
|
inlinestatic |
SIMD double asin(x).
x | The argument to evaluate asin for |
|
inlinestatic |
SIMD asin(x). Double precision SIMD data, single accuracy.
x | The argument to evaluate asin for |
|
inlinestatic |
SIMD float asin(x), only targeting single accuracy.
x | The argument to evaluate asin for |
|
inlinestatic |
SIMD float asin(x).
x | The argument to evaluate atan for |
|
inlinestatic |
SIMD double asin(x).
x | The argument to evaluate atan for |
|
inlinestatic |
SIMD float atan2(y,x).
y | Y component of vector, any quartile |
x | X component of vector, any quartile |
|
inlinestatic |
SIMD double atan2(y,x).
y | Y component of vector, any quartile |
x | X component of vector, any quartile |
|
inlinestatic |
SIMD atan2(y,x). Double precision SIMD data, single accuracy.
y | Y component of vector, any quartile |
x | X component of vector, any quartile |
|
inlinestatic |
SIMD float atan2(y,x), only targeting single accuracy.
y | Y component of vector, any quartile |
x | X component of vector, any quartile |
|
inlinestatic |
SIMD asin(x). Double precision SIMD data, single accuracy.
x | The argument to evaluate atan for |
|
inlinestatic |
SIMD float atan(x), only targeting single accuracy.
x | The argument to evaluate atan for |
|
inlinestatic |
Vector-blend SIMD4 selection.
a | First source |
b | Second source |
sel | Boolean selector |
|
inlinestatic |
Vector-blend SIMD4 selection.
a | First source |
b | Second source |
sel | Boolean selector |
|
inlinestatic |
Vector-blend SIMD float selection.
a | First source |
b | Second source |
sel | Boolean selector |
|
inlinestatic |
Vector-blend SIMD double selection.
a | First source |
b | Second source |
sel | Boolean selector |
|
inlinestatic |
Vector-blend SIMD integer selection.
Available if GMX_SIMD_HAVE_FINT32_ARITHMETICS is 1.
a | First source |
b | Second source |
sel | Boolean selector |
|
inlinestatic |
Vector-blend SIMD integer selection.
Available if GMX_SIMD_HAVE_DINT32_ARITHMETICS is 1.
a | First source |
b | Second source |
sel | Boolean selector |
|
inlinestatic |
Cube root for SIMD floats.
x | Argument to calculate cube root of. Can be negative or zero, but NaN or Inf values are not supported. Denormal values will be treated as 0.0. |
|
inlinestatic |
Cube root for SIMD doubles.
x | Argument to calculate cube root of. Can be negative or zero, but NaN or Inf values are not supported. Denormal values will be treated as 0.0. |
|
inlinestatic |
Cube root for SIMD doubles, single accuracy.
x | Argument to calculate cube root of. Can be negative or zero, but NaN or Inf values are not supported. Denormal values will be treated as 0.0. |
|
inlinestatic |
Calculate cbrt(x) for SIMD float, always targeting single accuracy.
x | Argument to calculate cube root of. Can be negative or zero, but NaN or Inf values are not supported. Denormal values will be treated as 0.0. |
testing::AssertionResult gmx::test::Simd4Test::compareSimd4RealEq | ( | const char * | refExpr, |
const char * | tstExpr, | ||
Simd4Real | ref, | ||
Simd4Real | tst | ||
) |
Compare two real SIMD4 variables for exact equality.
This is an internal implementation routine. YOu should always use GMX_EXPECT_SIMD4_REAL_NEAR() instead.
This routine is designed according to the Google test specs, so the char strings will describe the arguments to the macro.
The comparison is applied to each element, and it returns true if each element in the SIMD4 test variable is within the class tolerances of the corresponding reference element.
testing::AssertionResult gmx::test::Simd4Test::compareSimd4RealUlp | ( | const char * | refExpr, |
const char * | tstExpr, | ||
Simd4Real | ref, | ||
Simd4Real | tst | ||
) |
Compare two real SIMD4 variables for approximate equality.
This is an internal implementation routine. YOu should always use GMX_EXPECT_SIMD4_REAL_NEAR() instead.
This routine is designed according to the Google test specs, so the char strings will describe the arguments to the macro.
The comparison is applied to each element, and it returns true if each element in the SIMD4 test variable is within the class tolerances of the corresponding reference element.
testing::AssertionResult gmx::test::SimdTest::compareSimdEq | ( | const char * | refExpr, |
const char * | tstExpr, | ||
SimdReal | ref, | ||
SimdReal | tst | ||
) |
Compare two real SIMD variables for exact equality.
This is an internal implementation routine. YOu should always use GMX_EXPECT_SIMD_REAL_NEAR() instead.
This routine is designed according to the Google test specs, so the char strings will describe the arguments to the macro.
The comparison is applied to each element, and it returns true if each element in the SIMD test variable is within the class tolerances of the corresponding reference element.
testing::AssertionResult gmx::test::SimdTest::compareSimdEq | ( | const char * | refExpr, |
const char * | tstExpr, | ||
SimdInt32 | ref, | ||
SimdInt32 | tst | ||
) |
Compare two 32-bit integer SIMD variables.
This is an internal implementation routine. YOu should always use GMX_EXPECT_SIMD_INT_EQ() instead.
This routine is designed according to the Google test specs, so the char strings will describe the arguments to the macro, while the SIMD and tolerance arguments are used to decide if the values are approximately equal.
The comparison is applied to each element, and it returns true if each element in the SIMD variable tst is identical to the corresponding reference element.
testing::AssertionResult gmx::test::SimdMathTest::compareSimdMathFunction | ( | const char * | refFuncExpr, |
const char * | simdFuncExpr, | ||
const char * | compareSettingsExpr, | ||
real | refFuncreal x, | ||
SimdReal gmx_simdcall | simdFuncSimdReal x, | ||
const CompareSettings & | compareSettings | ||
) |
Implementation routine to compare SIMD vs reference functions.
refFuncExpr | Description of reference function expression |
simdFuncExpr | Description of SIMD function expression |
compareSettingsExpr | Description of compareSettings |
refFunc | Reference math function pointer |
simdFunc | SIMD math function pointer |
compareSettings | Structure with the range, tolerances, and matching rules to use for the comparison. |
testing::AssertionResult gmx::test::SimdTest::compareSimdRealUlp | ( | const char * | refExpr, |
const char * | tstExpr, | ||
SimdReal | ref, | ||
SimdReal | tst | ||
) |
Compare two real SIMD variables for approximate equality.
This is an internal implementation routine. YOu should always use GMX_EXPECT_SIMD_REAL_NEAR() instead.
This routine is designed according to the Google test specs, so the char strings will describe the arguments to the macro.
The comparison is applied to each element, and it returns true if each element in the SIMD test variable is within the class tolerances of the corresponding reference element.
testing::AssertionResult gmx::test::SimdBaseTest::compareVectorRealUlp | ( | const char * | refExpr, |
const char * | tstExpr, | ||
const std::vector< real > & | ref, | ||
const std::vector< real > & | tst | ||
) | const |
Compare two std::vector<real> for approximate equality.
This is an internal implementation routine that will be used by routines in derived child classes that first convert SIMD or SIMD4 variables to std::vector<real>. Do not call it directly.
This routine is designed according to the Google test specs, so the char strings will describe the arguments to the macro.
The comparison is applied to each element, and it returns true if each element in the vector test variable is within the class tolerances of the corresponding reference elements.
|
inlinestatic |
Composes floating point value with the magnitude of x and the sign of y.
x | Values to set sign for |
y | Values used to set sign |
|
inlinestatic |
Composes floating point value with the magnitude of x and the sign of y.
x | Values to set sign for |
y | Values used to set sign |
|
inlinestatic |
SIMD float cos(x).
x | The argument to evaluate cos for |
|
inlinestatic |
SIMD double cos(x).
x | The argument to evaluate cos for |
|
inlinestatic |
SIMD cos(x). Double precision SIMD data, single accuracy.
x | The argument to evaluate cos for |
|
inlinestatic |
SIMD float cos(x), only targeting single accuracy.
x | The argument to evaluate cos for |
|
inlinestatic |
SIMD float cross-product of multiple vectors.
ax | X components of first vectors | |
ay | Y components of first vectors | |
az | Z components of first vectors | |
bx | X components of second vectors | |
by | Y components of second vectors | |
bz | Z components of second vectors | |
[out] | cx | X components of cross product vectors |
[out] | cy | Y components of cross product vectors |
[out] | cz | Z components of cross product vectors |
This calculates C = A x B, where the cross denotes the cross product. The arguments x/y/z denotes the different components, and each element corresponds to a separate vector.
|
inlinestatic |
SIMD double cross-product of multiple vectors.
ax | X components of first vectors | |
ay | Y components of first vectors | |
az | Z components of first vectors | |
bx | X components of second vectors | |
by | Y components of second vectors | |
bz | Z components of second vectors | |
[out] | cx | X components of cross product vectors |
[out] | cy | Y components of cross product vectors |
[out] | cz | Z components of cross product vectors |
This calculates C = A x B, where the cross denotes the cross product. The arguments x/y/z denotes the different components, and each element corresponds to a separate vector.
|
inlinestatic |
Convert from single precision boolean to corresponding integer boolean.
a | SIMD floating-point boolean |
|
inlinestatic |
Convert from double precision boolean to corresponding integer boolean.
a | SIMD floating-point boolean |
|
inlinestatic |
Convert SIMD double to float.
This version is available if GMX_SIMD_FLOAT_WIDTH is identical to GMX_SIMD_DOUBLE_WIDTH.
Float/double conversions are complex since the SIMD width could either be different (e.g. on x86) or identical (e.g. IBM QPX). This means you will need to check for the width in the code, and have different code paths.
d | Double-precision SIMD variable |
|
inlinestatic |
Convert SIMD double to float.
This version is available if GMX_SIMD_FLOAT_WIDTH is twice as large as GMX_SIMD_DOUBLE_WIDTH.
Float/double conversions are complex since the SIMD width could either be different (e.g. on x86) or identical (e.g. IBM QPX). This means you will need to check for the width in the code, and have different code paths.
d0 | Double-precision SIMD variable, first half of values to put in f. |
d1 | Double-precision SIMD variable, second half of values to put in f. |
|
inlinestatic |
Convert SIMD float to double.
This version is available if GMX_SIMD_FLOAT_WIDTH is identical to GMX_SIMD_DOUBLE_WIDTH.
Float/double conversions are complex since the SIMD width could either be different (e.g. on x86) or identical (e.g. IBM QPX). This means you will need to check for the width in the code, and have different code paths.
f | Single-precision SIMD variable |
|
inlinestatic |
Convert SIMD float to double.
This version is available if GMX_SIMD_FLOAT_WIDTH is twice as large as GMX_SIMD_DOUBLE_WIDTH.
Float/double conversions are complex since the SIMD width could either be different (e.g. on x86) or identical (e.g. IBM QPX). This means you will need to check for the width in the code, and have different code paths.
f | Single-precision SIMD variable | |
[out] | d0 | Double-precision SIMD variable, first half of values from f. |
[out] | d1 | Double-precision SIMD variable, second half of values from f. |
|
inlinestatic |
Convert integer to single precision floating point.
a | SIMD integer |
|
inlinestatic |
Convert integer to double precision floating point.
a | SIMD integer |
|
inlinestatic |
Convert from integer boolean to corresponding single precision boolean.
a | SIMD integer boolean |
|
inlinestatic |
Convert from integer boolean to corresponding double precision boolean.
a | SIMD integer boolean |
|
inlinestatic |
Round single precision floating point to integer.
a | SIMD floating-point |
|
inlinestatic |
Round double precision floating point to integer.
a | SIMD floating-point |
|
inlinestatic |
Truncate single precision floating point to integer.
a | SIMD floating-point |
|
inlinestatic |
Truncate double precision floating point to integer.
a | SIMD floating-point |
|
inlinestatic |
Add the two halves of three SIMD doubles, subtract the sum from three half-SIMD-width consecutive doubles in memory.
m | half-width aligned memory, from which sum of the halves will be subtracted. |
a0 | SIMD variable. Upper & lower halves will first be added. |
a1 | SIMD variable. Upper & lower halves will second be added. |
a2 | SIMD variable. Upper & lower halves will third be added. |
If the SIMD width is 8 and the vectors contain [a0 b0 c0 d0 e0 f0 g0 h0], [a1 b1 c1 d1 e1 f1 g1 g1] and [a2 b2 c2 d2 e2 f2 g2 h2], the memory will be modified to [m[0]-(a0+e0) m[1]-(b0+f0) m[2]-(c0+g0) m[3]-(d0+h0) m[4]-(a1+e1) m[5]-(b1+f1) m[6]-(c1+g1) m[7]-(d1+h1) m[8]-(a2+e2) m[9]-(b2+f2) m[10]-(c2+g2) m[11]-(d2+h2)].
The memory must be aligned to half SIMD width.
Available if GMX_SIMD_HAVE_HSIMD_UTIL_DOUBLE is 1.
|
inlinestatic |
Add the two halves of three SIMD floats, subtract the sum from three half-SIMD-width consecutive floats in memory.
m | half-width aligned memory, from which sum of the halves will be subtracted. |
a0 | SIMD variable. Upper & lower halves will first be added. |
a1 | SIMD variable. Upper & lower halves will second be added. |
a2 | SIMD variable. Upper & lower halves will third be added. |
If the SIMD width is 8 and the vectors contain [a0 b0 c0 d0 e0 f0 g0 h0], [a1 b1 c1 d1 e1 f1 g1 g1] and [a2 b2 c2 d2 e2 f2 g2 h2], the memory will be modified to [m[0]-(a0+e0) m[1]-(b0+f0) m[2]-(c0+g0) m[3]-(d0+h0) m[4]-(a1+e1) m[5]-(b1+f1) m[6]-(c1+g1) m[7]-(d1+h1) m[8]-(a2+e2) m[9]-(b2+f2) m[10]-(c2+g2) m[11]-(d2+h2)].
The memory must be aligned to half SIMD width.
Available if GMX_SIMD_HAVE_HSIMD_UTIL_FLOAT is 1.
|
inlinestatic |
Return dot product of two single precision SIMD4 variables.
The dot product is calculated between the first three elements in the two vectors, while the fourth is ignored. The result is returned as a scalar.
a | vector1 |
b | vector2 |
|
inlinestatic |
Return dot product of two double precision SIMD4 variables.
The dot product is calculated between the first three elements in the two vectors, while the fourth is ignored. The result is returned as a scalar.
a | vector1 |
b | vector2 |
|
inlinestatic |
SIMD float erf(x).
x | The value to calculate erf(x) for. |
This routine achieves very close to full precision, but we do not care about the last bit or the subnormal result range.
|
inlinestatic |
SIMD double erf(x).
x | The value to calculate erf(x) for. |
This routine achieves very close to full precision, but we do not care about the last bit or the subnormal result range.
|
inlinestatic |
SIMD float erfc(x).
x | The value to calculate erfc(x) for. |
This routine achieves full precision (bar the last bit) over most of the input range, but for large arguments where the result is getting close to the minimum representable numbers we accept slightly larger errors (think results that are in the ballpark of 10^-30 for single precision) since that is not relevant for MD.
|
inlinestatic |
SIMD double erfc(x).
x | The value to calculate erfc(x) for. |
This routine achieves full precision (bar the last bit) over most of the input range, but for large arguments where the result is getting close to the minimum representable numbers we accept slightly larger errors (think results that are in the ballpark of 10^-200 for double) since that is not relevant for MD.
|
inlinestatic |
SIMD erfc(x). Double precision SIMD data, single accuracy.
x | The value to calculate erfc(x) for. |
This routine achieves singleprecision (bar the last bit) over most of the input range, but for large arguments where the result is getting close to the minimum representable numbers we accept slightly larger errors (think results that are in the ballpark of 10^-30) since that is not relevant for MD.
|
inlinestatic |
SIMD float erfc(x), only targeting single accuracy.
x | The value to calculate erfc(x) for. |
This routine achieves singleprecision (bar the last bit) over most of the input range, but for large arguments where the result is getting close to the minimum representable numbers we accept slightly larger errors (think results that are in the ballpark of 10^-30) since that is not relevant for MD.
|
inlinestatic |
SIMD erf(x). Double precision SIMD data, single accuracy.
x | The value to calculate erf(x) for. |
This routine achieves very close to single precision, but we do not care about the last bit or the subnormal result range.
|
inlinestatic |
SIMD float erf(x), only targeting single accuracy.
x | The value to calculate erf(x) for. |
This routine achieves very close to single precision, but we do not care about the last bit or the subnormal result range.
|
inlinestatic |
SIMD float exp(x).
In addition to scaling the argument for 2^x this routine correctly does extended precision arithmetics to improve accuracy.
opt | If this is changed from the default (safe) into the unsafe option, input values that would otherwise lead to zero-clamped results are not allowed and will lead to undefined results. |
x | Argument. For the default (safe) function version this can be arbitrarily small value, but the routine might clamp the result to zero for arguments that would produce subnormal IEEE754-2008 results. This corresponds to input arguments reaching -126*ln(2)=-87.3 in single, or -1022*ln(2)=-708.4 (double). Similarly, it might overflow for arguments reaching 127*ln(2)=88.0 (single) or 1023*ln(2)=709.1 (double). If the unsafe math optimizations are enabled, small input values that would result in zero-clamped output are not allowed. |
|
inlinestatic |
SIMD double exp(x).
In addition to scaling the argument for 2^x this routine correctly does extended precision arithmetics to improve accuracy.
opt | If this is changed from the default (safe) into the unsafe option, input values that would otherwise lead to zero-clamped results are not allowed and will lead to undefined results. |
x | Argument. For the default (safe) function version this can be arbitrarily small value, but the routine might clamp the result to zero for arguments that would produce subnormal IEEE754-2008 results. This corresponds to input arguments reaching -126*ln(2)=-87.3 in single, or -1022*ln(2)=-708.4 (double). Similarly, it might overflow for arguments reaching 127*ln(2)=88.0 (single) or 1023*ln(2)=709.1 (double). If the unsafe math optimizations are enabled, small input values that would result in zero-clamped output are not allowed. |
|
inlinestatic |
SIMD float 2^x.
opt | If this is changed from the default (safe) into the unsafe option, input values that would otherwise lead to zero-clamped results are not allowed and will lead to undefined results. |
x | Argument. For the default (safe) function version this can be arbitrarily small value, but the routine might clamp the result to zero for arguments that would produce subnormal IEEE754-2008 results. This corresponds to inputs below -126 in single or -1022 in double, and it might overflow for arguments reaching 127 (single) or 1023 (double). If you enable the unsafe math optimization, very small arguments will not necessarily be zero-clamped, but can produce undefined results. |
|
inlinestatic |
SIMD double 2^x.
opt | If this is changed from the default (safe) into the unsafe option, input values that would otherwise lead to zero-clamped results are not allowed and will lead to undefined results. |
x | Argument. For the default (safe) function version this can be arbitrarily small value, but the routine might clamp the result to zero for arguments that would produce subnormal IEEE754-2008 results. This corresponds to inputs below -126 in single or -1022 in double, and it might overflow for arguments reaching 127 (single) or 1023 (double). If you enable the unsafe math optimization, very small arguments will not necessarily be zero-clamped, but can produce undefined results. |
|
inlinestatic |
SIMD 2^x. Double precision SIMD, single accuracy.
opt | If this is changed from the default (safe) into the unsafe option, input values that would otherwise lead to zero-clamped results are not allowed and will lead to undefined results. |
x | Argument. For the default (safe) function version this can be arbitrarily small value, but the routine might clamp the result to zero for arguments that would produce subnormal IEEE754-2008 results. This corresponds to inputs below -126 in single or -1022 in double, and it might overflow for arguments reaching 127 (single) or 1023 (double). If you enable the unsafe math optimization, very small arguments will not necessarily be zero-clamped, but can produce undefined results. |
|
inlinestatic |
SIMD float 2^x, only targeting single accuracy.
opt | If this is changed from the default (safe) into the unsafe option, input values that would otherwise lead to zero-clamped results are not allowed and will lead to undefined results. |
x | Argument. For the default (safe) function version this can be arbitrarily small value, but the routine might clamp the result to zero for arguments that would produce subnormal IEEE754-2008 results. This corresponds to inputs below -126 in single or -1022 in double, and it might overflow for arguments reaching 127 (single) or 1023 (double). If you enable the unsafe math optimization, very small arguments will not necessarily be zero-clamped, but can produce undefined results. |
|
inlinestatic |
Expand each element of double SIMD variable into three identical consecutive elements in three SIMD outputs.
scalar | Floating-point input, e.g. [s0 s1 s2 s3] if width=4. | |
[out] | triplets0 | First output, e.g. [s0 s0 s0 s1] if width=4. |
[out] | triplets1 | Second output, e.g. [s1 s1 s2 s2] if width=4. |
[out] | triplets2 | Third output, e.g. [s2 s3 s3 s3] if width=4. |
This routine is meant to use for things like scalar-vector multiplication, where the vectors are stored in a merged format like [x0 y0 z0 x1 y1 z1 ...], while the scalars are stored as [s0 s1 s2...], and the data cannot easily be changed to SIMD-friendly layout.
In this case, load 3 full-width SIMD variables from the vector array (This will always correspond to GMX_SIMD_DOUBLE_WIDTH triplets), load a single full-width variable from the scalar array, and call this routine to expand the data. You can then simply multiply the first, second and third pair of SIMD variables, and store the three results back into a suitable vector-format array.
|
inlinestatic |
Expand each element of float SIMD variable into three identical consecutive elements in three SIMD outputs.
scalar | Floating-point input, e.g. [s0 s1 s2 s3] if width=4. | |
[out] | triplets0 | First output, e.g. [s0 s0 s0 s1] if width=4. |
[out] | triplets1 | Second output, e.g. [s1 s1 s2 s2] if width=4. |
[out] | triplets2 | Third output, e.g. [s2 s3 s3 s3] if width=4. |
This routine is meant to use for things like scalar-vector multiplication, where the vectors are stored in a merged format like [x0 y0 z0 x1 y1 z1 ...], while the scalars are stored as [s0 s1 s2...], and the data cannot easily be changed to SIMD-friendly layout.
In this case, load 3 full-width SIMD variables from the vector array (This will always correspond to GMX_SIMD_FLOAT_WIDTH triplets), load a single full-width variable from the scalar array, and call this routine to expand the data. You can then simply multiply the first, second and third pair of SIMD variables, and store the three results back into a suitable vector-format array.
|
inlinestatic |
SIMD exp(x). Double precision SIMD, single accuracy.
In addition to scaling the argument for 2^x this routine correctly does extended precision arithmetics to improve accuracy.
opt | If this is changed from the default (safe) into the unsafe option, input values that would otherwise lead to zero-clamped results are not allowed and will lead to undefined results. |
x | Argument. For the default (safe) function version this can be arbitrarily small value, but the routine might clamp the result to zero for arguments that would produce subnormal IEEE754-2008 results. This corresponds to input arguments reaching -126*ln(2)=-87.3 in single, or -1022*ln(2)=-708.4 (double). Similarly, it might overflow for arguments reaching 127*ln(2)=88.0 (single) or 1023*ln(2)=709.1 (double). If the unsafe math optimizations are enabled, small input values that would result in zero-clamped output are not allowed. |
|
inlinestatic |
SIMD float e^x, only targeting single accuracy.
In addition to scaling the argument for 2^x this routine correctly does extended precision arithmetics to improve accuracy.
opt | If this is changed from the default (safe) into the unsafe option, input values that would otherwise lead to zero-clamped results are not allowed and will lead to undefined results. |
x | Argument. For the default (safe) function version this can be arbitrarily small value, but the routine might clamp the result to zero for arguments that would produce subnormal IEEE754-2008 results. This corresponds to input arguments reaching -126*ln(2)=-87.3 in single, or -1022*ln(2)=-708.4 (double). Similarly, it might overflow for arguments reaching 127*ln(2)=88.0 (single) or 1023*ln(2)=709.1 (double). If the unsafe math optimizations are enabled, small input values that would result in zero-clamped output are not allowed. |
|
inlinestatic |
Extract element with index i from gmx::SimdFInt32.
Available if GMX_SIMD_HAVE_FINT32_EXTRACT is 1.
index | Compile-time constant, position to extract (first position is 0) |
a | SIMD variable from which to extract value. |
|
inlinestatic |
Extract element with index i from gmx::SimdDInt32.
Available if GMX_SIMD_HAVE_DINT32_EXTRACT is 1.
index | Compile-time constant, position to extract (first position is 0) |
a | SIMD variable from which to extract value. |
|
inlinestatic |
SIMD4 Fused-multiply-add. Result is a*b+c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
SIMD4 Fused-multiply-add. Result is a*b+c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
SIMD float Fused-multiply-add. Result is a*b+c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
SIMD double Fused-multiply-add. Result is a*b+c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
SIMD4 Fused-multiply-subtract. Result is a*b-c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
SIMD4 Fused-multiply-subtract. Result is a*b-c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
SIMD float Fused-multiply-subtract. Result is a*b-c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
SIMD double Fused-multiply-subtract. Result is a*b-c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
SIMD4 Fused-negated-multiply-add. Result is -a*b+c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
SIMD4 Fused-negated-multiply-add. Result is -a*b+c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
SIMD float Fused-negated-multiply-add. Result is -a*b+c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
SIMD double Fused-negated-multiply-add. Result is -a*b+c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
SIMD4 Fused-negated-multiply-subtract. Result is -a*b-c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
SIMD4 Fused-negated-multiply-subtract. Result is -a*b-c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
SIMD float Fused-negated-multiply-subtract. Result is -a*b-c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
SIMD double Fused-negated-multiply-subtract. Result is -a*b-c.
a | factor1 |
b | factor2 |
c | term |
|
inlinestatic |
Extract (integer) exponent and fraction from single precision SIMD.
opt | By default this function behaves like the standard library such that frexp(+-0,exp) returns +-0 and stores 0 in the exponent when value is 0. If you know the argument is always nonzero, you can set the template parameter to MathOptimization::Unsafe to make it slightly faster. |
value | Floating-point value to extract from | |
[out] | exponent | Returned exponent of value, integer SIMD format. |
|
inlinestatic |
Extract (integer) exponent and fraction from double precision SIMD.
opt | By default this function behaves like the standard library such that frexp(+-0,exp) returns +-0 and stores 0 in the exponent when value is 0. If you know the argument is always nonzero, you can set the template parameter to MathOptimization::Unsafe to make it slightly faster. |
value | Floating-point value to extract from | |
[out] | exponent | Returned exponent of value, integer SIMD format. |
|
inlinestatic |
Load 4 consecutive doubles from each of GMX_SIMD_DOUBLE_WIDTH offsets specified by a SIMD integer, transpose into 4 SIMD double variables.
align | Alignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 4 for this routine) the input data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are loaded. |
base | Aligned pointer to the start of the memory. | |
offset | SIMD integer type with offsets to the start of each triplet. | |
[out] | v0 | First component, base[align*offset[i]] for each i. |
[out] | v1 | Second component, base[align*offset[i] + 1] for each i. |
[out] | v2 | Third component, base[align*offset[i] + 2] for each i. |
[out] | v3 | Fourth component, base[align*offset[i] + 3] for each i. |
The floating-point memory locations must be aligned, but only to the smaller of four elements and the floating-point SIMD width.
|
inlinestatic |
Load 4 consecutive floats from each of GMX_SIMD_FLOAT_WIDTH offsets specified by a SIMD integer, transpose into 4 SIMD float variables.
align | Alignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 4 for this routine) the input data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are loaded. |
base | Aligned pointer to the start of the memory. | |
offset | SIMD integer type with offsets to the start of each triplet. | |
[out] | v0 | First component, base[align*offset[i]] for each i. |
[out] | v1 | Second component, base[align*offset[i] + 1] for each i. |
[out] | v2 | Third component, base[align*offset[i] + 2] for each i. |
[out] | v3 | Fourth component, base[align*offset[i] + 3] for each i. |
The floating-point memory locations must be aligned, but only to the smaller of four elements and the floating-point SIMD width.
|
inlinestatic |
Load 2 consecutive doubles from each of GMX_SIMD_DOUBLE_WIDTH offsets specified by a SIMD integer, transpose into 2 SIMD double variables.
align | Alignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 2 for this routine) the input data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are loaded. |
base | Aligned pointer to the start of the memory. | |
offset | SIMD integer type with offsets to the start of each triplet. | |
[out] | v0 | First component, base[align*offset[i]] for each i. |
[out] | v1 | Second component, base[align*offset[i] + 1] for each i. |
The floating-point memory locations must be aligned, but only to the smaller of two elements and the floating-point SIMD width.
|
inlinestatic |
Load 2 consecutive floats from each of GMX_SIMD_FLOAT_WIDTH offsets specified by a SIMD integer, transpose into 2 SIMD float variables.
align | Alignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 2 for this routine) the input data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are loaded. |
base | Aligned pointer to the start of the memory. | |
offset | SIMD integer type with offsets to the start of each triplet. | |
[out] | v0 | First component, base[align*offset[i]] for each i. |
[out] | v1 | Second component, base[align*offset[i] + 1] for each i. |
The floating-point memory locations must be aligned, but only to the smaller of two elements and the floating-point SIMD width.
|
inlinestatic |
Load 4 consecutive double from each of GMX_SIMD_DOUBLE_WIDTH offsets, and transpose into 4 SIMD double variables.
align | Alignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 4 for this routine) the input data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are loaded. |
base | Pointer to the start of the memory area | |
offset | Array with offsets to the start of each data point. | |
[out] | v0 | 1st component of data, base[align*offset[i]] for each i. |
[out] | v1 | 2nd component of data, base[align*offset[i] + 1] for each i. |
[out] | v2 | 3rd component of data, base[align*offset[i] + 2] for each i. |
[out] | v3 | 4th component of data, base[align*offset[i] + 3] for each i. |
The floating-point memory locations must be aligned, but only to the smaller of four elements and the floating-point SIMD width.
The offset memory must be aligned to GMX_SIMD_DINT32_WIDTH.
|
inlinestatic |
Load 4 consecutive floats from each of GMX_SIMD_FLOAT_WIDTH offsets, and transpose into 4 SIMD float variables.
align | Alignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 4 for this routine) the input data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are loaded. |
base | Pointer to the start of the memory area | |
offset | Array with offsets to the start of each data point. | |
[out] | v0 | 1st component of data, base[align*offset[i]] for each i. |
[out] | v1 | 2nd component of data, base[align*offset[i] + 1] for each i. |
[out] | v2 | 3rd component of data, base[align*offset[i] + 2] for each i. |
[out] | v3 | 4th component of data, base[align*offset[i] + 3] for each i. |
The floating-point memory locations must be aligned, but only to the smaller of four elements and the floating-point SIMD width.
The offset memory must be aligned to GMX_SIMD_DINT32_WIDTH.
|
inlinestatic |
Load 2 consecutive double from each of GMX_SIMD_DOUBLE_WIDTH offsets, and transpose into 2 SIMD double variables.
align | Alignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 2 for this routine) the input data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are loaded. |
base | Pointer to the start of the memory area | |
offset | Array with offsets to the start of each data point. | |
[out] | v0 | 1st component of data, base[align*offset[i]] for each i. |
[out] | v1 | 2nd component of data, base[align*offset[i] + 1] for each i. |
The floating-point memory locations must be aligned, but only to the smaller of two elements and the floating-point SIMD width.
The offset memory must be aligned to GMX_SIMD_DINT32_WIDTH.
|
inlinestatic |
Load 2 consecutive floats from each of GMX_SIMD_FLOAT_WIDTH offsets, and transpose into 2 SIMD float variables.
align | Alignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 2 for this routine) the input data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are loaded. |
base | Pointer to the start of the memory area | |
offset | Array with offsets to the start of each data point. | |
[out] | v0 | 1st component of data, base[align*offset[i]] for each i. |
[out] | v1 | 2nd component of data, base[align*offset[i] + 1] for each i. |
The floating-point memory locations must be aligned, but only to the smaller of two elements and the floating-point SIMD width.
The offset memory must be aligned to GMX_SIMD_FINT32_WIDTH.
To achieve the best possible performance, you should store your data with alignment c_simdBestPairAlignmentFloat in single, or c_simdBestPairAlignmentDouble in double.
|
inlinestatic |
Load 2 consecutive doubles from each of GMX_SIMD_DOUBLE_WIDTH/2 offsets, transpose into SIMD double (low half from base0, high from base1).
align | Alignment of the storage, i.e. the distance (measured in elements, not bytes) between index points. When this is identical to the number of output components the data is packed without padding. This must be a multiple of the alignment to keep all data aligned. |
base0 | Pointer to base of first aligned memory | |
base1 | Pointer to base of second aligned memory | |
offset | Offset to the start of each pair | |
[out] | v0 | 1st element in each pair, base0 in low and base1 in high half. |
[out] | v1 | 2nd element in each pair, base0 in low and base1 in high half. |
The offset array should be of half the SIMD width length, so it corresponds to the half-SIMD-register operations. This also means it must be aligned to half the integer SIMD width (i.e., GMX_SIMD_DINT32_WIDTH/2).
The floating-point memory locations must be aligned, but only to the smaller of two elements and the floating-point SIMD width.
This routine is primarily designed to load nonbonded parameters in the kernels. It is the equivalent of the full-width routine gatherLoadTranspose(), but just as the other hsimd routines it will pick half-SIMD-width data from base0 and put in the lower half, while the upper half comes from base1.
For an example, assume the SIMD width is 8, align is 2, that base0 is [A0 A1 B0 B1 C0 C1 D0 D1 ...], and base1 [E0 E1 F0 F1 G0 G1 H0 H1...].
Then we will get v0 as [A0 B0 C0 D0 E0 F0 G0 H0] and v1 as [A1 B1 C1 D1 E1 F1 G1 H1].
Available if GMX_SIMD_HAVE_HSIMD_UTIL_DOUBLE is 1.
|
inlinestatic |
Load 2 consecutive floats from each of GMX_SIMD_FLOAT_WIDTH/2 offsets, transpose into SIMD float (low half from base0, high from base1).
align | Alignment of the storage, i.e. the distance (measured in elements, not bytes) between index points. When this is identical to the number of output components the data is packed without padding. This must be a multiple of the alignment to keep all data aligned. |
base0 | Pointer to base of first aligned memory | |
base1 | Pointer to base of second aligned memory | |
offset | Offset to the start of each pair | |
[out] | v0 | 1st element in each pair, base0 in low and base1 in high half. |
[out] | v1 | 2nd element in each pair, base0 in low and base1 in high half. |
The offset array should be of half the SIMD width length, so it corresponds to the half-SIMD-register operations. This also means it must be aligned to half the integer SIMD width (i.e., GMX_SIMD_FINT32_WIDTH/2).
The floating-point memory locations must be aligned, but only to the smaller of two elements and the floating-point SIMD width.
This routine is primarily designed to load nonbonded parameters in the kernels. It is the equivalent of the full-width routine gatherLoadTranspose(), but just as the other hsimd routines it will pick half-SIMD-width data from base0 and put in the lower half, while the upper half comes from base1.
For an example, assume the SIMD width is 8, align is 2, that base0 is [A0 A1 B0 B1 C0 C1 D0 D1 ...], and base1 [E0 E1 F0 F1 G0 G1 H0 H1...].
Then we will get v0 as [A0 B0 C0 D0 E0 F0 G0 H0] and v1 as [A1 B1 C1 D1 E1 F1 G1 H1].
Available if GMX_SIMD_HAVE_HSIMD_UTIL_FLOAT is 1.
|
inlinestatic |
Load 2 consecutive doubles from each of GMX_SIMD_DOUBLE_WIDTH offsets (unaligned) specified by SIMD integer, transpose into 2 SIMD doubles.
align | Alignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 2 for this routine) the input data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are loaded. |
base | Pointer to the start of the memory. | |
offset | SIMD integer type with offsets to the start of each triplet. | |
[out] | v0 | First component, base[align*offset[i]] for each i. |
[out] | v1 | Second component, base[align*offset[i] + 1] for each i. |
Since some SIMD architectures cannot handle any unaligned loads, this routine is only available if GMX_SIMD_HAVE_GATHER_LOADU_BYSIMDINT_TRANSPOSE is 1.
|
inlinestatic |
Load 2 consecutive floats from each of GMX_SIMD_FLOAT_WIDTH offsets (unaligned) specified by SIMD integer, transpose into 2 SIMD floats.
align | Alignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 2 for this routine) the input data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are loaded. |
base | Pointer to the start of the memory. | |
offset | SIMD integer type with offsets to the start of each triplet. | |
[out] | v0 | First component, base[align*offset[i]] for each i. |
[out] | v1 | Second component, base[align*offset[i] + 1] for each i. |
Since some SIMD architectures cannot handle any unaligned loads, this routine is only available if GMX_SIMD_HAVE_GATHER_LOADU_BYSIMDINT_TRANSPOSE is 1.
|
inlinestatic |
Load 3 consecutive doubles from each of GMX_SIMD_DOUBLE_WIDTH offsets, and transpose into 3 SIMD double variables.
align | Alignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 3 for this routine) the input data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are loaded. |
base | Pointer to the start of the memory area | |
offset | Array with offsets to the start of each data point. | |
[out] | v0 | 1st component of data, base[align*offset[i]] for each i. |
[out] | v1 | 2nd component of data, base[align*offset[i] + 1] for each i. |
[out] | v2 | 3rd component of data, base[align*offset[i] + 2] for each i. |
This function can work with both aligned (better performance) and unaligned memory. When the align parameter is not a power-of-two (align==3 would be normal for packed atomic coordinates) the memory obviously cannot be aligned, and we account for this. However, in the case where align is a power-of-two, we assume the base pointer also has the same alignment, which will enable many platforms to use faster aligned memory load operations. An easy way to think of this is that each triplet of data in memory must be aligned to the align parameter you specify when it's a power-of-two.
The offset memory must always be aligned to GMX_SIMD_FINT32_WIDTH, since this enables us to use SIMD loads and gather operations on platforms that support it.
|
inlinestatic |
Load 3 consecutive floats from each of GMX_SIMD_FLOAT_WIDTH offsets, and transpose into 3 SIMD float variables.
align | Alignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 3 for this routine) the input data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are loaded. |
base | Pointer to the start of the memory area | |
offset | Array with offsets to the start of each data point. | |
[out] | v0 | 1st component of data, base[align*offset[i]] for each i. |
[out] | v1 | 2nd component of data, base[align*offset[i] + 1] for each i. |
[out] | v2 | 3rd component of data, base[align*offset[i] + 2] for each i. |
This function can work with both aligned (better performance) and unaligned memory. When the align parameter is not a power-of-two (align==3 would be normal for packed atomic coordinates) the memory obviously cannot be aligned, and we account for this. However, in the case where align is a power-of-two, we assume the base pointer also has the same alignment, which will enable many platforms to use faster aligned memory load operations. An easy way to think of this is that each triplet of data in memory must be aligned to the align parameter you specify when it's a power-of-two.
The offset memory must always be aligned to GMX_SIMD_FINT32_WIDTH, since this enables us to use SIMD loads and gather operations on platforms that support it.
|
static |
Generate test point vector.
range | The test interval, half open. Upper limit is not included. Pass by value, since we need to modify in method anyway. |
points | Number of points to generate. This might be increased slightly to account both for extra special values like 0.0 and the SIMD width. |
This routine generates a vector with test points separated by constant multiplicative factors, based on the range and number of points in the class. If the range includes both negative and positive values, points will be generated separately for the negative/positive intervals down to the smallest real number that can be represented, and we also include 0.0 explicitly.
This is highly useful for large test ranges. For example, with a linear 1000-point division of the range (1,1e10) the first three values to test would be 1, 10000000.999, and 20000000.998, etc. For large values we would commonly hit the point where adding the small delta has no effect due to limited numerical precision. When we instead use this routine, the values will be 1, 1.0239, 1.0471, etc. This will spread the entropy over all bits in the IEEE754 representation, and be a much better test of all potential input values.
|
inlinestatic |
Add each half of SIMD variable to separate memory adresses.
m0 | Pointer to memory aligned to half SIMD width. |
m1 | Pointer to memory aligned to half SIMD width. |
a | SIMD variable. Lower half will be added to m0, upper half to m1. |
The memory must be aligned to half SIMD width.
Available if GMX_SIMD_HAVE_HSIMD_UTIL_DOUBLE is 1.
|
inlinestatic |
Add each half of SIMD variable to separate memory adresses.
m0 | Pointer to memory aligned to half SIMD width. |
m1 | Pointer to memory aligned to half SIMD width. |
a | SIMD variable. Lower half will be added to m0, upper half to m1. |
The memory must be aligned to half SIMD width.
Available if GMX_SIMD_HAVE_HSIMD_UTIL_FLOAT is 1.
|
inlinestatic |
Calculate 1/x for SIMD float.
x | Argument with magnitude larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
|
inlinestatic |
Calculate 1/x for SIMD double.
x | Argument with magnitude larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
|
inlinestatic |
Inverse cube root for SIMD floats.
x | Argument to calculate cube root of. Can be positive or negative, but the magnitude cannot be lower than the smallest normal number. |
|
inlinestatic |
Inverse cube root for SIMD doubles.
x | Argument to calculate cube root of. Can be positive or negative, but the magnitude cannot be lower than the smallest normal number. |
|
inlinestatic |
Inverse cube root for SIMD doubles, single accuracy.
x | Argument to calculate cube root of. Can be positive or negative, but the magnitude cannot be lower than the smallest normal number. |
|
inlinestatic |
Calculate 1/cbrt(x) for SIMD float, always targeting single accuracy.
x | Argument to calculate cube root of. Can be negative or zero, but NaN or Inf values are not supported. Denormal values will be treated as 0.0. |
|
inlinestatic |
Calculate 1/x for SIMD double, but in single accuracy.
x | Argument with magnitude larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
|
inlinestatic |
Calculate 1/x for SIMD float, only targeting single accuracy.
x | Argument with magnitude larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
|
inlinestatic |
Calculate 1/sqrt(x) for SIMD float.
x | Argument that must be larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
|
inlinestatic |
Calculate 1/sqrt(x) for SIMD double.
x | Argument that must be larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
|
inlinestatic |
Calculate 1/sqrt(x) for SIMD4 float.
x | Argument that must be larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
|
inlinestatic |
Calculate 1/sqrt(x) for SIMD4 double.
x | Argument that must be larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
|
inlinestatic |
Calculate 1/sqrt(x) for two SIMD floats.
x0 | First set of arguments, x0 must be in single range (see below). | |
x1 | Second set of arguments, x1 must be in single range (see below). | |
[out] | out0 | Result 1/sqrt(x0) |
[out] | out1 | Result 1/sqrt(x1) |
In particular for double precision we can sometimes calculate square root pairs slightly faster by using single precision until the very last step.
|
inlinestatic |
Calculate 1/sqrt(x) for two SIMD doubles.
x0 | First set of arguments, x0 must be in single range (see below). | |
x1 | Second set of arguments, x1 must be in single range (see below). | |
[out] | out0 | Result 1/sqrt(x0) |
[out] | out1 | Result 1/sqrt(x1) |
In particular for double precision we can sometimes calculate square root pairs slightly faster by using single precision until the very last step.
|
inlinestatic |
Calculate 1/sqrt(x) for two SIMD doubles, but single accuracy.
x0 | First set of arguments, x0 must be in single range (see below). | |
x1 | Second set of arguments, x1 must be in single range (see below). | |
[out] | out0 | Result 1/sqrt(x0) |
[out] | out1 | Result 1/sqrt(x1) |
In particular for double precision we can sometimes calculate square root pairs slightly faster by using single precision until the very last step.
|
inlinestatic |
Calculate 1/sqrt(x) for two SIMD floats, only targeting single accuracy.
x0 | First set of arguments, x0 must be in single range (see below). | |
x1 | Second set of arguments, x1 must be in single range (see below). | |
[out] | out0 | Result 1/sqrt(x0) |
[out] | out1 | Result 1/sqrt(x1) |
In particular for double precision we can sometimes calculate square root pairs slightly faster by using single precision until the very last step.
|
inlinestatic |
Calculate 1/sqrt(x) for SIMD double, but in single accuracy.
x | Argument that must be larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
|
inlinestatic |
Calculate 1/sqrt(x) for SIMD4 double, but in single accuracy.
x | Argument that must be larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
|
inlinestatic |
Calculate 1/sqrt(x) for SIMD float, only targeting single accuracy.
x | Argument that must be larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
|
inlinestatic |
Calculate 1/sqrt(x) for SIMD4 float, only targeting single accuracy.
x | Argument that must be larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
|
inlinestatic |
SIMD float inner product of multiple float vectors.
ax | X components of first vectors |
ay | Y components of first vectors |
az | Z components of first vectors |
bx | X components of second vectors |
by | Y components of second vectors |
bz | Z components of second vectors |
|
inlinestatic |
SIMD double inner product of multiple double vectors.
ax | X components of first vectors |
ay | Y components of first vectors |
az | Z components of first vectors |
bx | X components of second vectors |
by | Y components of second vectors |
bz | Z components of second vectors |
|
inlinestatic |
Multiply a SIMD float value by the number 2 raised to an exp power.
opt | By default, this routine will return zero for input arguments that are so small they cannot be reproduced in the current precision. If the unsafe math optimization template parameter setting is used, these tests are skipped, and the result will be undefined (possible even NaN). This might happen below -127 in single precision or -1023 in double, although some might use denormal support to extend the range. |
value | Floating-point number to multiply with new exponent |
exponent | Integer that will not overflow as 2^exponent. |
|
inlinestatic |
Multiply a SIMD double value by the number 2 raised to an exp power.
opt | By default, this routine will return zero for input arguments that are so small they cannot be reproduced in the current precision. If the unsafe math optimization template parameter setting is used, these tests are skipped, and the result will be undefined (possible even NaN). This might happen below -127 in single precision or -1023 in double, although some might use denormal support to extend the range. |
value | Floating-point number to multiply with new exponent |
exponent | Integer that will not overflow as 2^exponent. |
|
inlinestatic |
Load 4 float values from aligned memory into SIMD4 variable.
m | Pointer to memory aligned to 4 elements. |
|
inlinestatic |
Load 4 double values from aligned memory into SIMD4 variable.
m | Pointer to memory aligned to 4 elements. |
|
inlinestatic |
Load 4 doubles and duplicate them N times each.
m | Pointer to memory aligned to 4 doubles |
Available if GMX_SIMD_HAVE_4NSIMD_UTIL_DOUBLE is 1. N is GMX_SIMD_DOUBLE_WIDTH/4. Different values are contigous and same values are 4 positions in SIMD apart.
|
inlinestatic |
Load 4 floats and duplicate them N times each.
m | Pointer to memory aligned to 4 floats |
Available if GMX_SIMD_HAVE_4NSIMD_UTIL_FLOAT is 1. N is GMX_SIMD_FLOAT_WIDTH/4. Different values are contigous and same values are 4 positions in SIMD apart.
|
inlinestatic |
Load SIMD4 float from unaligned memory.
Available if GMX_SIMD_HAVE_LOADU is 1.
m | Pointer to memory, no alignment requirement. |
|
inlinestatic |
Load SIMD4 double from unaligned memory.
Available if GMX_SIMD_HAVE_LOADU is 1.
m | Pointer to memory, no alignment requirement. |
|
inlinestatic |
Load low & high parts of SIMD double from different locations.
m0 | Pointer to memory aligned to half SIMD width. |
m1 | Pointer to memory aligned to half SIMD width. |
Available if GMX_SIMD_HAVE_HSIMD_UTIL_DOUBLE is 1.
|
inlinestatic |
Load low & high parts of SIMD float from different locations.
m0 | Pointer to memory aligned to half SIMD width. |
m1 | Pointer to memory aligned to half SIMD width. |
Available if GMX_SIMD_HAVE_HSIMD_UTIL_FLOAT is 1.
|
inlinestatic |
Load half-SIMD-width double data, spread to both halves.
m | Pointer to memory aligned to half SIMD width. |
Available if GMX_SIMD_HAVE_HSIMD_UTIL_DOUBLE is 1.
|
inlinestatic |
Load half-SIMD-width float data, spread to both halves.
m | Pointer to memory aligned to half SIMD width. |
Available if GMX_SIMD_HAVE_HSIMD_UTIL_FLOAT is 1.
void gmx::test::anonymous_namespace{bootstrap_loadstore.cpp}::loadStoreTester | ( | TSimd gmx_simdcall | loadFnconst T *mem, |
void gmx_simdcall | storeFnT *mem, TSimd, | ||
const int | loadOffset, | ||
const int | storeOffset | ||
) |
Generic routine to test load & store of SIMD, and check for side effects.
The tests for load, store, unaligned load and unaligned store both for real and int are pretty much similar, so we use a template function with additional function pointers for the actual load/store calls.
|
inlinestatic |
Load two doubles, spread 1st in low half, 2nd in high half.
m | Pointer to two adjacent double values. |
Available if GMX_SIMD_HAVE_HSIMD_UTIL_DOUBLE is 1.
|
inlinestatic |
Load two floats, spread 1st in low half, 2nd in high half.
m | Pointer to two adjacent float values. |
Available if GMX_SIMD_HAVE_HSIMD_UTIL_FLOAT is 1.
|
inlinestatic |
Load doubles in blocks of 4 at fixed offsets.
m | Pointer to unaligned memory |
offset | Offset in memory between input blocks of 4 |
Available if GMX_SIMD_HAVE_4NSIMD_UTIL_DOUBLE is 1. Blocks of 4 doubles are loaded from m+n*offset where n is the n-th block of 4 doubles.
|
inlinestatic |
Load floats in blocks of 4 at fixed offsets.
m | Pointer to unaligned memory |
offset | Offset in memory between input blocks of 4 |
Available if GMX_SIMD_HAVE_4NSIMD_UTIL_FLOAT is 1. Blocks of 4 floats are loaded from m+n*offset where n is the n-th block of 4 floats.
|
inlinestatic |
Load N doubles and duplicate them 4 times each.
m | Pointer to unaligned memory |
Available if GMX_SIMD_HAVE_4NSIMD_UTIL_DOUBLE is 1. N is GMX_SIMD_DOUBLE_WIDTH/4. Duplicated values are contigous and different values are 4 positions in SIMD apart.
|
inlinestatic |
Load N floats and duplicate them 4 times each.
m | Pointer to unaligned memory |
Available if GMX_SIMD_HAVE_4NSIMD_UTIL_FLOAT is 1. N is GMX_SIMD_FLOAT_WIDTH/4. Duplicated values are contigous and different values are 4 positions in SIMD apart.
TSimd gmx_simdcall gmx::test::anonymous_namespace{bootstrap_loadstore.cpp}::loadUWrapper | ( | const T * | m | ) |
Wrapper to handle proxy objects returned by some loadU functions.
T | Type of scalar object |
TSimd | Corresponding SIMD type |
m | Memory address to load from |
TSimd gmx_simdcall gmx::test::anonymous_namespace{bootstrap_loadstore.cpp}::loadWrapper | ( | const T * | m | ) |
Wrapper to handle proxy objects returned by some load functions.
T | Type of scalar object |
TSimd | Corresponding SIMD type |
m | Memory address to load from |
|
inlinestatic |
SIMD float log(x). This is the natural logarithm.
x | Argument, should be >0. |
|
inlinestatic |
SIMD double log(x). This is the natural logarithm.
x | Argument, should be >0. |
|
inlinestatic |
SIMD float log2(x). This is the base-2 logarithm.
x | Argument, should be >0. |
|
inlinestatic |
SIMD double log2(x). This is the base-2 logarithm.
x | Argument, should be >0. |
|
inlinestatic |
SIMD log2(x). Double precision SIMD data, single accuracy.
x | Argument, should be >0. |
|
inlinestatic |
SIMD float log2(x), only targeting single accuracy. This is the base-2 logarithm.
x | Argument, should be >0. |
|
inlinestatic |
SIMD log(x). Double precision SIMD data, single accuracy.
x | Argument, should be >0. |
|
inlinestatic |
SIMD float log(x), only targeting single accuracy. This is the natural logarithm.
x | Argument, should be >0. |
|
inlinestatic |
Add two float SIMD variables, masked version.
a | term1 |
b | term2 |
m | mask |
|
inlinestatic |
Add two double SIMD variables, masked version.
a | term1 |
b | term2 |
m | mask |
|
inlinestatic |
SIMD float fused multiply-add, masked version.
a | factor1 |
b | factor2 |
c | term |
m | mask |
|
inlinestatic |
SIMD double fused multiply-add, masked version.
a | factor1 |
b | factor2 |
c | term |
m | mask |
|
inlinestatic |
Calculate 1/x for SIMD float, masked version.
x | Argument with magnitude larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX for masked-in entries. See invsqrt for the discussion about argument restrictions. |
m | Mask |
|
inlinestatic |
Calculate 1/x for SIMD double, masked version.
x | Argument with magnitude larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX for masked-in entries. See invsqrt for the discussion about argument restrictions. |
m | Mask |
|
inlinestatic |
1/x for masked entries of SIMD double, single accuracy.
x | Argument with magnitude larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
m | Mask |
|
inlinestatic |
Calculate 1/x for masked SIMD floats, only targeting single accuracy.
x | Argument with magnitude larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
m | Mask |
|
inlinestatic |
Calculate 1/sqrt(x) for masked entries of SIMD float.
This routine only evaluates 1/sqrt(x) for elements for which mask is true. Illegal values in the masked-out elements will not lead to floating-point exceptions.
x | Argument that must be larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX for masked-in entries. See invsqrt for the discussion about argument restrictions. |
m | Mask |
|
inlinestatic |
Calculate 1/sqrt(x) for masked entries of SIMD double.
This routine only evaluates 1/sqrt(x) for elements for which mask is true. Illegal values in the masked-out elements will not lead to floating-point exceptions.
x | Argument that must be larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX for masked-in entries. See invsqrt for the discussion about argument restrictions. |
m | Mask |
|
inlinestatic |
1/sqrt(x) for masked-in entries of SIMD double, but in single accuracy.
This routine only evaluates 1/sqrt(x) for elements for which mask is true. Illegal values in the masked-out elements will not lead to floating-point exceptions.
x | Argument that must be larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
m | Mask |
|
inlinestatic |
Calculate 1/sqrt(x) for masked SIMD floats, only targeting single accuracy.
This routine only evaluates 1/sqrt(x) for elements for which mask is true. Illegal values in the masked-out elements will not lead to floating-point exceptions.
x | Argument that must be larger than GMX_FLOAT_MIN and smaller than GMX_FLOAT_MAX, i.e. within the range of single precision. For the single precision implementation this is obviously always true for positive values, but for double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
m | Mask |
|
inlinestatic |
Multiply two float SIMD variables, masked version.
a | factor1 |
b | factor2 |
m | mask |
|
inlinestatic |
Multiply two double SIMD variables, masked version.
a | factor1 |
b | factor2 |
m | mask |
|
inlinestatic |
SIMD float 1.0/x lookup, masked version.
This is a low-level instruction that should only be called from routines implementing the reciprocal in simd_math.h.
x | Argument, x>0 for entries where mask is true. |
m | Mask |
|
inlinestatic |
SIMD double 1.0/x lookup, masked version.
This is a low-level instruction that should only be called from routines implementing the reciprocal in simd_math.h.
x | Argument, x>0 for entries where mask is true. |
m | Mask |
|
inlinestatic |
SIMD float 1.0/sqrt(x) lookup, masked version.
This is a low-level instruction that should only be called from routines implementing the inverse square root in simd_math.h.
x | Argument, x>0 for entries where mask is true. |
m | Mask |
|
inlinestatic |
SIMD double 1.0/sqrt(x) lookup, masked version.
This is a low-level instruction that should only be called from routines implementing the inverse square root in simd_math.h.
x | Argument, x>0 for entries where mask is true. |
m | Mask |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
SIMD float norm squared of multiple vectors.
ax | X components of vectors |
ay | Y components of vectors |
az | Z components of vectors |
|
inlinestatic |
SIMD double norm squared of multiple vectors.
ax | X components of vectors |
ay | Y components of vectors |
az | Z components of vectors |
|
inlinestatic |
SIMD4 float norm squared of multiple vectors.
ax | X components of vectors |
ay | Y components of vectors |
az | Z components of vectors |
|
inlinestatic |
SIMD4 double norm squared of multiple vectors.
ax | X components of vectors |
ay | Y components of vectors |
az | Z components of vectors |
|
inlinestatic |
a!=b for SIMD4 float
a | value1 |
b | value2 |
|
inlinestatic |
a!=b for SIMD4 double
a | value1 |
b | value2 |
|
inlinestatic |
SIMD a!=b for single SIMD.
a | value1 |
b | value2 |
Beware that exact floating-point comparisons are difficult.
|
inlinestatic |
SIMD a!=b for double SIMD.
a | value1 |
b | value2 |
Beware that exact floating-point comparisons are difficult.
|
inlinestatic |
Bitwise and for two SIMD4 float variables.
Supported if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Bitwise and for two SIMD4 double variables.
Supported if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Bitwise and for two SIMD float variables.
Supported if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Bitwise and for two SIMD double variables.
Supported if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Integer SIMD bitwise and.
Available if GMX_SIMD_HAVE_FINT32_LOGICAL is 1.
a | first integer SIMD |
b | second integer SIMD |
|
inlinestatic |
Integer SIMD bitwise and.
Available if GMX_SIMD_HAVE_DINT32_LOGICAL is 1.
a | first integer SIMD |
b | second integer SIMD |
|
inlinestatic |
Logical and on single precision SIMD4 booleans.
a | logical vars 1 |
b | logical vars 2 |
|
inlinestatic |
Logical and on single precision SIMD4 booleans.
a | logical vars 1 |
b | logical vars 2 |
|
inlinestatic |
Logical and on single precision SIMD booleans.
a | logical vars 1 |
b | logical vars 2 |
|
inlinestatic |
Logical and on double precision SIMD booleans.
a | logical vars 1 |
b | logical vars 2 |
|
inlinestatic |
Logical AND on SimdFIBool.
Available if GMX_SIMD_HAVE_FINT32_ARITHMETICS is 1.
a | SIMD boolean 1 |
b | SIMD boolean 2 |
|
inlinestatic |
Logical AND on SimdDIBool.
Available if GMX_SIMD_HAVE_DINT32_ARITHMETICS is 1.
a | SIMD boolean 1 |
b | SIMD boolean 2 |
|
inlinestatic |
Multiply two SIMD4 variables.
a | factor1 |
b | factor2 |
|
inlinestatic |
Multiply two SIMD4 variables.
a | factor1 |
b | factor2 |
|
inlinestatic |
Multiply two float SIMD variables.
a | factor1 |
b | factor2 |
|
inlinestatic |
Multiply two double SIMD variables.
a | factor1 |
b | factor2 |
|
inlinestatic |
Multiply SIMD integers.
This routine is only available if GMX_SIMD_HAVE_FINT32_ARITHMETICS (single) or GMX_SIMD_HAVE_DINT32_ARITHMETICS (double) is 1.
a | factor1 |
b | factor2 |
|
inlinestatic |
Multiply SIMD integers.
Available if GMX_SIMD_HAVE_DINT32_ARITHMETICS is 1.
a | factor1 |
b | factor2 |
|
inlinestatic |
Add two double SIMD4 variables.
a | term1 |
b | term2 |
|
inlinestatic |
Add two float SIMD4 variables.
a | term1 |
b | term2 |
|
inlinestatic |
Add two float SIMD variables.
a | term1 |
b | term2 |
|
inlinestatic |
Add two double SIMD variables.
a | term1 |
b | term2 |
|
inlinestatic |
Add SIMD integers.
This routine is only available if GMX_SIMD_HAVE_FINT32_ARITHMETICS (single) or GMX_SIMD_HAVE_DINT32_ARITHMETICS (double) is 1.
a | term1 |
b | term2 |
|
inlinestatic |
Add SIMD integers.
Available if GMX_SIMD_HAVE_DINT32_ARITHMETICS is 1.
a | term1 |
b | term2 |
|
inlinestatic |
Subtract two SIMD4 variables.
a | term1 |
b | term2 |
|
inlinestatic |
Subtract two SIMD4 variables.
a | term1 |
b | term2 |
|
inlinestatic |
SIMD4 floating-point negate.
a | SIMD4 floating-point value |
|
inlinestatic |
SIMD4 floating-point negate.
a | SIMD4 floating-point value |
|
inlinestatic |
Subtract two float SIMD variables.
a | term1 |
b | term2 |
|
inlinestatic |
Subtract two double SIMD variables.
a | term1 |
b | term2 |
|
inlinestatic |
SIMD single precision negate.
a | SIMD double precision value |
|
inlinestatic |
SIMD double precision negate.
a | SIMD double precision value |
|
inlinestatic |
Subtract SIMD integers.
This routine is only available if GMX_SIMD_HAVE_FINT32_ARITHMETICS (single) or GMX_SIMD_HAVE_DINT32_ARITHMETICS (double) is 1.
a | term1 |
b | term2 |
|
inlinestatic |
Subtract SIMD integers.
Available if GMX_SIMD_HAVE_DINT32_ARITHMETICS is 1.
a | term1 |
b | term2 |
|
inlinestatic |
Division for SIMD floats.
nom | Nominator |
denom | Denominator, with magnitude in range (GMX_FLOAT_MIN,GMX_FLOAT_MAX). For single precision this is equivalent to a nonzero argument, but in double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
|
inlinestatic |
Division for SIMD doubles.
nom | Nominator |
denom | Denominator, with magnitude in range (GMX_FLOAT_MIN,GMX_FLOAT_MAX). For single precision this is equivalent to a nonzero argument, but in double precision it adds an extra restriction since the first lookup step might have to be performed in single precision on some architectures. Note that the responsibility for checking falls on you - this routine does not check arguments. |
|
inlinestatic |
a<b for SIMD4 float
a | value1 |
b | value2 |
|
inlinestatic |
a<b for SIMD4 double
a | value1 |
b | value2 |
|
inlinestatic |
SIMD a<b for single SIMD.
a | value1 |
b | value2 |
|
inlinestatic |
SIMD a<b for double SIMD.
a | value1 |
b | value2 |
|
inlinestatic |
Less-than comparison of two SIMD integers corresponding to float values.
Available if GMX_SIMD_HAVE_FINT32_ARITHMETICS is 1.
a | SIMD integer1 |
b | SIMD integer2 |
|
inlinestatic |
Less-than comparison of two SIMD integers corresponding to double values.
Available if GMX_SIMD_HAVE_DINT32_ARITHMETICS is 1.
a | SIMD integer1 |
b | SIMD integer2 |
|
inlinestatic |
a<=b for SIMD4 float.
a | value1 |
b | value2 |
|
inlinestatic |
a<=b for SIMD4 double.
a | value1 |
b | value2 |
|
inlinestatic |
SIMD a<=b for single SIMD.
a | value1 |
b | value2 |
|
inlinestatic |
SIMD a<=b for double SIMD.
a | value1 |
b | value2 |
|
inlinestatic |
a==b for SIMD4 float
a | value1 |
b | value2 |
|
inlinestatic |
a==b for SIMD4 double
a | value1 |
b | value2 |
|
inlinestatic |
SIMD a==b for single SIMD.
a | value1 |
b | value2 |
Beware that exact floating-point comparisons are difficult.
|
inlinestatic |
SIMD a==b for double SIMD.
a | value1 |
b | value2 |
Beware that exact floating-point comparisons are difficult.
|
inlinestatic |
Equality comparison of two integers corresponding to float values.
Available if GMX_SIMD_HAVE_FINT32_ARITHMETICS is 1.
a | SIMD integer1 |
b | SIMD integer2 |
|
inlinestatic |
Equality comparison of two integers corresponding to double values.
Available if GMX_SIMD_HAVE_DINT32_ARITHMETICS is 1.
a | SIMD integer1 |
b | SIMD integer2 |
|
inlinestatic |
Bitwise xor for two SIMD4 double variables.
Available if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Bitwise xor for two SIMD4 float variables.
Available if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Bitwise xor for SIMD float.
Available if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Bitwise xor for SIMD double.
Available if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Integer SIMD bitwise xor.
Available if GMX_SIMD_HAVE_FINT32_LOGICAL is 1.
a | first integer SIMD |
b | second integer SIMD |
|
inlinestatic |
Integer SIMD bitwise xor.
Available if GMX_SIMD_HAVE_DINT32_LOGICAL is 1.
a | first integer SIMD |
b | second integer SIMD |
|
inlinestatic |
Bitwise or for two SIMD4 doubles.
Available if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Bitwise or for two SIMD4 floats.
Available if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Bitwise or for SIMD float.
Available if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Bitwise or for SIMD double.
Available if GMX_SIMD_HAVE_LOGICAL is 1.
a | data1 |
b | data2 |
|
inlinestatic |
Integer SIMD bitwise or.
Available if GMX_SIMD_HAVE_FINT32_LOGICAL is 1.
a | first integer SIMD |
b | second integer SIMD |
|
inlinestatic |
Integer SIMD bitwise or.
Available if GMX_SIMD_HAVE_DINT32_LOGICAL is 1.
a | first integer SIMD |
b | second integer SIMD |
|
inlinestatic |
Logical or on single precision SIMD4 booleans.
a | logical vars 1 |
b | logical vars 2 |
Note that this is not necessarily a bitwise operation - the storage format of booleans is implementation-dependent.
|
inlinestatic |
Logical or on single precision SIMD4 booleans.
a | logical vars 1 |
b | logical vars 2 |
Note that this is not necessarily a bitwise operation - the storage format of booleans is implementation-dependent.
|
inlinestatic |
Logical or on single precision SIMD booleans.
a | logical vars 1 |
b | logical vars 2 |
Note that this is not necessarily a bitwise operation - the storage format of booleans is implementation-dependent.
\
|
inlinestatic |
Logical or on double precision SIMD booleans.
a | logical vars 1 |
b | logical vars 2 |
Note that this is not necessarily a bitwise operation - the storage format of booleans is implementation-dependent.
\
|
inlinestatic |
Logical OR on SimdFIBool.
Available if GMX_SIMD_HAVE_FINT32_ARITHMETICS is 1.
a | SIMD boolean 1 |
b | SIMD boolean 2 |
|
inlinestatic |
Logical OR on SimdDIBool.
Available if GMX_SIMD_HAVE_DINT32_ARITHMETICS is 1.
a | SIMD boolean 1 |
b | SIMD boolean 2 |
|
inlinestatic |
Calculate the force correction due to PME analytically in SIMD float.
z2 | - see below for details. |
This routine is meant to enable analytical evaluation of the direct-space PME electrostatic force to avoid tables.
The direct-space potential should be , but there are some problems evaluating that:
First, the error function is difficult (read: expensive) to approxmiate accurately for intermediate to large arguments, and this happens already in ranges of that occur in simulations. Second, we now try to avoid calculating potentials in Gromacs but use forces directly.
We can simply things slight by noting that the PME part is really a correction to the normal Coulomb force since , i.e.
The first term we already have from the inverse square root, so that we can leave out of this routine.
For pme tolerances of 1e-3 to 1e-8 and cutoffs of 0.5nm to 1.8nm, the argument will be in the range 0.15 to ~4, which is the range used for the minimax fit. Use your favorite plotting program to realize how well-behaved is in this range!
We approximate with a rational minimax polynomial. However, it turns out it is more efficient to approximate and then only use even powers. This is another minor optimization, since we actually want , because it is going to be multiplied by the vector between the two atoms to get the vectorial force. The fastest flops are the ones we can avoid calculating!
So, here's how it should be used:
The return value is the expression:
Multiply the entire expression by . This will get you
or, switching back to (since ):
With a bit of math exercise you should be able to confirm that this is exactly
This approximation achieves an error slightly lower than 1e-6 in single precision and 1e-11 in double precision for arguments smaller than 16 ( ); when added to the error will be insignificant. For the return value can be inf or NaN.
|
inlinestatic |
Calculate the force correction due to PME analytically in SIMD double.
z2 | This should be the value , where r is your interaction distance and beta the ewald splitting parameters. |
This routine is meant to enable analytical evaluation of the direct-space PME electrostatic force to avoid tables. For details, see the single precision function.
|
inlinestatic |
Analytical PME force correction, double SIMD data, single accuracy.
z2 | - see below for details. |
This routine is meant to enable analytical evaluation of the direct-space PME electrostatic force to avoid tables.
The direct-space potential should be , but there are some problems evaluating that:
First, the error function is difficult (read: expensive) to approxmiate accurately for intermediate to large arguments, and this happens already in ranges of that occur in simulations. Second, we now try to avoid calculating potentials in Gromacs but use forces directly.
We can simply things slight by noting that the PME part is really a correction to the normal Coulomb force since , i.e.
The first term we already have from the inverse square root, so that we can leave out of this routine.
For pme tolerances of 1e-3 to 1e-8 and cutoffs of 0.5nm to 1.8nm, the argument will be in the range 0.15 to ~4. Use your favorite plotting program to realize how well-behaved is in this range!
We approximate with a rational minimax polynomial. However, it turns out it is more efficient to approximate and then only use even powers. This is another minor optimization, since we actually want , because it is going to be multiplied by the vector between the two atoms to get the vectorial force. The fastest flops are the ones we can avoid calculating!
So, here's how it should be used:
The return value is the expression:
Multiply the entire expression by . This will get you
or, switching back to (since ):
With a bit of math exercise you should be able to confirm that this is exactly
This approximation achieves an accuracy slightly lower than 1e-6; when added to the error will be insignificant.
|
inlinestatic |
SIMD Analytic PME force correction, only targeting single accuracy.
z2 | - see default single precision version for details. |
|
inlinestatic |
Calculate the potential correction due to PME analytically in SIMD float.
z2 | - see below for details. |
See pmeForceCorrection for details about the approximation.
This routine calculates , although you should provide as the input argument.
Here's how it should be used:
The return value is the expression:
Multiply the entire expression by beta and switching back to (since ):
This approximation achieves an error slightly lower than 1e-6 in single precision and 4e-11 in double precision for arguments smaller than 16 ( ); for the error can be twice as high; when added to the error will be insignificant. For the return value can be inf or NaN.
|
inlinestatic |
Calculate the potential correction due to PME analytically in SIMD double.
z2 | This should be the value , where r is your interaction distance and beta the ewald splitting parameters. |
This routine is meant to enable analytical evaluation of the direct-space PME electrostatic potential to avoid tables. For details, see the single precision function.
|
inlinestatic |
Analytical PME potential correction, double SIMD data, single accuracy.
z2 | - see below for details. |
This routine calculates , although you should provide as the input argument.
Here's how it should be used:
The return value is the expression:
Multiply the entire expression by beta and switching back to (since ):
This approximation achieves an accuracy slightly lower than 1e-6; when added to the error will be insignificant.
|
inlinestatic |
SIMD Analytic PME potential correction, only targeting single accuracy.
z2 | - see default single precision version for details. |
|
inlinestatic |
SIMD float pow(x,y)
This returns x^y for SIMD values.
opt | If this is changed from the default (safe) into the unsafe option, there are no guarantees about correct results for x==0. |
x | Base. |
y | exponent. |
|
inlinestatic |
SIMD double pow(x,y)
This returns x^y for SIMD values.
opt | If this is changed from the default (safe) into the unsafe option, there are no guarantees about correct results for x==0. |
x | Base. |
y | exponent. |
|
inlinestatic |
SIMD pow(x,y). Double precision SIMD data, single accuracy.
This returns x^y for SIMD values.
opt | If this is changed from the default (safe) into the unsafe option, there are no guarantees about correct results for x==0. |
x | Base. |
y | exponent. |
|
inlinestatic |
SIMD pow(x,y), only targeting single accuracy.
This returns x^y for SIMD values.
opt | If this is changed from the default (safe) into the unsafe option, there are no guarantees about correct results for x==0. |
x | Base. |
y | exponent. |
|
inlinestatic |
SIMD float 1.0/x lookup.
This is a low-level instruction that should only be called from routines implementing the reciprocal in simd_math.h.
x | Argument, x!=0 |
|
inlinestatic |
SIMD double 1.0/x lookup.
This is a low-level instruction that should only be called from routines implementing the reciprocal in simd_math.h.
x | Argument, x!=0 |
|
inlinestatic |
Perform one Newton-Raphson iteration to improve 1/x for SIMD float.
This is a low-level routine that should only be used by SIMD math routine that evaluates the reciprocal.
lu | Approximation of 1/x, typically obtained from lookup. |
x | The reference (starting) value x for which we want 1/x. |
|
inlinestatic |
Perform one Newton-Raphson iteration to improve 1/x for SIMD double.
This is a low-level routine that should only be used by SIMD math routine that evaluates the reciprocal.
lu | Approximation of 1/x, typically obtained from lookup. |
x | The reference (starting) value x for which we want 1/x. |
|
inlinestatic |
Return sum of all elements in SIMD4 float variable.
a | SIMD4 variable to reduce/sum. |
|
inlinestatic |
Return sum of all elements in SIMD4 double variable.
a | SIMD4 variable to reduce/sum. |
|
inlinestatic |
Return sum of all elements in SIMD float variable.
a | SIMD variable to reduce/sum. |
|
inlinestatic |
Return sum of all elements in SIMD double variable.
a | SIMD variable to reduce/sum. |
|
inlinestatic |
Reduce each of four SIMD doubles, add those values to four consecutive doubles in memory, return sum.
m | Pointer to memory where four doubles should be incremented |
v0 | SIMD variable whose sum should be added to m[0] |
v1 | SIMD variable whose sum should be added to m[1] |
v2 | SIMD variable whose sum should be added to m[2] |
v3 | SIMD variable whose sum should be added to m[3] |
The pointer m must be aligned to the smaller of four elements and the floating-point SIMD width.
|
inlinestatic |
Reduce each of four SIMD floats, add those values to four consecutive floats in memory, return sum.
m | Pointer to memory where four floats should be incremented |
v0 | SIMD variable whose sum should be added to m[0] |
v1 | SIMD variable whose sum should be added to m[1] |
v2 | SIMD variable whose sum should be added to m[2] |
v3 | SIMD variable whose sum should be added to m[3] |
The pointer m must be aligned to the smaller of four elements and the floating-point SIMD width.
|
inlinestatic |
Reduce the 4 half-SIMD-with doubles in 2 SIMD variables (sum halves), increment four consecutive doubles in memory, return sum.
m | Pointer to memory where the four values should be incremented |
v0 | Variable whose half-SIMD sums should be added to m[0]/m[1], respectively. |
v1 | Variable whose half-SIMD sums should be added to m[2]/m[3], respectively. |
The pointer m must be aligned, but only to the smaller of four elements and the floating-point SIMD width.
Available if GMX_SIMD_HAVE_HSIMD_UTIL_DOUBLE is 1.
|
inlinestatic |
Reduce the 4 half-SIMD-with floats in 2 SIMD variables (sum halves), increment four consecutive floats in memory, return sum.
m | Pointer to memory where the four values should be incremented |
v0 | Variable whose half-SIMD sums should be added to m[0]/m[1], respectively. |
v1 | Variable whose half-SIMD sums should be added to m[2]/m[3], respectively. |
The pointer m must be aligned, but only to the smaller of four elements and the floating-point SIMD width.
Available if GMX_SIMD_HAVE_HSIMD_UTIL_FLOAT is 1.
|
inlinestatic |
SIMD4 Round to nearest integer value (in floating-point format).
a | Any floating-point value |
|
inlinestatic |
SIMD4 Round to nearest integer value (in floating-point format).
a | Any floating-point value |
|
inlinestatic |
SIMD float round to nearest integer value (in floating-point format).
a | Any floating-point value |
|
inlinestatic |
SIMD double round to nearest integer value (in floating-point format).
a | Any floating-point value |
|
inlinestatic |
SIMD4 1.0/sqrt(x) lookup.
This is a low-level instruction that should only be called from routines implementing the inverse square root in simd_math.h.
x | Argument, x>0 |
|
inlinestatic |
SIMD4 1.0/sqrt(x) lookup.
This is a low-level instruction that should only be called from routines implementing the inverse square root in simd_math.h.
x | Argument, x>0 |
|
inlinestatic |
SIMD float 1.0/sqrt(x) lookup.
This is a low-level instruction that should only be called from routines implementing the inverse square root in simd_math.h.
x | Argument, x>0 |
|
inlinestatic |
double SIMD 1.0/sqrt(x) lookup.
This is a low-level instruction that should only be called from routines implementing the inverse square root in simd_math.h.
x | Argument, x>0 |
|
inlinestatic |
Perform one Newton-Raphson iteration to improve 1/sqrt(x) for SIMD float.
This is a low-level routine that should only be used by SIMD math routine that evaluates the inverse square root.
lu | Approximation of 1/sqrt(x), typically obtained from lookup. |
x | The reference (starting) value x for which we want 1/sqrt(x). |
|
inlinestatic |
Perform one Newton-Raphson iteration to improve 1/sqrt(x) for SIMD double.
This is a low-level routine that should only be used by SIMD math routine that evaluates the inverse square root.
lu | Approximation of 1/sqrt(x), typically obtained from lookup. |
x | The reference (starting) value x for which we want 1/sqrt(x). |
|
inlinestatic |
Perform one Newton-Raphson iteration to improve 1/sqrt(x) for SIMD4 float.
This is a low-level routine that should only be used by SIMD math routine that evaluates the inverse square root.
lu | Approximation of 1/sqrt(x), typically obtained from lookup. |
x | The reference (starting) value x for which we want 1/sqrt(x). |
|
inlinestatic |
Perform one Newton-Raphson iteration to improve 1/sqrt(x) for SIMD4 double.
This is a low-level routine that should only be used by SIMD math routine that evaluates the inverse square root.
lu | Approximation of 1/sqrt(x), typically obtained from lookup. |
x | The reference (starting) value x for which we want 1/sqrt(x). |
|
inlinestatic |
Select from single precision SIMD4 variable where boolean is true.
a | Floating-point variable to select from |
mask | Boolean selector |
|
inlinestatic |
Select from single precision SIMD4 variable where boolean is true.
a | Floating-point variable to select from |
mask | Boolean selector |
|
inlinestatic |
Select from single precision SIMD variable where boolean is true.
a | Floating-point variable to select from |
mask | Boolean selector |
|
inlinestatic |
Select from double precision SIMD variable where boolean is true.
a | Floating-point variable to select from |
mask | Boolean selector |
|
inlinestatic |
Select from gmx::SimdFInt32 variable where boolean is true.
Available if GMX_SIMD_HAVE_FINT32_ARITHMETICS is 1.
a | SIMD integer to select from |
mask | Boolean selector |
|
inlinestatic |
Select from gmx::SimdDInt32 variable where boolean is true.
Available if GMX_SIMD_HAVE_DINT32_ARITHMETICS is 1.
a | SIMD integer to select from |
mask | Boolean selector |
|
inlinestatic |
Select from single precision SIMD4 variable where boolean is false.
a | Floating-point variable to select from |
mask | Boolean selector |
|
inlinestatic |
Select from single precision SIMD4 variable where boolean is false.
a | Floating-point variable to select from |
mask | Boolean selector |
|
inlinestatic |
Select from single precision SIMD variable where boolean is false.
a | Floating-point variable to select from |
mask | Boolean selector |
|
inlinestatic |
Select from double precision SIMD variable where boolean is false.
a | Floating-point variable to select from |
mask | Boolean selector |
|
inlinestatic |
Select from gmx::SimdFInt32 variable where boolean is false.
Available if GMX_SIMD_HAVE_FINT32_ARITHMETICS is 1.
a | SIMD integer to select from |
mask | Boolean selector |
|
inlinestatic |
Select from gmx::SimdDInt32 variable where boolean is false.
Available if GMX_SIMD_HAVE_DINT32_ARITHMETICS is 1.
a | SIMD integer to select from |
mask | Boolean selector |
Simd4Real gmx::test::setSimd4RealFrom1R | ( | real | value | ) |
Set SIMD4 register contents from single real value.
All elements is set from the given value. This is effectively the same operation as simd4Set1(), but is implemented using only load/store operations that have been tested separately in the bootstrapping tests.
Set SIMD4 register contents from three real values.
It might seem stupid to use three values when we know that the SIMD4 width is 4, but it simplifies the test organization when the SIMD and SIMD4 tests are completely symmetric.
SimdInt32 gmx::test::setSimdIntFrom1I | ( | int | value | ) |
Set SIMD register contents from single integer value.
All elements is set from the given value. This is effectively the same operation as simdSet1I(), but is implemented using only load/store operations that have been tested separately in the bootstrapping tests.
SimdInt32 gmx::test::setSimdIntFrom3I | ( | int | i0, |
int | i1, | ||
int | i2 | ||
) |
Set SIMD register contents from three int values.
Our reason for using three values is that 3 is not a factor in any known SIMD width, so this way there will not be any simple repeated patterns e.g. between the low/high 64/128/256 bits in the SIMD register, which could hide bugs.
SimdReal gmx::test::setSimdRealFrom1R | ( | real | value | ) |
Set SIMD register contents from single real value.
All elements is set from the given value. This is effectively the same operation as simdSet1(), but is implemented using only load/store operations that have been tested separately in the bootstrapping tests.
Set SIMD register contents from three real values.
Our reason for using three values is that 3 is not a factor in any known SIMD width, so this way there will not be any simple repeated patterns e.g. between the low/high 64/128/256 bits in the SIMD register, which could hide bugs.
|
inlinestatic |
Set all SIMD double variable elements to 0.0.
You should typically just call gmx::setZero(), which uses proxy objects internally to handle all types rather than adding the suffix used here.
|
inlinestatic |
Set all SIMD (double) integer variable elements to 0.
You should typically just call gmx::setZero(), which uses proxy objects internally to handle all types rather than adding the suffix used here.
|
inlinestatic |
Set all SIMD float variable elements to 0.0.
You should typically just call gmx::setZero(), which uses proxy objects internally to handle all types rather than adding the suffix used here.
|
inlinestatic |
Set all SIMD (float) integer variable elements to 0.
You should typically just call gmx::setZero(), which uses proxy objects internally to handle all types rather than adding the suffix used here.
std::vector< real > gmx::test::simd4Real2Vector | ( | Simd4Real | simd4 | ) |
Convert SIMD4 real to std::vector<real>.
The returned vector will have the same length as the SIMD4 width.
|
inlinestatic |
Set all SIMD4 double elements to 0.
You should typically just call gmx::setZero(), which uses proxy objects internally to handle all types rather than adding the suffix used here.
|
inlinestatic |
Set all SIMD4 float elements to 0.
You should typically just call gmx::setZero(), which uses proxy objects internally to handle all types rather than adding the suffix used here.
std::vector< std::int32_t > gmx::test::simdInt2Vector | ( | SimdInt32 | simd | ) |
Convert SIMD integer to std::vector<int>.
The returned vector will have the same length as the SIMD width.
|
inlinestatic |
Load GMX_SIMD_FLOAT_WIDTH float numbers from aligned memory.
m | Pointer to memory aligned to the SIMD width. |
|
inlinestatic |
Load GMX_SIMD_DOUBLE_WIDTH numbers from aligned memory.
m | Pointer to memory aligned to the SIMD width. |
|
inlinestatic |
Load aligned SIMD integer data, width corresponds to gmx::SimdFloat.
You should typically just call gmx::load(), which uses proxy objects internally to handle all types rather than adding the suffix used here.
m | Pointer to memory, aligned to (float) integer SIMD width. |
|
inlinestatic |
Load aligned SIMD integer data, width corresponds to gmx::SimdDouble.
You should typically just call gmx::load(), which uses proxy objects internally to handle all types rather than adding the suffix used here.
m | Pointer to memory, aligned to (double) integer SIMD width. |
|
inlinestatic |
Load SIMD float from unaligned memory.
Available if GMX_SIMD_HAVE_LOADU is 1.
m | Pointer to memory, no alignment requirement. |
|
inlinestatic |
Load SIMD double from unaligned memory.
Available if GMX_SIMD_HAVE_LOADU is 1.
m | Pointer to memory, no alignment requirement. |
|
inlinestatic |
Load unaligned integer SIMD data, width corresponds to gmx::SimdFloat.
You should typically just call gmx::loadU(), which uses proxy objects internally to handle all types rather than adding the suffix used here.
Available if GMX_SIMD_HAVE_LOADU is 1.
m | Pointer to memory, no alignment requirements. |
|
inlinestatic |
Load unaligned integer SIMD data, width corresponds to gmx::SimdDouble.
You should typically just call gmx::loadU(), which uses proxy objects internally to handle all types rather than adding the suffix used here.
Available if GMX_SIMD_HAVE_LOADU is 1.
m | Pointer to memory, no alignment requirements. |
std::vector< real > gmx::test::simdReal2Vector | ( | SimdReal | simd | ) |
Convert SIMD real to std::vector<real>.
The returned vector will have the same length as the SIMD width.
|
inlinestatic |
SIMD float sin(x).
x | The argument to evaluate sin for |
|
inlinestatic |
SIMD double sin(x).
x | The argument to evaluate sin for |
|
inlinestatic |
SIMD float sin & cos.
x | The argument to evaluate sin/cos for | |
[out] | sinval | Sin(x) |
[out] | cosval | Cos(x) |
This version achieves close to machine precision, but for very large magnitudes of the argument we inherently begin to lose accuracy due to the argument reduction, despite using extended precision arithmetics internally.
|
inlinestatic |
SIMD double sin & cos.
x | The argument to evaluate sin/cos for | |
[out] | sinval | Sin(x) |
[out] | cosval | Cos(x) |
This version achieves close to machine precision, but for very large magnitudes of the argument we inherently begin to lose accuracy due to the argument reduction, despite using extended precision arithmetics internally.
|
inlinestatic |
SIMD sin & cos. Double precision SIMD data, single accuracy.
x | The argument to evaluate sin/cos for | |
[out] | sinval | Sin(x) |
[out] | cosval | Cos(x) |
|
inlinestatic |
SIMD float sin & cos, only targeting single accuracy.
x | The argument to evaluate sin/cos for | |
[out] | sinval | Sin(x) |
[out] | cosval | Cos(x) |
|
inlinestatic |
SIMD sin(x). Double precision SIMD data, single accuracy.
x | The argument to evaluate sin for |
|
inlinestatic |
SIMD float sin(x), only targeting single accuracy.
x | The argument to evaluate sin for |
|
inlinestatic |
Calculate sqrt(x) for SIMD floats.
opt | By default, this function checks if the input value is 0.0 and masks this to return the correct result. If you are certain your argument will never be zero, and you know you need to save every single cycle you can, you can alternatively call the function as sqrt<MathOptimization::Unsafe>(x). |
x | Argument that must be in range 0 <=x <= GMX_FLOAT_MAX, since the lookup step often has to be implemented in single precision. Arguments smaller than GMX_FLOAT_MIN will always lead to a zero result, even in double precision. If you are using the unsafe math optimization parameter, the argument must be in the range GMX_FLOAT_MIN <= x <= GMX_FLOAT_MAX. |
|
inlinestatic |
Calculate sqrt(x) for SIMD doubles.
opt | By default, this function checks if the input value is 0.0 and masks this to return the correct result. If you are certain your argument will never be zero, and you know you need to save every single cycle you can, you can alternatively call the function as sqrt<MathOptimization::Unsafe>(x). |
x | Argument that must be in range 0 <=x <= GMX_FLOAT_MAX, since the lookup step often has to be implemented in single precision. Arguments smaller than GMX_FLOAT_MIN will always lead to a zero result, even in double precision. If you are using the unsafe math optimization parameter, the argument must be in the range GMX_FLOAT_MIN <= x <= GMX_FLOAT_MAX. |
|
inlinestatic |
Calculate sqrt(x) (correct for 0.0) for SIMD double, with single accuracy.
opt | By default, this function checks if the input value is 0.0 and masks this to return the correct result. If you are certain your argument will never be zero, and you know you need to save every single cycle you can, you can alternatively call the function as sqrt<MathOptimization::Unsafe>(x). |
x | Argument that must be in range 0 <=x <= GMX_FLOAT_MAX, since the lookup step often has to be implemented in single precision. Arguments smaller than GMX_FLOAT_MIN will always lead to a zero result, even in double precision. If you are using the unsafe math optimization parameter, the argument must be in the range GMX_FLOAT_MIN <= x <= GMX_FLOAT_MAX. |
|
inlinestatic |
Calculate sqrt(x) for SIMD float, always targeting single accuracy.
opt | By default, this function checks if the input value is 0.0 and masks this to return the correct result. If you are certain your argument will never be zero, and you know you need to save every single cycle you can, you can alternatively call the function as sqrt<MathOptimization::Unsafe>(x). |
x | Argument that must be in range 0 <=x <= GMX_FLOAT_MAX, since the lookup step often has to be implemented in single precision. Arguments smaller than GMX_FLOAT_MIN will always lead to a zero result, even in double precision. If you are using the unsafe math optimization parameter, the argument must be in the range GMX_FLOAT_MIN <= x <= GMX_FLOAT_MAX. |
|
inlinestatic |
Store the contents of SIMD float variable to aligned memory m.
[out] | m | Pointer to memory, aligned to SIMD width. |
a | SIMD variable to store |
|
inlinestatic |
Store the contents of SIMD double variable to aligned memory m.
[out] | m | Pointer to memory, aligned to SIMD width. |
a | SIMD variable to store |
|
inlinestatic |
Store aligned SIMD integer data, width corresponds to gmx::SimdFloat.
m | Memory aligned to (float) integer SIMD width. |
a | SIMD variable to store. |
|
inlinestatic |
Store aligned SIMD integer data, width corresponds to gmx::SimdDouble.
m | Memory aligned to (double) integer SIMD width. |
a | SIMD (double) integer variable to store. |
|
inlinestatic |
Store the contents of SIMD4 float to aligned memory m.
[out] | m | Pointer to memory, aligned to 4 elements. |
a | SIMD4 variable to store |
|
inlinestatic |
Store the contents of SIMD4 double to aligned memory m.
[out] | m | Pointer to memory, aligned to 4 elements. |
a | SIMD4 variable to store |
|
inlinestatic |
Store SIMD4 double to unaligned memory.
Available if GMX_SIMD_HAVE_STOREU is 1.
[out] | m | Pointer to memory, no alignment requirement. |
a | SIMD4 variable to store. |
|
inlinestatic |
Store SIMD4 float to unaligned memory.
Available if GMX_SIMD_HAVE_STOREU is 1.
[out] | m | Pointer to memory, no alignment requirement. |
a | SIMD4 variable to store. |
|
inlinestatic |
Store low & high parts of SIMD double to different locations.
m0 | Pointer to memory aligned to half SIMD width. |
m1 | Pointer to memory aligned to half SIMD width. |
a | SIMD variable. Low half should be stored to m0, high to m1. |
Available if GMX_SIMD_HAVE_HSIMD_UTIL_DOUBLE is 1.
|
inlinestatic |
Store low & high parts of SIMD float to different locations.
m0 | Pointer to memory aligned to half SIMD width. |
m1 | Pointer to memory aligned to half SIMD width. |
a | SIMD variable. Low half should be stored to m0, high to m1. |
Available if GMX_SIMD_HAVE_HSIMD_UTIL_FLOAT is 1.
|
inlinestatic |
Store SIMD float to unaligned memory.
Available if GMX_SIMD_HAVE_STOREU is 1.
[out] | m | Pointer to memory, no alignment requirement. |
a | SIMD variable to store. |
|
inlinestatic |
Store SIMD double to unaligned memory.
Available if GMX_SIMD_HAVE_STOREU is 1.
[out] | m | Pointer to memory, no alignment requirement. |
a | SIMD variable to store. |
|
inlinestatic |
Store unaligned SIMD integer data, width corresponds to gmx::SimdFloat.
Available if GMX_SIMD_HAVE_STOREU is 1.
m | Memory pointer, no alignment requirements. |
a | SIMD variable to store. |
|
inlinestatic |
Store unaligned SIMD integer data, width corresponds to gmx::SimdDouble.
Available if GMX_SIMD_HAVE_STOREU is 1.
m | Memory pointer, no alignment requirements. |
a | SIMD (double) integer variable to store. |
|
inlinestatic |
SIMD float tan(x).
x | The argument to evaluate tan for |
|
inlinestatic |
SIMD double tan(x).
x | The argument to evaluate tan for |
|
inlinestatic |
SIMD tan(x). Double precision SIMD data, single accuracy.
x | The argument to evaluate tan for |
|
inlinestatic |
SIMD float tan(x), only targeting single accuracy.
x | The argument to evaluate tan for |
|
inlinestatic |
Return true if any bits are set in the single precision SIMD.
This function is used to handle bitmasks, mainly for exclusions in the inner kernels. Note that it will return true even for -0.0F (sign bit set), so it is not identical to not-equal.
a | value |
|
inlinestatic |
Return true if any bits are set in the single precision SIMD.
This function is used to handle bitmasks, mainly for exclusions in the inner kernels. Note that it will return true even for -0.0 (sign bit set), so it is not identical to not-equal.
a | value |
|
inlinestatic |
Check if any bit is set in each element.
Available if GMX_SIMD_HAVE_FINT32_ARITHMETICS is 1.
a | SIMD integer |
|
inlinestatic |
Check if any bit is set in each element.
Available if GMX_SIMD_HAVE_DINT32_ARITHMETICS is 1.
a | SIMD integer |
|
inlinestatic |
SIMD4 float transpose.
[in,out] | v0 | Row 0 on input, column 0 on output |
[in,out] | v1 | Row 1 on input, column 1 on output |
[in,out] | v2 | Row 2 on input, column 2 on output |
[in,out] | v3 | Row 3 on input, column 3 on output |
|
inlinestatic |
SIMD4 double transpose.
[in,out] | v0 | Row 0 on input, column 0 on output |
[in,out] | v1 | Row 1 on input, column 1 on output |
[in,out] | v2 | Row 2 on input, column 2 on output |
[in,out] | v3 | Row 3 on input, column 3 on output |
|
inlinestatic |
Transpose and subtract 3 SIMD doubles to 3 consecutive addresses at GMX_SIMD_DOUBLE_WIDTH offsets.
align | Alignment of the memory to which we write, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 3 for this routine) the output data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are decremented. |
[out] | base | Pointer to start of memory. |
offset | Aligned array with offsets to the start of each triplet. | |
v0 | 1st component, subtracted from base[align*offset[i]] | |
v1 | 2nd component, subtracted from base[align*offset[i]+1] | |
v2 | 3rd component, subtracted from base[align*offset[i]+2] |
This function can work with both aligned (better performance) and unaligned memory. When the align parameter is not a power-of-two (align==3 would be normal for packed atomic coordinates) the memory obviously cannot be aligned, and we account for this. However, in the case where align is a power-of-two, we assume the base pointer also has the same alignment, which will enable many platforms to use faster aligned memory load/store operations. An easy way to think of this is that each triplet of data in memory must be aligned to the align parameter you specify when it's a power-of-two.
The offset memory must always be aligned to GMX_SIMD_FINT32_WIDTH, since this enables us to use SIMD loads and gather operations on platforms that support it.
|
inlinestatic |
Transpose and subtract 3 SIMD floats to 3 consecutive addresses at GMX_SIMD_FLOAT_WIDTH offsets.
align | Alignment of the memory to which we write, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 3 for this routine) the output data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are decremented. |
[out] | base | Pointer to start of memory. |
offset | Aligned array with offsets to the start of each triplet. | |
v0 | 1st component, subtracted from base[align*offset[i]] | |
v1 | 2nd component, subtracted from base[align*offset[i]+1] | |
v2 | 3rd component, subtracted from base[align*offset[i]+2] |
This function can work with both aligned (better performance) and unaligned memory. When the align parameter is not a power-of-two (align==3 would be normal for packed atomic coordinates) the memory obviously cannot be aligned, and we account for this. However, in the case where align is a power-of-two, we assume the base pointer also has the same alignment, which will enable many platforms to use faster aligned memory load/store operations. An easy way to think of this is that each triplet of data in memory must be aligned to the align parameter you specify when it's a power-of-two.
The offset memory must always be aligned to GMX_SIMD_FINT32_WIDTH, since this enables us to use SIMD loads and gather operations on platforms that support it.
|
inlinestatic |
Transpose and add 3 SIMD doubles to 3 consecutive addresses at GMX_SIMD_DOUBLE_WIDTH offsets.
align | Alignment of the memory to which we write, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 3 for this routine) the output data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are incremented. |
[out] | base | Pointer to the start of the memory area |
offset | Aligned array with offsets to the start of each triplet. | |
v0 | 1st component of triplets, added to base[align*offset[i]]. | |
v1 | 2nd component of triplets, added to base[align*offset[i] + 1]. | |
v2 | 3rd component of triplets, added to base[align*offset[i] + 2]. |
This function can work with both aligned (better performance) and unaligned memory. When the align parameter is not a power-of-two (align==3 would be normal for packed atomic coordinates) the memory obviously cannot be aligned, and we account for this. However, in the case where align is a power-of-two, we assume the base pointer also has the same alignment, which will enable many platforms to use faster aligned memory load/store operations. An easy way to think of this is that each triplet of data in memory must be aligned to the align parameter you specify when it's a power-of-two.
The offset memory must always be aligned to GMX_SIMD_FINT32_WIDTH, since this enables us to use SIMD loads and gather operations on platforms that support it.
|
inlinestatic |
Transpose and add 3 SIMD floats to 3 consecutive addresses at GMX_SIMD_FLOAT_WIDTH offsets.
align | Alignment of the memory to which we write, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 3 for this routine) the output data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are incremented. |
[out] | base | Pointer to the start of the memory area |
offset | Aligned array with offsets to the start of each triplet. | |
v0 | 1st component of triplets, added to base[align*offset[i]]. | |
v1 | 2nd component of triplets, added to base[align*offset[i] + 1]. | |
v2 | 3rd component of triplets, added to base[align*offset[i] + 2]. |
This function can work with both aligned (better performance) and unaligned memory. When the align parameter is not a power-of-two (align==3 would be normal for packed atomic coordinates) the memory obviously cannot be aligned, and we account for this. However, in the case where align is a power-of-two, we assume the base pointer also has the same alignment, which will enable many platforms to use faster aligned memory load/store operations. An easy way to think of this is that each triplet of data in memory must be aligned to the align parameter you specify when it's a power-of-two.
The offset memory must always be aligned to GMX_SIMD_FINT32_WIDTH, since this enables us to use SIMD loads and gather operations on platforms that support it.
|
inlinestatic |
Transpose and store 3 SIMD doubles to 3 consecutive addresses at GMX_SIMD_DOUBLE_WIDTH offsets.
align | Alignment of the memory to which we write, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 3 for this routine) the output data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are written. |
[out] | base | Pointer to the start of the memory area |
offset | Aligned array with offsets to the start of each triplet. | |
v0 | 1st component of triplets, written to base[align*offset[i]]. | |
v1 | 2nd component of triplets, written to base[align*offset[i] + 1]. | |
v2 | 3rd component of triplets, written to base[align*offset[i] + 2]. |
This function can work with both aligned (better performance) and unaligned memory. When the align parameter is not a power-of-two (align==3 would be normal for packed atomic coordinates) the memory obviously cannot be aligned, and we account for this. However, in the case where align is a power-of-two, we assume the base pointer also has the same alignment, which will enable many platforms to use faster aligned memory store operations. An easy way to think of this is that each triplet of data in memory must be aligned to the align parameter you specify when it's a power-of-two.
The offset memory must always be aligned to GMX_SIMD_FINT32_WIDTH, since this enables us to use SIMD loads and gather operations on platforms that support it.
|
inlinestatic |
Transpose and store 3 SIMD floats to 3 consecutive addresses at GMX_SIMD_FLOAT_WIDTH offsets.
align | Alignment of the memory to which we write, i.e. distance (measured in elements, not bytes) between index points. When this is identical to the number of SIMD variables (i.e., 3 for this routine) the output data is packed without padding in memory. See the SIMD parameters for exactly what memory positions are written. |
[out] | base | Pointer to the start of the memory area |
offset | Aligned array with offsets to the start of each triplet. | |
v0 | 1st component of triplets, written to base[align*offset[i]]. | |
v1 | 2nd component of triplets, written to base[align*offset[i] + 1]. | |
v2 | 3rd component of triplets, written to base[align*offset[i] + 2]. |
This function can work with both aligned (better performance) and unaligned memory. When the align parameter is not a power-of-two (align==3 would be normal for packed atomic coordinates) the memory obviously cannot be aligned, and we account for this. However, in the case where align is a power-of-two, we assume the base pointer also has the same alignment, which will enable many platforms to use faster aligned memory store operations. An easy way to think of this is that each triplet of data in memory must be aligned to the align parameter you specify when it's a power-of-two.
The offset memory must always be aligned to GMX_SIMD_FINT32_WIDTH, since this enables us to use SIMD loads and gather operations on platforms that support it.
|
inlinestatic |
Truncate SIMD4, i.e. round towards zero - common hardware instruction.
a | Any floating-point value |
|
inlinestatic |
Truncate SIMD4, i.e. round towards zero - common hardware instruction.
a | Any floating-point value |
|
inlinestatic |
Truncate SIMD float, i.e. round towards zero - common hardware instruction.
a | Any floating-point value |
|
inlinestatic |
Truncate SIMD double, i.e. round towards zero - common hardware instruction.
a | Any floating-point value |
Simd4Real gmx::test::vector2Simd4Real | ( | const std::vector< real > & | v | ) |
Return floating-point SIMD4 value from std::vector<real>.
If the vector is longer than SIMD4 width, only the first elements will be used. If it is shorter, the contents will be repeated to fill the SIMD4 register.
SimdInt32 gmx::test::vector2SimdInt | ( | const std::vector< std::int32_t > & | v | ) |
Return 32-bit integer SIMD value from std::vector<int>.
If the vector is longer than SIMD width, only the first elements will be used. If it is shorter, the contents will be repeated to fill the SIMD register.
SimdReal gmx::test::vector2SimdReal | ( | const std::vector< real > & | v | ) |
Return floating-point SIMD value from std::vector<real>.
If the vector is longer than SIMD width, only the first elements will be used. If it is shorter, the contents will be repeated to fill the SIMD register.
|
static |
Best alignment to use for aligned pairs of double data.
The routines to load and transpose data will work with a wide range of alignments, but some might be faster than others, depending on the load instructions available in the hardware. This specifies the best alignment for each implementation when working with pairs of data.
To allow each architecture to use the most optimal form, we use a constant that code outside the SIMD module should use to store things properly. It must be at least 2. For example, a value of 2 means the two parameters A & B are stored as [A0 B0 A1 B1] while align-4 means [A0 B0 - - A1 B1 - -].
This alignment depends on the efficiency of partial-register load/store operations, and will depend on the architecture.
|
static |
Best alignment to use for aligned pairs of float data.
The routines to load and transpose data will work with a wide range of alignments, but some might be faster than others, depending on the load instructions available in the hardware. This specifies the best alignment for each implementation when working with pairs of data.
To allow each architecture to use the most optimal form, we use a constant that code outside the SIMD module should use to store things properly. It must be at least 2. For example, a value of 2 means the two parameters A & B are stored as [A0 B0 A1 B1] while align-4 means [A0 B0 - - A1 B1 - -].
This alignment depends on the efficiency of partial-register load/store operations, and will depend on the architecture.
const Simd4Real gmx::test::rSimd4_m3p75 = setSimd4RealFrom1R(-3.75) |
Negative value that rounds down.
const SimdReal gmx::test::rSimd_Exp |
Three large floating-point values whose exponents are >32.
const SimdReal gmx::test::rSimd_m3p75 = setSimdRealFrom1R(-3.75) |
Negative value that rounds down.
|
static |
Number of test points to use, settable on command line.