[Mesa-dev] [PATCH 1/4] util: Add _mesa_llroundevenf().
Ian Romanick
idr at freedesktop.org
Thu May 26 19:37:59 UTC 2016
On 05/26/2016 11:28 AM, Matt Turner wrote:
> ---
> 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)
Is this used later in the series, and I just missed it?
> +{
> +#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)
> {
>
More information about the mesa-dev
mailing list