pixman: Branch 'master' - 2 commits

Alan Coopersmith alanc at kemper.freedesktop.org
Sat Apr 4 09:45:58 PDT 2009


 configure.ac                 |   58 +++++++++++-
 pixman/Makefile.am           |    2 
 pixman/pixman-mmx.c          |  199 +++++++++++++++++++------------------------
 pixman/pixman-private.h      |    2 
 pixman/solaris-hwcap.mapfile |   36 +++++++
 5 files changed, 184 insertions(+), 113 deletions(-)

New commits:
commit 179750544d911adf5b01749e33b3ef44a62b0b0e
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Fri Apr 3 13:02:37 2009 -0700

    Replace custom type ullong with standard uint64_t in pixman-mmx.c
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 2d73247..7d0a802 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -73,10 +73,8 @@
 
 /* --------------- MMX primitives ------------------------------------- */
 
-typedef uint64_t ullong;
-
 #ifdef __GNUC__
-typedef ullong mmxdatafield;
+typedef uint64_t mmxdatafield;
 #else
 typedef __m64 mmxdatafield;
 /* If __m64 is defined as a struct or union, define M64_MEMBER to be the
@@ -145,7 +143,7 @@ static const MMXData c =
 #endif
 
 static force_inline __m64
-M64 (ullong x)
+M64 (uint64_t x)
 {
 #ifdef __ICC
     return _mm_cvtsi64_m64 (x);
@@ -159,16 +157,16 @@ M64 (ullong x)
 #endif
 }
 
-static force_inline ullong
-ULLONG (__m64 x)
+static force_inline uint64_t
+UINT64 (__m64 x)
 {
 #ifdef __ICC
     return _mm_cvtm64_si64 (x);
 #elif defined M64_MEMBER	/* __m64 is a struct, not an integral type */
-    ullong res = x.M64_MEMBER;
+    uint64_t res = x.M64_MEMBER;
     return res;
 #else				/* __m64 is an integral type */
-    return (ullong)x;
+    return (uint64_t)x;
 #endif
 }
 
