[Pixman] [PATCH] Fix MSVC compilation (only up to three SSE intrinsics supported in function declaration)

Matt Turner mattst88 at gmail.com
Sat May 19 06:59:39 PDT 2012


On Sat, May 19, 2012 at 9:45 AM, Ingmar Runge <ingmar at irsoft.de> wrote:
> From: Ingmar Runge <ingmar at irsoft.de>
>
> ---
>  pixman/pixman-mmx.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
> index 01a2bc9..eb02d1a 100644
> --- a/pixman/pixman-mmx.c
> +++ b/pixman/pixman-mmx.c
> @@ -598,14 +598,14 @@ pack_4xpacked565 (__m64 a, __m64 b)
>  #endif
>  }
>
> +#ifndef _MSC_VER
> +
>  static force_inline __m64
>  pack_4x565 (__m64 v0, __m64 v1, __m64 v2, __m64 v3)
>  {
>     return pack_4xpacked565 (pack8888 (v0, v1), pack8888 (v2, v3));
>  }
>
> -#ifndef _MSC_VER
> -
>  static force_inline __m64
>  pix_add_mul (__m64 x, __m64 a, __m64 y, __m64 b)
>  {
> @@ -617,6 +617,11 @@ pix_add_mul (__m64 x, __m64 a, __m64 y, __m64 b)
>
>  #else
>
> +/* MSVC only handles a "pass by register" of up to three SSE intrinsics */
> +
> +#define pack_4x565(v0, v1, v2, v3) \
> +    pack_4xpacked565 (pack8888 (v0, v1), pack8888 (v2, v3))
> +
>  #define pix_add_mul(x, a, y, b)         \
>     ( x = pix_multiply (x, a),  \
>       y = pix_multiply (y, b),  \
> --
> 1.7.3.4

Hah. Weird. Shouldn't the optimizer inline the function so that it's
not actually passing the arguments to a function before checking such
things? Anyway, thanks for putting the comment in -- I never knew the
purpose of the MSVC pix_add_mul macro.

I'm not sure if we want

#ifndef _MSC_VER
pack_4x565
pix_add_mul
#else
pack_4x565
pix_add_mul
#endif

or if we want

#ifndef _MSC_VER
pack_4x565
#else
pack_4x565
#endif

#ifndef _MSC_VER
pix_add_mul
#else
pix_add_mul
#endif

Soren?


More information about the Pixman mailing list