Bug 461202 - Turn on SSE2 pixman optimizations
☠☠ backed out by e6b478f43944 ☠ ☠
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Sun, 16 Nov 2008 17:06:59 +0100
changeset 21728 b98316b617970cd6bc6e17e60f8795ec926099c9
parent 21727 f780c4b81eb4e490d07eeb28e5f07c72c83192d1
child 21729 e6b478f43944aa340dfc71c72f2ccb846c6959df
push idunknown
push userunknown
push dateunknown
bugs461202
milestone1.9.1b2pre
Bug 461202 - Turn on SSE2 pixman optimizations
config/autoconf.mk.in
configure.in
gfx/cairo/libpixman/src/Makefile.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -644,8 +644,9 @@ HAVE_DTRACE= @HAVE_DTRACE@
 VISIBILITY_FLAGS = @VISIBILITY_FLAGS@
 WRAP_SYSTEM_INCLUDES = @WRAP_SYSTEM_INCLUDES@
 
 MOZ_EMBEDDING_LEVEL_DEFAULT = @MOZ_EMBEDDING_LEVEL_DEFAULT@
 MOZ_EMBEDDING_LEVEL_BASIC = @MOZ_EMBEDDING_LEVEL_BASIC@
 MOZ_EMBEDDING_LEVEL_MINIMAL = @MOZ_EMBEDDING_LEVEL_MINIMAL@
 
 HAVE_ARM_SIMD= @HAVE_ARM_SIMD@
+HAVE_FORCE_ALIGN_ARG_POINTER = @HAVE_FORCE_ALIGN_ARG_POINTER@
--- a/configure.in
+++ b/configure.in
@@ -2944,16 +2944,31 @@ AC_TRY_COMPILE([],
                result="yes", result="no")
 AC_MSG_RESULT("$result")
 if test "$result" = "yes"; then
     AC_DEFINE(HAVE_ARM_SIMD)
     HAVE_ARM_SIMD=1
 fi
 AC_SUBST(HAVE_ARM_SIMD)
 
+dnl Check for force_align_arg_pointer
+dnl This first appeared in gcc 4.2
+AC_MSG_CHECKING(for __attribute__((__force_align_arg_pointer__)))
+AC_TRY_COMPILE([
+                __attribute__((__force_align_arg_pointer__)) int pixman(int a) { return a; }
+                ],
+                [],
+                result="yes", result="no")
+AC_MSG_RESULT("$result")
+if test "$result" = "yes"; then
+    AC_DEFINE(HAVE_FORCE_ALIGN_ARG_POINTER)
+    HAVE_FORCE_ALIGN_ARG_POINTER=1
+fi
+AC_SUBST(HAVE_FORCE_ALIGN_ARG_POINTER)
+
 dnl Check whether the compiler supports the new-style C++ standard
 dnl library headers (i.e. <new>) or needs the old "new.h"
 AC_LANG_CPLUSPLUS
 NEW_H=new.h
 AC_CHECK_HEADER(new, [NEW_H=new])
 AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
 AC_LANG_C
 
--- a/gfx/cairo/libpixman/src/Makefile.in
+++ b/gfx/cairo/libpixman/src/Makefile.in
@@ -60,29 +60,30 @@ OS_COMPILE_CFLAGS += -GL-
 MODULE_OPTIMIZE_FLAGS = -O2
 endif
 endif
 
 # Build MMX code either with VC or with gcc-on-x86
 ifdef _MSC_VER
 ifeq (86,$(findstring 86,$(OS_TEST)))
 USE_MMX=1
-#USE_SSE2=1
+USE_SSE2=1
 MMX_CFLAGS=
 endif
 endif
 
 ifdef GNU_CC
 
 ifeq (86,$(findstring 86,$(OS_TEST)))
 USE_MMX=1
 MMX_CFLAGS=-mmmx -Winline
-# See bug 410509 why we can't use SSE2 yet on linux
-#USE_SSE2=1
-#MMX_CFLAGS+=-msse -msse2
+ifdef HAVE_FORCE_ALIGN_ARG_POINTER
+USE_SSE2=1
+MMX_CFLAGS+=-msse -msse2
+endif
 ifneq ($(MOZ_WIDGET_TOOLKIT),os2)
 MMX_CFLAGS+=--param inline-unit-growth=10000 --param large-function-growth=10000
 endif
 endif
 ifeq (arm,$(findstring arm,$(OS_TEST)))
 ifdef HAVE_ARM_SIMD
 USE_ARM_SIMD=1
 endif