Gromacs
2018.8
|
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <algorithm>
Scalar float functions corresponding to GROMACS SIMD functions.
These versions make it possible to write functions that are templated with either a SIMD or scalar type. While some of these functions might not appear SIMD-specific, we have placed them here because the only reason to use these instead of generic function is in templated combined SIMD/non-SIMD code.
There are a handful of limitations, in particular that it is impossible to overload the bitwise logical operators on built-in types.
Functions | |
static void | gmx::store (float *m, float a) |
Store contents of float variable to aligned memory m. More... | |
static void | gmx::storeU (float *m, float a) |
Store contents of float variable to unaligned memory m. More... | |
static float | gmx::fma (float a, float b, float c) |
Float Fused-multiply-add. Result is a*b + c. More... | |
static float | gmx::fms (float a, float b, float c) |
Float Fused-multiply-subtract. Result is a*b - c. More... | |
static float | gmx::fnma (float a, float b, float c) |
Float Fused-negated-multiply-add. Result is -a*b + c. More... | |
static float | gmx::fnms (float a, float b, float c) |
Float Fused-negated-multiply-subtract. Result is -a*b - c. More... | |
static float | gmx::maskAdd (float a, float b, float m) |
Add two float variables, masked version. More... | |
static float | gmx::maskzMul (float a, float b, float m) |
Multiply two float variables, masked version. More... | |
static float | gmx::maskzFma (float a, float b, float c, float m) |
Float fused multiply-add, masked version. More... | |
static float | gmx::abs (float a) |
Float Floating-point abs(). More... | |
static float | gmx::max (float a, float b) |
Set each float element to the largest from two variables. More... | |
static float | gmx::min (float a, float b) |
Set each float element to the smallest from two variables. More... | |
static float | gmx::round (float a) |
Float round to nearest integer value (in floating-point format). More... | |
static float | gmx::trunc (float a) |
Truncate float, i.e. round towards zero - common hardware instruction. More... | |
static float | gmx::reduce (float a) |
Return sum of all elements in float variable (i.e., the variable itself). More... | |
static float | gmx::andNot (float a, float b) |
Bitwise andnot for two scalar float variables. More... | |
static bool | gmx::testBits (float a) |
Return true if any bits are set in the float variable. More... | |
static bool | gmx::anyTrue (bool a) |
Returns if the boolean is true. More... | |
static float | gmx::selectByMask (float a, bool mask) |
Select from single precision variable where boolean is true. More... | |
static float | gmx::selectByNotMask (float a, bool mask) |
Select from single precision variable where boolean is false. More... | |
static float | gmx::blend (float a, float b, bool sel) |
Blend float selection. More... | |
static std::int32_t | gmx::cvtR2I (float a) |
Round single precision floating point to integer. More... | |
static std::int32_t | gmx::cvttR2I (float a) |
Truncate single precision floating point to integer. More... | |
static std::int32_t | gmx::cvtI2R (std::int32_t a) |
Return integer. More... | |
static void | gmx::store (double *m, double a) |
Store contents of double variable to aligned memory m. More... | |
static void | gmx::storeU (double *m, double a) |
Store contents of double variable to unaligned memory m. More... | |
static double | gmx::fma (double a, double b, double c) |
double Fused-multiply-add. Result is a*b + c. More... | |
static double | gmx::fms (double a, double b, double c) |
double Fused-multiply-subtract. Result is a*b - c. More... | |
static double | gmx::fnma (double a, double b, double c) |
double Fused-negated-multiply-add. Result is - a*b + c. More... | |
static double | gmx::fnms (double a, double b, double c) |
double Fused-negated-multiply-subtract. Result is -a*b - c. More... | |
static double | gmx::maskAdd (double a, double b, double m) |
Add two double variables, masked version. More... | |
static double | gmx::maskzMul (double a, double b, double m) |
Multiply two double variables, masked version. More... | |
static double | gmx::maskzFma (double a, double b, double c, double m) |
double fused multiply-add, masked version. More... | |
static double | gmx::abs (double a) |
double doubleing-point abs(). More... | |
static double | gmx::max (double a, double b) |
Set each double element to the largest from two variables. More... | |
static double | gmx::min (double a, double b) |
Set each double element to the smallest from two variables. More... | |
static double | gmx::round (double a) |
double round to nearest integer value (in doubleing-point format). More... | |
static double | gmx::trunc (double a) |
Truncate double, i.e. round towards zero - common hardware instruction. More... | |
static double | gmx::reduce (double a) |
Return sum of all elements in double variable (i.e., the variable itself). More... | |
static double | gmx::andNot (double a, double b) |
Bitwise andnot for two scalar double variables. More... | |
static bool | gmx::testBits (double a) |
Return true if any bits are set in the double variable. More... | |
static double | gmx::selectByMask (double a, bool mask) |
Select from double precision variable where boolean is true. More... | |
static double | gmx::selectByNotMask (double a, bool mask) |
Select from double precision variable where boolean is false. More... | |
static double | gmx::blend (double a, double b, bool sel) |
Blend double selection. More... | |
static std::int32_t | gmx::cvtR2I (double a) |
Round single precision doubleing point to integer. More... | |
static std::int32_t | gmx::cvttR2I (double a) |
Truncate single precision doubleing point to integer. More... | |
static double | gmx::cvtF2D (float a) |
Convert float to double (mimicks SIMD conversion) More... | |
static float | gmx::cvtD2F (double a) |
Convert double to float (mimicks SIMD conversion) More... | |
static void | gmx::store (std::int32_t *m, std::int32_t a) |
Store contents of integer variable to aligned memory m. More... | |
static void | gmx::storeU (std::int32_t *m, std::int32_t a) |
Store contents of integer variable to unaligned memory m. More... | |
static std::int32_t | gmx::andNot (std::int32_t a, std::int32_t b) |
Bitwise andnot for two scalar integer variables. More... | |
static bool | gmx::testBits (std::int32_t a) |
Return true if any bits are set in the integer variable. More... | |
static std::int32_t | gmx::selectByMask (std::int32_t a, bool mask) |
Select from integer variable where boolean is true. More... | |
static std::int32_t | gmx::selectByNotMask (std::int32_t a, bool mask) |
Select from integer variable where boolean is false. More... | |
static std::int32_t | gmx::blend (std::int32_t a, std::int32_t b, bool sel) |
Blend integer selection. More... | |
static bool | gmx::cvtB2IB (bool a) |
Just return a boolean (mimicks SIMD real-to-int bool conversions) More... | |
static bool | gmx::cvtIB2B (bool a) |
Just return a boolean (mimicks SIMD int-to-real bool conversions) More... | |