* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline void
-store(float *m, float a)
+static inline void store(float* m, float a)
{
*m = a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline void
-storeU(float *m, float a)
+static inline void storeU(float* m, float a)
{
*m = a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-fma(float a, float b, float c)
+static inline float fma(float a, float b, float c)
{
// Note that we purposely do not use the single-rounding std::fma
// as that can be very slow without hardware support
- return a*b + c;
+ return a * b + c;
}
/*! \brief Float Fused-multiply-subtract. Result is a*b - c.
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-fms(float a, float b, float c)
+static inline float fms(float a, float b, float c)
{
- return a*b - c;
+ return a * b - c;
}
/*! \brief Float Fused-negated-multiply-add. Result is -a*b + c.
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-fnma(float a, float b, float c)
+static inline float fnma(float a, float b, float c)
{
- return c - a*b;
+ return c - a * b;
}
/*! \brief Float Fused-negated-multiply-subtract. Result is -a*b - c.
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-fnms(float a, float b, float c)
+static inline float fnms(float a, float b, float c)
{
- return -a*b - c;
+ return -a * b - c;
}
/*! \brief Add two float variables, masked version.
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-maskAdd(float a, float b, float m)
+static inline float maskAdd(float a, float b, float m)
{
return a + (m != 0.0F ? b : 0.0F);
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-maskzMul(float a, float b, float m)
+static inline float maskzMul(float a, float b, float m)
{
return m != 0.0F ? (a * b) : 0.0F;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-maskzFma(float a, float b, float c, float m)
+static inline float maskzFma(float a, float b, float c, float m)
{
return m != 0.0F ? (a * b + c) : 0.0F;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-abs(float a)
+static inline float abs(float a)
{
return std::abs(a);
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-max(float a, float b)
+static inline float max(float a, float b)
{
return std::max(a, b);
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-min(float a, float b)
+static inline float min(float a, float b)
{
return std::min(a, b);
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-round(float a)
+static inline float round(float a)
{
return std::round(a);
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-trunc(float a)
+static inline float trunc(float a)
{
return std::trunc(a);
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-reduce(float a)
+static inline float reduce(float a)
{
return a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-andNot(float a, float b)
+static inline float andNot(float a, float b)
{
- union
- {
+ union {
float r;
std::uint32_t i;
} conv1, conv2;
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline bool
-testBits(float a)
+static inline bool testBits(float a)
{
- union
- {
+ union {
std::uint32_t i;
float f;
} conv;
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline bool
-anyTrue(bool a)
+static inline bool anyTrue(bool a)
{
return a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-selectByMask(float a, bool mask)
+static inline float selectByMask(float a, bool mask)
{
return mask ? a : 0.0F;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-selectByNotMask(float a, bool mask)
+static inline float selectByNotMask(float a, bool mask)
{
return mask ? 0.0F : a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-blend(float a, float b, bool sel)
+static inline float blend(float a, float b, bool sel)
{
return sel ? b : a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline std::int32_t
-cvtR2I(float a)
+static inline std::int32_t cvtR2I(float a)
{
return static_cast<std::int32_t>(std::round(a));
};
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline std::int32_t
-cvttR2I(float a)
+static inline std::int32_t cvttR2I(float a)
{
return static_cast<std::int32_t>(std::trunc(a));
};
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline std::int32_t
-cvtI2R(std::int32_t a)
+static inline std::int32_t cvtI2R(std::int32_t a)
{
return a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline void
-store(double *m, double a)
+static inline void store(double* m, double a)
{
*m = a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline void
-storeU(double *m, double a)
+static inline void storeU(double* m, double a)
{
*m = a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-fma(double a, double b, double c)
+static inline double fma(double a, double b, double c)
{
// Note that we purposely do not use the single-rounding std::fma
// as that can be very slow without hardware support
- return a*b + c;
+ return a * b + c;
}
/*! \brief double Fused-multiply-subtract. Result is a*b - c.
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-fms(double a, double b, double c)
+static inline double fms(double a, double b, double c)
{
- return a*b - c;
+ return a * b - c;
}
/*! \brief double Fused-negated-multiply-add. Result is - a*b + c.
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-fnma(double a, double b, double c)
+static inline double fnma(double a, double b, double c)
{
- return c - a*b;
+ return c - a * b;
}
/*! \brief double Fused-negated-multiply-subtract. Result is -a*b - c.
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-fnms(double a, double b, double c)
+static inline double fnms(double a, double b, double c)
{
- return -a*b - c;
+ return -a * b - c;
}
/*! \brief Add two double variables, masked version.
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-maskAdd(double a, double b, double m)
+static inline double maskAdd(double a, double b, double m)
{
return a + (m != 0.0 ? b : 0.0);
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-maskzMul(double a, double b, double m)
+static inline double maskzMul(double a, double b, double m)
{
return m != 0.0 ? (a * b) : 0.0;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-maskzFma(double a, double b, double c, double m)
+static inline double maskzFma(double a, double b, double c, double m)
{
return m != 0.0 ? (a * b + c) : 0.0;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-abs(double a)
+static inline double abs(double a)
{
return std::abs(a);
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-max(double a, double b)
+static inline double max(double a, double b)
{
return std::max(a, b);
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-min(double a, double b)
+static inline double min(double a, double b)
{
return std::min(a, b);
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-round(double a)
+static inline double round(double a)
{
return std::round(a);
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-trunc(double a)
+static inline double trunc(double a)
{
return std::trunc(a);
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-reduce(double a)
+static inline double reduce(double a)
{
return a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-andNot(double a, double b)
+static inline double andNot(double a, double b)
{
- union
- {
+ union {
double r;
std::uint64_t i;
} conv1, conv2;
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline bool
-testBits(double a)
+static inline bool testBits(double a)
{
- union
- {
- std::uint64_t i;
- double f;
+ union {
+ std::uint64_t i;
+ double f;
} conv;
conv.f = a;
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-selectByMask(double a, bool mask)
+static inline double selectByMask(double a, bool mask)
{
return mask ? a : 0.0;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-selectByNotMask(double a, bool mask)
+static inline double selectByNotMask(double a, bool mask)
{
return mask ? 0.0 : a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-blend(double a, double b, bool sel)
+static inline double blend(double a, double b, bool sel)
{
return sel ? b : a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline std::int32_t
-cvtR2I(double a)
+static inline std::int32_t cvtR2I(double a)
{
return static_cast<std::int32_t>(std::round(a));
};
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline std::int32_t
-cvttR2I(double a)
+static inline std::int32_t cvttR2I(double a)
{
return static_cast<std::int32_t>(std::trunc(a));
};
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline double
-cvtF2D(float a)
+static inline double cvtF2D(float a)
{
return a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline float
-cvtD2F(double a)
+static inline float cvtD2F(double a)
{
return a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline void
-store(std::int32_t *m, std::int32_t a)
+static inline void store(std::int32_t* m, std::int32_t a)
{
*m = a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline void
-storeU(std::int32_t *m, std::int32_t a)
+static inline void storeU(std::int32_t* m, std::int32_t a)
{
*m = a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline std::int32_t
-andNot(std::int32_t a, std::int32_t b)
+static inline std::int32_t andNot(std::int32_t a, std::int32_t b)
{
return ~a & b;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline bool
-testBits(std::int32_t a)
+static inline bool testBits(std::int32_t a)
{
return (a != 0);
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline std::int32_t
-selectByMask(std::int32_t a, bool mask)
+static inline std::int32_t selectByMask(std::int32_t a, bool mask)
{
return mask ? a : 0;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline std::int32_t
-selectByNotMask(std::int32_t a, bool mask)
+static inline std::int32_t selectByNotMask(std::int32_t a, bool mask)
{
return mask ? 0 : a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline std::int32_t
-blend(std::int32_t a, std::int32_t b, bool sel)
+static inline std::int32_t blend(std::int32_t a, std::int32_t b, bool sel)
{
return sel ? b : a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline bool
-cvtB2IB(bool a)
+static inline bool cvtB2IB(bool a)
{
return a;
}
* write templated SIMD/non-SIMD code. For clarity it should not be used
* outside such code.
*/
-static inline bool
-cvtIB2B(bool a)
+static inline bool cvtIB2B(bool a)
{
return a;
}