@@ -1046,10 +1044,10 @@ fbCompositeSolid_nx0565mmx (pixman_op_t op,
 
 	while (w && (unsigned long)dst & 7)
 	{
-	    ullong d = *dst;
+	    uint64_t d = *dst;
 	    __m64 vdest = expand565 (M64(d), 0);
 	    vdest = pack565(over(vsrc, vsrca, vdest), vdest, 0);
-	    *dst = ULLONG(vdest);
+	    *dst = UINT64(vdest);
 
 	    w--;
 	    dst++;
@@ -1076,10 +1074,10 @@ fbCompositeSolid_nx0565mmx (pixman_op_t op,
 
 	while (w)
 	{
-	    ullong d = *dst;
+	    uint64_t d = *dst;
 	    __m64 vdest = expand565 (M64(d), 0);
 	    vdest = pack565(over(vsrc, vsrca, vdest), vdest, 0);
-	    *dst = ULLONG(vdest);
+	    *dst = UINT64(vdest);
 
 	    w--;
 	    dst++;
@@ -1504,12 +1502,12 @@ fbCompositeSrc_8888x0565mmx (pixman_op_t op,
 	while (w && (unsigned long)dst & 7)
 	{
 	    __m64 vsrc = load8888 (*src);
-	    ullong d = *dst;
+	    uint64_t d = *dst;
 	    __m64 vdest = expand565 (M64(d), 0);
 
 	    vdest = pack565(over(vsrc, expand_alpha(vsrc), vdest), vdest, 0);
 
-	    *dst = ULLONG(vdest);
+	    *dst = UINT64(vdest);
 
 	    w--;
 	    dst++;
@@ -1547,12 +1545,12 @@ fbCompositeSrc_8888x0565mmx (pixman_op_t op,
 	while (w)
 	{
 	    __m64 vsrc = load8888 (*src);
-	    ullong d = *dst;
+	    uint64_t d = *dst;
 	    __m64 vdest = expand565 (M64(d), 0);
 
 	    vdest = pack565(over(vsrc, expand_alpha(vsrc), vdest), vdest, 0);
 
-	    *dst = ULLONG(vdest);
+	    *dst = UINT64(vdest);
 
 	    w--;
 	    dst++;
@@ -1583,7 +1581,7 @@ fbCompositeSolidMask_nx8x8888mmx (pixman_op_t op,
     int	dstStride, maskStride;
     uint16_t	w;
     __m64	vsrc, vsrca;
-    ullong	srcsrc;
+    uint64_t	srcsrc;
 
     CHECKPOINT();
 
@@ -1593,7 +1591,7 @@ fbCompositeSolidMask_nx8x8888mmx (pixman_op_t op,
     if (srca == 0)
 	return;
 
-    srcsrc = (ullong)src << 32 | src;
+    srcsrc = (uint64_t)src << 32 | src;
 
     fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
     fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1);
@@ -1613,7 +1611,7 @@ fbCompositeSolidMask_nx8x8888mmx (pixman_op_t op,
 
 	while (w && (unsigned long)dst & 7)
 	{
-	    ullong m = *mask;
+	    uint64_t m = *mask;
 
 	    if (m)
 	    {
@@ -1630,13 +1628,13 @@ fbCompositeSolidMask_nx8x8888mmx (pixman_op_t op,
 
 	while (w >= 2)
 	{
-	    ullong m0, m1;
+	    uint64_t m0, m1;
 	    m0 = *mask;
 	    m1 = *(mask + 1);
 
 	    if (srca == 0xff && (m0 & m1) == 0xff)
 	    {
-		*(ullong *)dst = srcsrc;
+		*(uint64_t *)dst = srcsrc;
 	    }
 	    else if (m0 | m1)
 	    {
@@ -1660,7 +1658,7 @@ fbCompositeSolidMask_nx8x8888mmx (pixman_op_t op,
 
 	while (w)
 	{
-	    ullong m = *mask;
+	    uint64_t m = *mask;
 
 	    if (m)
 	    {
@@ -1688,7 +1686,7 @@ pixman_fill_mmx (uint32_t *bits,
 		 int height,
 		 uint32_t xor)
 {
-    ullong	fill;
+    uint64_t	fill;
     __m64	vfill;
     uint32_t	byte_width;
     uint8_t	*byte_line;
@@ -1731,7 +1729,7 @@ pixman_fill_mmx (uint32_t *bits,
 	stride *= 4;
     }
 
-    fill = ((ullong)xor << 32) | xor;
+    fill = ((uint64_t)xor << 32) | xor;
     vfill = M64(fill);
 
 #ifdef __GNUC__
@@ -1854,7 +1852,7 @@ fbCompositeSolidMaskSrc_nx8x8888mmx (pixman_op_t op,
     int	dstStride, maskStride;
     uint16_t	w;
     __m64	vsrc, vsrca;
-    ullong	srcsrc;
+    uint64_t	srcsrc;
 
     CHECKPOINT();
 
@@ -1868,7 +1866,7 @@ fbCompositeSolidMaskSrc_nx8x8888mmx (pixman_op_t op,
 	return;
     }
 
-    srcsrc = (ullong)src << 32 | src;
+    srcsrc = (uint64_t)src << 32 | src;
 
     fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
     fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1);
@@ -1888,7 +1886,7 @@ fbCompositeSolidMaskSrc_nx8x8888mmx (pixman_op_t op,
 
 	while (w && (unsigned long)dst & 7)
 	{
-	    ullong m = *mask;
+	    uint64_t m = *mask;
 
 	    if (m)
 	    {
@@ -1909,13 +1907,13 @@ fbCompositeSolidMaskSrc_nx8x8888mmx (pixman_op_t op,
 
 	while (w >= 2)
 	{
-	    ullong m0, m1;
+	    uint64_t m0, m1;
 	    m0 = *mask;
 	    m1 = *(mask + 1);
 
 	    if (srca == 0xff && (m0 & m1) == 0xff)
 	    {
-		*(ullong *)dst = srcsrc;
+		*(uint64_t *)dst = srcsrc;
 	    }
 	    else if (m0 | m1)
 	    {
@@ -1931,7 +1929,7 @@ fbCompositeSolidMaskSrc_nx8x8888mmx (pixman_op_t op,
 	    }
 	    else
 	    {
-		*(ullong *)dst = 0;
+		*(uint64_t *)dst = 0;
 	    }
 
 	    mask += 2;
@@ -1943,7 +1941,7 @@ fbCompositeSolidMaskSrc_nx8x8888mmx (pixman_op_t op,
 
 	while (w)
 	{
-	    ullong m = *mask;
+	    uint64_t m = *mask;
 
 	    if (m)
 	    {
@@ -1985,7 +1983,7 @@ fbCompositeSolidMask_nx8x0565mmx (pixman_op_t op,
     int	dstStride, maskStride;
     uint16_t	w;
     __m64	vsrc, vsrca, tmp;
-    ullong srcsrcsrcsrc, src16;
+    uint64_t srcsrcsrcsrc, src16;
 
     CHECKPOINT();
 
@@ -2002,10 +2000,10 @@ fbCompositeSolidMask_nx8x0565mmx (pixman_op_t op,
     vsrca = expand_alpha (vsrc);
 
     tmp = pack565(vsrc, _mm_setzero_si64(), 0);
-    src16 = ULLONG(tmp);
+    src16 = UINT64(tmp);
 
-    srcsrcsrcsrc = (ullong)src16 << 48 | (ullong)src16 << 32 |
-	(ullong)src16 << 16 | (ullong)src16;
+    srcsrcsrcsrc = (uint64_t)src16 << 48 | (uint64_t)src16 << 32 |
+	(uint64_t)src16 << 16 | (uint64_t)src16;
 
     while (height--)
     {
@@ -2019,15 +2017,15 @@ fbCompositeSolidMask_nx8x0565mmx (pixman_op_t op,
 
 	while (w && (unsigned long)dst & 7)
 	{
-	    ullong m = *mask;
+	    uint64_t m = *mask;
 
 	    if (m)
 	    {
-		ullong d = *dst;
+		uint64_t d = *dst;
 		__m64 vd = M64(d);
 		__m64 vdest = in_over(vsrc, vsrca, expand_alpha_rev (M64 (m)), expand565(vd, 0));
 		vd = pack565(vdest, _mm_setzero_si64(), 0);
-		*dst = ULLONG(vd);
+		*dst = UINT64(vd);
 	    }
 
 	    w--;
@@ -2039,7 +2037,7 @@ fbCompositeSolidMask_nx8x0565mmx (pixman_op_t op,
 
 	while (w >= 4)
 	{
-	    ullong m0, m1, m2, m3;
+	    uint64_t m0, m1, m2, m3;
 	    m0 = *mask;
 	    m1 = *(mask + 1);
 	    m2 = *(mask + 2);
@@ -2047,7 +2045,7 @@ fbCompositeSolidMask_nx8x0565mmx (pixman_op_t op,
 
 	    if (srca == 0xff && (m0 & m1 & m2 & m3) == 0xff)
 	    {
-		*(ullong *)dst = srcsrcsrcsrc;
+		*(uint64_t *)dst = srcsrcsrcsrc;
 	    }
 	    else if (m0 | m1 | m2 | m3)
 	    {
@@ -2077,15 +2075,15 @@ fbCompositeSolidMask_nx8x0565mmx (pixman_op_t op,
 
 	while (w)
 	{
-	    ullong m = *mask;
+	    uint64_t m = *mask;
 
 	    if (m)
 	    {
-		ullong d = *dst;
+		uint64_t d = *dst;
 		__m64 vd = M64(d);
 		__m64 vdest = in_over(vsrc, vsrca, expand_alpha_rev (M64(m)), expand565(vd, 0));
 		vd = pack565(vdest, _mm_setzero_si64(), 0);
-		*dst = ULLONG(vd);
+		*dst = UINT64(vd);
 	    }
 
 	    w--;
@@ -2139,12 +2137,12 @@ fbCompositeSrc_8888RevNPx0565mmx (pixman_op_t op,
 	while (w && (unsigned long)dst & 7)
 	{
 	    __m64 vsrc = load8888 (*src);
-	    ullong d = *dst;
+	    uint64_t d = *dst;
 	    __m64 vdest = expand565 (M64(d), 0);
 
 	    vdest = pack565(over_rev_non_pre(vsrc, vdest), vdest, 0);
 
-	    *dst = ULLONG(vdest);
+	    *dst = UINT64(vdest);
 
 	    w--;
 	    dst++;
@@ -2200,12 +2198,12 @@ fbCompositeSrc_8888RevNPx0565mmx (pixman_op_t op,
 	while (w)
 	{
 	    __m64 vsrc = load8888 (*src);
-	    ullong d = *dst;
+	    uint64_t d = *dst;
 	    __m64 vdest = expand565 (M64(d), 0);
 
 	    vdest = pack565(over_rev_non_pre(vsrc, vdest), vdest, 0);
 
-	    *dst = ULLONG(vdest);
+	    *dst = UINT64(vdest);
 
 	    w--;
 	    dst++;
@@ -2269,7 +2267,7 @@ fbCompositeSrc_8888RevNPx8888mmx (pixman_op_t op,
 
 	while (w >= 2)
 	{
-	    ullong s0, s1;
+	    uint64_t s0, s1;
 	    unsigned char a0, a1;
 	    __m64 d0, d1;
 
@@ -2363,10 +2361,10 @@ fbCompositeSolidMask_nx8888x0565Cmmx (pixman_op_t op,
 
 	    if (m)
 	    {
-		ullong d = *q;
+		uint64_t d = *q;
 		__m64 vdest = expand565 (M64(d), 0);
 		vdest = pack565 (in_over (vsrc, vsrca, load8888 (m), vdest), vdest, 0);
-		*q = ULLONG(vdest);
+		*q = UINT64(vdest);
 	    }
 
 	    twidth--;
@@ -2406,10 +2404,10 @@ fbCompositeSolidMask_nx8888x0565Cmmx (pixman_op_t op,
 	    m = *(uint32_t *)p;
 	    if (m)
 	    {
-		ullong d = *q;
+		uint64_t d = *q;
 		__m64 vdest = expand565(M64(d), 0);
 		vdest = pack565 (in_over(vsrc, vsrca, load8888(m), vdest), vdest, 0);
-		*q = ULLONG(vdest);
+		*q = UINT64(vdest);
 	    }
 
 	    twidth--;
@@ -2767,7 +2765,7 @@ fbCompositeSrcAdd_8888x8888mmx (pixman_op_t 	op,
 	while (w >= 2)
 	{
 	    dst64 = _mm_adds_pu8(*(__m64*)src, *(__m64*)dst);
-	    *(ullong*)dst = ULLONG(dst64);
+	    *(uint64_t*)dst = UINT64(dst64);
 	    dst += 2;
 	    src += 2;
 	    w -= 2;
@@ -2980,7 +2978,7 @@ fbCompositeOver_x888x8x8888mmx (pixman_op_t      op,
 
 	while (w--)
 	{
-	    ullong m = *mask;
+	    uint64_t m = *mask;
 
 	    if (m)
 	    {
commit fd7449c4855e77d31770f9042ba43e186c541ce5
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Fri Apr 3 12:40:10 2009 -0700

    Fix MMX & SSE intrinsics to work with Sun compilers & Solaris
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>

diff --git a/configure.ac b/configure.ac
index 030d063..ebb5557 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,11 +63,18 @@ AM_INIT_AUTOMAKE([dist-bzip2])
 
 AM_CONFIG_HEADER(config.h)
 
+AC_CANONICAL_HOST
+
 AC_PROG_CC
 AC_PROG_LIBTOOL
 AC_CHECK_FUNCS([getisax])
 AC_C_BIGENDIAN
 AC_C_INLINE
+
+# Checks for Sun Studio compilers
+AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+AC_CHECK_DECL([__amd64], [AMD64_ABI="yes"], [AMD64_ABI="no"])
+
 # 
 # We ignore pixman_major in the version here because the major version should
 # always be encoded in the actual library name. Ie., the soname is:
@@ -141,12 +148,23 @@ AC_MSG_RESULT($have_sunstudio8)
 dnl ===========================================================================
 dnl Check for MMX
 
-MMX_CFLAGS="-mmmx -Winline"
+if test "x$MMX_CFLAGS" = "x" ; then
+   if test "x$SUNCC" = "xyes"; then
+      # Sun Studio doesn't have an -xarch=mmx flag, so we have to use sse
+      # but if we're building 64-bit, mmx & sse support is on by default and
+      # -xarch=sse throws an error instead
+      if test "$AMD64_ABI" = "no" ; then
+         MMX_CFLAGS="-xarch=sse"
+      fi
+   else
+      MMX_CFLAGS="-mmmx -Winline"
+   fi
+fi
 
 have_mmx_intrinsics=no
 AC_MSG_CHECKING(whether to use MMX intrinsics)
 xserver_save_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS $MMX_CFLAGS"
+CFLAGS="$MMX_CFLAGS $CFLAGS"
 AC_COMPILE_IFELSE([
 #if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
 error "Need GCC >= 3.4 for MMX intrinsics"
@@ -183,12 +201,21 @@ AM_CONDITIONAL(USE_MMX, test $have_mmx_intrinsics = yes)
 dnl ===========================================================================
 dnl Check for SSE2
 
-SSE2_CFLAGS="-mmmx -msse2 -Winline"
+if test "x$SSE2_CFLAGS" = "x" ; then
+   if test "x$SUNCC" = "xyes"; then
+      # SSE2 is enabled by default in the Sun Studio 64-bit environment
+      if test "$AMD64_ABI" = "no" ; then
+         SSE2_CFLAGS="-xarch=sse2"
+      fi
+   else
+      SSE2_CFLAGS="-mmmx -msse2 -Winline"
+   fi
+fi
 
 have_sse2_intrinsics=no
 AC_MSG_CHECKING(whether to use SSE2 intrinsics)
 xserver_save_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -msse2 $SSE2_CFLAGS"
+CFLAGS="$SSE2_CFLAGS $CFLAGS"
 
 AC_COMPILE_IFELSE([
 #if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2))
@@ -226,10 +253,31 @@ fi
 
 AM_CONDITIONAL(USE_SSE2, test $have_sse2_intrinsics = yes)
 
-dnl ========================================================
+dnl ===========================================================================
+dnl Other special flags needed when building code using MMX or SSE instructions
+case $host_os in
+   solaris*)
+      # When building 32-bit binaries, apply a mapfile to ensure that the
+      # binaries aren't flagged as only able to run on MMX+SSE capable CPUs
+      # since they check at runtime before using those instructions
+      if test "$AMD64_ABI" = "no" ; then
+         HWCAP_LDFLAGS='-Wl,-M,$(srcdir)/solaris-hwcap.mapfile'
+      fi
+      if test "x$MMX_LDFLAGS" = "x" ; then
+         MMX_LDFLAGS="$HWCAP_LDFLAGS"
+      fi
+      if test "x$SSE2_LDFLAGS" = "x" ; then
+	 SSE2_LDFLAGS="$HWCAP_LDFLAGS"
+      fi
+      ;;
+esac
+
 AC_SUBST(MMX_CFLAGS)
+AC_SUBST(MMX_LDFLAGS)
 AC_SUBST(SSE2_CFLAGS)
+AC_SUBST(SSE2_LDFLAGS)
 
+dnl ===========================================================================
 dnl Check for VMX/Altivec
 if test -n "`$CC -v 2>&1 | grep version | grep Apple`"; then
     VMX_CFLAGS="-faltivec"
diff --git a/pixman/Makefile.am b/pixman/Makefile.am
index c4612ea..b8589be 100644
--- a/pixman/Makefile.am
+++ b/pixman/Makefile.am
@@ -54,6 +54,7 @@ libpixman_mmx_la_SOURCES = \
 	pixman-mmx.h
 libpixman_mmx_la_CFLAGS = $(DEP_CFLAGS) $(MMX_CFLAGS)
 libpixman_mmx_la_LIBADD = $(DEP_LIBS)
+libpixman_1_la_LDFLAGS += $(MMX_LDFLAGS)
 libpixman_1_la_LIBADD += libpixman-mmx.la
 endif
 
@@ -77,6 +78,7 @@ libpixman_sse2_la_SOURCES = \
 	pixman-sse2.h
 libpixman_sse2_la_CFLAGS = $(DEP_CFLAGS) $(SSE2_CFLAGS)
 libpixman_sse2_la_LIBADD = $(DEP_LIBS)
+libpixman_1_la_LDFLAGS += $(SSE2_LDFLAGS)
 libpixman_1_la_LIBADD += libpixman-sse2.la
 endif
 
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index caeeafc..2d73247 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -71,15 +71,21 @@
  * possible.
  */
 
-/* --------------- MMX primitivess ------------------------------------ */
+/* --------------- MMX primitives ------------------------------------- */
+
+typedef uint64_t ullong;
 
 #ifdef __GNUC__
-typedef unsigned long long ullong;
 typedef ullong mmxdatafield;
-#endif
-#ifdef _MSC_VER
-typedef unsigned __int64 ullong;
+#else
 typedef __m64 mmxdatafield;
+/* If __m64 is defined as a struct or union, define M64_MEMBER to be the
+   name of the member used to access the data */
+# ifdef _MSC_VER
+#  define M64_MEMBER m64_u64
+# elif defined(__SUNPRO_C)
+#  define M64_MEMBER l_
+# endif
 #endif
 
 typedef struct
@@ -101,42 +107,31 @@ typedef struct
     mmxdatafield mmx_000000000000ffff;
 } MMXData;
 
+#if defined(_MSC_VER)
+# define MMXDATA_INIT(field, val) { val##UI64 }
+#elif defined(M64_MEMBER)	/* __m64 is a struct, not an integral type */
+# define MMXDATA_INIT(field, val) field =   { val##ULL }
+#else				/* __m64 is an integral type */
+# define MMXDATA_INIT(field, val) field =   val##ULL
+#endif
+
 static const MMXData c =
 {
-#ifdef __GNUC__
-    .mmx_4x00ff =			0x00ff00ff00ff00ffULL,
-    .mmx_4x0080 =			0x0080008000800080ULL,
-    .mmx_565_rgb =			0x000001f0003f001fULL,
-    .mmx_565_unpack_multiplier =	0x0000008404100840ULL,
-    .mmx_565_r =			0x000000f800000000ULL,
-    .mmx_565_g =			0x0000000000fc0000ULL,
-    .mmx_565_b =			0x00000000000000f8ULL,
-    .mmx_mask_0 =			0xffffffffffff0000ULL,
-    .mmx_mask_1 =			0xffffffff0000ffffULL,
-    .mmx_mask_2 =			0xffff0000ffffffffULL,
-    .mmx_mask_3 =			0x0000ffffffffffffULL,
-    .mmx_full_alpha =			0x00ff000000000000ULL,
-    .mmx_ffff0000ffff0000 =		0xffff0000ffff0000ULL,
-    .mmx_0000ffff00000000 =		0x0000ffff00000000ULL,
-    .mmx_000000000000ffff =		0x000000000000ffffULL,
-#endif
-#ifdef _MSC_VER
-    { 0x00ff00ff00ff00ffUI64 },
-    { 0x0080008000800080UI64 },
-    { 0x000001f0003f001fUI64 },
-    { 0x0000008404100840UI64 },
-    { 0x000000f800000000UI64 },
-    { 0x0000000000fc0000UI64 },
-    { 0x00000000000000f8UI64 },
-    { 0xffffffffffff0000UI64 },
-    { 0xffffffff0000ffffUI64 },
-    { 0xffff0000ffffffffUI64 },
-    { 0x0000ffffffffffffUI64 },
-    { 0x00ff000000000000UI64 },
-    { 0xffff0000ffff0000UI64 },
-    { 0x0000ffff00000000UI64 },
-    { 0x000000000000ffffUI64 },
-#endif
+    MMXDATA_INIT(.mmx_4x00ff,			0x00ff00ff00ff00ff),
+    MMXDATA_INIT(.mmx_4x0080,			0x0080008000800080),
+    MMXDATA_INIT(.mmx_565_rgb,			0x000001f0003f001f),
+    MMXDATA_INIT(.mmx_565_unpack_multiplier,	0x0000008404100840),
+    MMXDATA_INIT(.mmx_565_r,			0x000000f800000000),
+    MMXDATA_INIT(.mmx_565_g,			0x0000000000fc0000),
+    MMXDATA_INIT(.mmx_565_b,			0x00000000000000f8),
+    MMXDATA_INIT(.mmx_mask_0,			0xffffffffffff0000),
+    MMXDATA_INIT(.mmx_mask_1,			0xffffffff0000ffff),
+    MMXDATA_INIT(.mmx_mask_2,			0xffff0000ffffffff),
+    MMXDATA_INIT(.mmx_mask_3,			0x0000ffffffffffff),
+    MMXDATA_INIT(.mmx_full_alpha,		0x00ff000000000000),
+    MMXDATA_INIT(.mmx_ffff0000ffff0000,		0xffff0000ffff0000),
+    MMXDATA_INIT(.mmx_0000ffff00000000,		0x0000ffff00000000),
+    MMXDATA_INIT(.mmx_000000000000ffff,		0x000000000000ffff),
 };
 
 #ifdef __GNUC__
@@ -145,9 +140,7 @@ static const MMXData c =
 #    else
 #        define MC(x) ((__m64)c.mmx_##x)
 #    endif
-#endif
-
-#ifdef _MSC_VER
+#else
 #    define MC(x) c.mmx_##x
 #endif
 
@@ -156,15 +149,13 @@ M64 (ullong x)
 {
 #ifdef __ICC
     return _mm_cvtsi64_m64 (x);
-#elif defined (__GNUC__)
-    return (__m64)x;
-#endif
-
-#ifdef _MSC_VER
+#elif defined M64_MEMBER	/* __m64 is a struct, not an integral type */
     __m64 res;
 
-    res.m64_u64 = x;
+    res.M64_MEMBER = x;
     return res;
+#else				/* __m64 is an integral type */
+    return (__m64)x;
 #endif
 }
 
@@ -173,15 +164,11 @@ ULLONG (__m64 x)
 {
 #ifdef __ICC
     return _mm_cvtm64_si64 (x);
-#elif defined (__GNUC__)
-    return (ullong)x;
-#endif
-
-#ifdef _MSC_VER
-    ullong res;
-
-    res = x.m64_u64;
+#elif defined M64_MEMBER	/* __m64 is a struct, not an integral type */
+    ullong res = x.M64_MEMBER;
     return res;
+#else				/* __m64 is an integral type */
+    return (ullong)x;
 #endif
 }
 
@@ -2864,7 +2851,7 @@ pixman_blt_mmx (uint32_t *src_bits,
 
 	while (w >= 64)
 	{
-#ifdef __GNUC__
+#if defined (__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
 	    __asm__ (
 		"movq	  (%1),	  %%mm0\n"
 		"movq	 8(%1),	  %%mm1\n"
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 1380fa3..debd723 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -70,7 +70,7 @@
 /* 'inline' is available only in C++ in MSVC */
 #   define inline __inline
 #   define force_inline __forceinline
-#elif defined __GNUC__
+#elif defined __GNUC__ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
 #   define inline __inline__
 #   define force_inline __inline__ __attribute__ ((__always_inline__))
 #else
diff --git a/pixman/solaris-hwcap.mapfile b/pixman/solaris-hwcap.mapfile
new file mode 100644
index 0000000..7f439a9
--- /dev/null
+++ b/pixman/solaris-hwcap.mapfile
@@ -0,0 +1,36 @@
+###############################################################################
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+#
+###############################################################################
+#
+# Override the linker's detection of CMOV/MMX/SSE instructions so this
+# library isn't flagged as only usable on CPU's with those ISA's, since it
+# checks at runtime for availability before calling them
+
+hwcap_1 = V0x0 FPU OVERRIDE;


More information about the xorg-commit mailing list