/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018,2019,2020, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
return m != 0.0F ? (a * b + c) : 0.0F;
}
+/*! \brief Float 1.0/x, masked version.
+ *
+ * \param x Argument, x>0 for entries where mask is true.
+ * \param m Mask
+ * \return 1/x. The result for masked-out entries will be 0.0.
+ *
+ * \note This function might be superficially meaningless, but it helps us to
+ * write templated SIMD/non-SIMD code. For clarity it should not be used
+ * outside such code.
+ */
+static inline float gmx_simdcall maskzRcp(float x, float m)
+{
+ return m != 0.0F ? 1.0F / x : 0.0F;
+}
+
/*! \brief Float Floating-point abs().
*
* \param a any floating point values
return m != 0.0 ? (a * b + c) : 0.0;
}
+/*! \brief Double 1.0/x, masked version.
+ *
+ * \param x Argument, x>0 for entries where mask is true.
+ * \param m Mask
+ * \return Approximation of 1/x. The result for masked-out entries will be 0.0.
+ *
+ * \note This function might be superficially meaningless, but it helps us to
+ * write templated SIMD/non-SIMD code. For clarity it should not be used
+ * outside such code.
+ */
+static inline double gmx_simdcall maskzRcp(double x, double m)
+{
+ return m != 0.0 ? 1.0 / x : 0.0;
+}
+
/*! \brief double doubleing-point abs().
*
* \param a any doubleing point values