pixman: Branch 'master' - 3 commits

M. Joonas Pihlaja joonas at kemper.freedesktop.org
Thu Sep 3 12:56:46 PDT 2009


 configure.ac         |   12 ++++++++++++
 pixman/pixman-sse2.c |   10 ++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

New commits:
commit 29e7d6063f7b93dd4fde3d42a2931ec0f55158c3
Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
Date:   Mon Aug 31 23:02:53 2009 +0100

    Default to optimised builds when using a Sun Studio compiler.
    
    Autoconf's AC_PROG_CC sets the default CFLAGS to -O2 -g for
    gcc and -g for every other compiler.  This patch defaults
    CFLAGS to the equivalent -O -g when we're using Sun Studio's cc
    if the user or site admin hasn't already set CFLAGS.

diff --git a/configure.ac b/configure.ac
index 20c9e7a..832ed8b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,6 +65,8 @@ AM_CONFIG_HEADER(config.h)
 
 AC_CANONICAL_HOST
 
+test_CFLAGS=${CFLAGS+set} # We may override autoconf default CFLAGS.
+
 AC_PROG_CC
 AC_PROG_LIBTOOL
 AC_CHECK_FUNCS([getisax])
@@ -75,6 +77,16 @@ AC_C_INLINE
 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
 AC_CHECK_DECL([__amd64], [AMD64_ABI="yes"], [AMD64_ABI="no"])
 
+# Default CFLAGS to -O -g rather than just the -g from AC_PROG_CC
+# if we're using Sun Studio and neither the user nor a config.site
+# has set CFLAGS.
+if test $SUNCC = yes &&			\
+   test "$test_CFLAGS" == "" &&		\
+   test "$CFLAGS" = "-g"
+then
+  CFLAGS="-O -g"
+fi
+
 # 
 # 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:
commit e7018685f0618640221ebc61446ee98ea3056bbb
Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
Date:   Mon Aug 31 20:27:32 2009 +0100

    Work around a Sun Studio 12 code generation bug involving _mm_set_epi32().
    
    Calling a static function wrapper around _mm_set_epi32() when not
    using optimisation causes Sun Studio 12's cc to emit a spurious
    floating point load which confuses the assembler.  Using a macro wrapper
    rather than a function steps around the problem.

diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index c81836a..e9cdf9e 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -2628,12 +2628,18 @@ create_mask_2x32_64 (uint32_t mask0,
     return _mm_set_pi32 (mask0, mask1);
 }
 
+/* Work around a code generation bug in Sun Studio 12. */
+#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
+# define create_mask_2x32_128(mask0, mask1) \
+	(_mm_set_epi32 ((mask0), (mask1), (mask0), (mask1)))
+#else
 static force_inline __m128i
 create_mask_2x32_128 (uint32_t mask0,
                       uint32_t mask1)
 {
     return _mm_set_epi32 (mask0, mask1, mask0, mask1);
 }
+#endif
 
 /* SSE2 code patch for fbcompose.c */
 
commit 04ade7b68c620a62daff6212eee4d1b96bfbc3c9
Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
Date:   Mon Aug 31 20:24:04 2009 +0100

    Work around differing _mm_prefetch() prototypes on Solaris.
    
    Sun Studio 12 expects the address to prefetch to be
    a const char pointer rather than a __m128i pointer or
    void pointer.

diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index 984614e..c81836a 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -359,13 +359,13 @@ in_over_2x128 (__m128i* src_lo,
 static force_inline void
 cache_prefetch (__m128i* addr)
 {
-    _mm_prefetch (addr, _MM_HINT_T0);
+    _mm_prefetch ((void const*)addr, _MM_HINT_T0);
 }
 
 static force_inline void
 cache_prefetch_next (__m128i* addr)
 {
-    _mm_prefetch (addr + 4, _MM_HINT_T0); /* 64 bytes ahead */
+    _mm_prefetch ((void const *)(addr + 4), _MM_HINT_T0); /* 64 bytes ahead */
 }
 
 /* load 4 pixels from a 16-byte boundary aligned address */


More information about the xorg-commit mailing list