Work around a Sun Studio 12 code generation bug involving _mm_set_epi32().
authorM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
Mon, 31 Aug 2009 19:27:32 +0000 (20:27 +0100)
committerM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
Thu, 3 Sep 2009 19:51:18 +0000 (22:51 +0300)
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.

pixman/pixman-sse2.c

index 1d4f02b..a5fcf21 100644 (file)
@@ -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 */