On Wed, Aug 17, 2016 at 10:59 AM, Brian Paul <[email protected]> wrote:
> The lrint() and lrintf() functions are pretty slow and make some
> texture transfers very inefficient.  This patch makes a better effort
> at using those intrisics for 32-bit gcc and MSVC.
>
> Note, this patch doesn't address the use of SSE4.1 with MSVC.
>
> Reviewed-by: José Fonseca <[email protected]>
> ---
>  src/util/rounding.h | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/src/util/rounding.h b/src/util/rounding.h
> index afb38fb..ab55ebb 100644
> --- a/src/util/rounding.h
> +++ b/src/util/rounding.h
> @@ -29,9 +29,11 @@
>  #include <limits.h>
>  #include <stdint.h>
>
> -#ifdef __x86_64__
> +#if defined(__SSE__) || defined(_MSC_VER)
> +/* MSVC always has SSE nowadays */
>  #include <xmmintrin.h>
>  #include <emmintrin.h>
> +#define ROUND_WITH_SSE 1

I wonder why not replace the ifdef __x86_64__ with SSE || _MSC_VER
like you did above.

Either way,

Reviewed-by: Matt Turner <[email protected]>

Also, -fno-math-errno and -fno-trapping-math make various rounding
functions compile to single or very few instructions with gcc. If MSVC
has similar flags, it might be worth enabling them.
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to