[PATCH] pixman: Fix MMX & SSE intrinsics to work with Sun compilers & Solaris

Soeren Sandmann sandmann at daimi.au.dk
Fri Apr 3 07:49:25 PDT 2009


Alan Coopersmith <Alan.Coopersmith at Sun.COM> writes:

> diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
> index caeeafc..71c4aed 100644
> --- a/pixman/pixman-mmx.c
> +++ b/pixman/pixman-mmx.c
> @@ -35,6 +35,12 @@
> 
>  #ifdef USE_MMX
> 
> +#if HAVE_STDINT_H
> +# include <stdint.h>
> +#elif HAVE_INTTYPES_H
> +# include <inttypes.h>
> +#endif
> +
>  #include <mmintrin.h>
> 
>  #include "pixman-mmx.h"
> @@ -71,15 +77,27 @@
>   * possible.
>   */
> 
> -/* --------------- MMX primitivess ------------------------------------ */
> +/* --------------- MMX primitives ------------------------------------- */
> +
> +#if defined UINT64_MAX || defined uint64_t /* from autoconf AC_TYPE_UINT64_T */
> +typedef uint64_t ullong;
> +#elif defined _MSC_VER
> +typedef unsigned __int64 ullong;
> +#else
> +# error "No 64-bit unsigned integer type defined"
> +#endif

Pixman actually includes stdint.h or the equivalent in its public
pixman.h header:

        #if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) ||
                 defined (_sgi) || defined (__sun) || defined (sun) || defined (__digital__)
        #  include <inttypes.h>
        #elif defined (_MSC_VER)
        typedef __int8 int8_t;
        typedef unsigned __int8 uint8_t;
        typedef __int16 int16_t;
        typedef unsigned __int16 uint16_t;
        typedef __int32 int32_t;
        typedef unsigned __int32 uint32_t;
        typedef __int64 int64_t;
        typedef unsigned __int64 uint64_t;
        #elif defined (_AIX)
        #  include <sys/inttypes.h>
        #else
        #  include <stdint.h>
        #endif

so uint64_t can be assumed to be available without any configure
checks. In fact, all the ullong stuff in pixman-mmx could probably be
replaced with uint64_t.

(Including stdint.h in a public header file is admittedly somewhat
crackful, but quite convenient for defining the various fixpoint
types).

This bug:

        http://bugs.freedesktop.org/show_bug.cgi?id=20932

has a less complete patch for the same problem and can be closed when
you push your changes.


Thanks,
Soren


More information about the xorg-devel mailing list