pixman: Branch 'master' - 2 commits

Søren Sandmann Pedersen sandmann at kemper.freedesktop.org
Thu May 15 14:16:58 PDT 2008


 TODO                 |   13 ++++++-------
 configure.ac         |    4 ++--
 pixman/pixman-pict.c |   16 ++++++++++++++++
 3 files changed, 24 insertions(+), 9 deletions(-)

New commits:
commit 30bdbbed073750efa0a0c1e3f68925196e118953
Author: Søren Sandmann <sandmann at redhat.com>
Date:   Thu May 15 01:07:59 2008 -0400

    Update TODO

diff --git a/TODO b/TODO
index 8347446..5acadf3 100644
--- a/TODO
+++ b/TODO
@@ -8,13 +8,6 @@
 
       - Use pixmanFillsse2 and pixmanBltsse2
 
-      - Crashes in Mozilla because of unaligned stack. Possible fixes
-
-        - Make use of gcc 4.2 feature to align the stack
-
-        - Write some sort of trampoline that aligns the stack
-          before calling SSE functions.
-
   - Update the RLEASING file
 
   - Things to keep in mind if breaking ABI:
@@ -151,6 +144,12 @@
 
 done:
 
+- SSE2 issues:
+    - Crashes in Mozilla because of unaligned stack. Possible fixes
+        - Make use of gcc 4.2 feature to align the stack
+        - Write some sort of trampoline that aligns the stack
+          before calling SSE functions.
+
 - Get rid of the switch-of-doom; replace it with a big table
   describing the various fast paths.
 
commit d71bfc7777a48edfeb0aee0e3da97ac700a3dc90
Author: Søren Sandmann <sandmann at redhat.com>
Date:   Thu May 15 01:00:28 2008 -0400

    Work around GCC bug causing crashes in Mozilla with SSE2
    
    When using SSE2 intrinsics, gcc assumes that the stack is 16 byte
    aligned. Unfortunately some code, such as Mozilla and Mono contain
    code that aligns the stack to 4 bytes.
    
    The __force_align_arg_pointer__ makes gcc generate a prologue that
    realigns the stack pointer to 16 bytes.  Fix bug 15693.

diff --git a/configure.ac b/configure.ac
index d80022b..988bee1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -213,8 +213,8 @@ xserver_save_CFLAGS=$CFLAGS
 CFLAGS="$CFLAGS -msse2 $SSE_CFLAGS"
 
 AC_COMPILE_IFELSE([
-#if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
-#error "Need GCC >= 3.4 for SSE2 intrinsics"
+#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2))
+#error "Need GCC >= 4.2 for SSE2 intrinsics"
 #endif
 #include <mmintrin.h>
 #include <xmmintrin.h>
diff --git a/pixman/pixman-pict.c b/pixman/pixman-pict.c
index 00ac511..833d65a 100644
--- a/pixman/pixman-pict.c
+++ b/pixman/pixman-pict.c
@@ -1715,7 +1715,23 @@ pixman_optimize_operator(pixman_op_t op, pixman_image_t *pSrc, pixman_image_t *p
 
 }
 
+#if defined(USE_SSE2) && defined (__GNUC__)
 
+/*
+ * Work around GCC bug causing crashes in Mozilla with SSE2
+ * 
+ * When using SSE2 intrinsics, gcc assumes that the stack is 16 byte
+ * aligned. Unfortunately some code, such as Mozilla and Mono contain
+ * code that aligns the stack to 4 bytes.
+ *
+ * The __force_align_arg_pointer__ makes gcc generate a prologue that
+ * realigns the stack pointer to 16 bytes.
+ *
+ * See https://bugs.freedesktop.org/show_bug.cgi?id=15693
+ */
+
+__attribute__((__force_align_arg_pointer__))
+#endif
 void
 pixman_image_composite (pixman_op_t      op,
 			pixman_image_t * pSrc,


More information about the xorg-commit mailing list