---
src/util/rounding.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/util/rounding.h b/src/util/rounding.h
index afb38fb..8a3e630 100644
--- a/src/util/rounding.h
+++ b/src/util/rounding.h
@@ -112,6 +112,20 @@ _mesa_lroundevenf(float x)
* \brief Rounds \c x to the nearest integer, with ties to the even integer,
* and returns the value as a long int.
*/
+static inline long long
+_mesa_llroundevenf(float x)
+{
+#if defined __x86_64__ && LONG_BIT == 64
+ return _mm_cvtss_si64(_mm_load_ss(&x));
+#else
+ return llrintf(x);
+#endif
+}
+
+/**
+ * \brief Rounds \c x to the nearest integer, with ties to the even integer,
+ * and returns the value as a long int.
+ */
static inline long
_mesa_lroundeven(double x)
{
--
2.7.3
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev