Gromacs
2019
|
#include "config.h"
#include <cmath>
#include <limits>
#include "gromacs/math/utilities.h"
#include "gromacs/simd/simd.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/real.h"
Math functions for SIMD datatypes.
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::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... | |
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... | |
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::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... | |
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::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... | |
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::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... | |
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... | |