Skip to content

Commit

Permalink
Bug 759683 - Check for -mssse3 instead of inconditionally using it. r…
Browse files Browse the repository at this point in the history
…=glandium
  • Loading branch information
landryb committed Jun 1, 2012
1 parent 3c414de commit e358a30
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/autoconf.mk.in
Expand Up @@ -660,6 +660,7 @@ WRAP_SYSTEM_INCLUDES = @WRAP_SYSTEM_INCLUDES@
HAVE_ARM_SIMD = @HAVE_ARM_SIMD@
HAVE_ARM_NEON = @HAVE_ARM_NEON@
HAVE_GCC_ALIGN_ARG_POINTER = @HAVE_GCC_ALIGN_ARG_POINTER@
HAVE_COMPILER_FLAG_MSSSE3 = @HAVE_COMPILER_FLAG_MSSSE3@

MOZ_THEME_FASTSTRIPE = @MOZ_THEME_FASTSTRIPE@

Expand Down
11 changes: 11 additions & 0 deletions configure.in
Expand Up @@ -1713,6 +1713,17 @@ if test "$GNU_CC"; then
_MOZ_RTTI_FLAGS_ON=-frtti
_MOZ_RTTI_FLAGS_OFF=-fno-rtti

# Check for -mssse3 on $CC
AC_MSG_CHECKING([for -mssse3 option to $CC])
HAVE_COMPILER_FLAG_MSSSE3=
_SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -mssse3"
AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
[HAVE_COMPILER_FLAG_MSSSE3=1],
AC_MSG_RESULT([no]))
CFLAGS=$_SAVE_CFLAGS
AC_SUBST(HAVE_COMPILER_FLAG_MSSSE3)

# Turn on GNU-specific warnings:
# -Wall - turn on a lot of warnings
# -pedantic - this is turned on below
Expand Down
5 changes: 4 additions & 1 deletion gfx/skia/Makefile.in
Expand Up @@ -360,12 +360,15 @@ endif
ifneq (,$(INTEL_ARCHITECTURE))
CPPSRCS += \
SkBitmapProcState_opts_SSE2.cpp \
SkBitmapProcState_opts_SSSE3.cpp \
SkBlitRect_opts_SSE2.cpp \
SkBlitRow_opts_SSE2.cpp \
SkUtils_opts_SSE2.cpp \
opts_check_SSE2.cpp \
$(NULL)
ifdef HAVE_COMPILER_FLAG_MSSSE3
DEFINES += -DSK_BUILD_SSSE3
CPPSRCS += SkBitmapProcState_opts_SSSE3.cpp
endif
else
ifeq ($(CPU_ARCH)_$(GNU_CC),arm_1)
CPPSRCS += \
Expand Down
22 changes: 22 additions & 0 deletions gfx/skia/patches/0012-Bug-759683-make-ssse3-conditional.patch
@@ -0,0 +1,22 @@
diff --git a/gfx/skia/src/opts/opts_check_SSE2.cpp b/gfx/skia/src/opts/opts_check_SSE2.cpp
--- a/gfx/skia/src/opts/opts_check_SSE2.cpp
+++ b/gfx/skia/src/opts/opts_check_SSE2.cpp
@@ -91,17 +91,17 @@ static bool cachedHasSSE2() {

static bool cachedHasSSSE3() {
static bool gHasSSSE3 = hasSSSE3();
return gHasSSSE3;
}

void SkBitmapProcState::platformProcs() {
if (cachedHasSSSE3()) {
-#if !defined(SK_BUILD_FOR_ANDROID)
+#if defined(SK_BUILD_SSSE3)
// Disable SSSE3 optimization for Android x86
if (fSampleProc32 == S32_opaque_D32_filter_DX) {
fSampleProc32 = S32_opaque_D32_filter_DX_SSSE3;
} else if (fSampleProc32 == S32_alpha_D32_filter_DX) {
fSampleProc32 = S32_alpha_D32_filter_DX_SSSE3;
}

if (fSampleProc32 == S32_opaque_D32_filter_DXDY) {
1 change: 1 addition & 0 deletions gfx/skia/patches/README
Expand Up @@ -14,3 +14,4 @@ See the relevant bugs in bugzilla for information on these patches:
0009-Bug-755869-FreeBSD-Hurd.patch
0010-Bug-689069-ARM-Opts.patch
0011-Bug-719575-Fix-clang-build.patch
0012-Bug-759683-make-ssse3-conditional.patch
2 changes: 1 addition & 1 deletion gfx/skia/src/opts/opts_check_SSE2.cpp
Expand Up @@ -96,7 +96,7 @@ static bool cachedHasSSSE3() {

void SkBitmapProcState::platformProcs() {
if (cachedHasSSSE3()) {
#if !defined(SK_BUILD_FOR_ANDROID)
#if defined(SK_BUILD_SSSE3)
// Disable SSSE3 optimization for Android x86
if (fSampleProc32 == S32_opaque_D32_filter_DX) {
fSampleProc32 = S32_opaque_D32_filter_DX_SSSE3;
Expand Down

0 comments on commit e358a30

Please sign in to comment.