Bug 1271794 - Use SSE2 instructions on win32. r=glandium
☠☠ backed out by cbb9d4a22c5c ☠ ☠
authorRalph Giles <giles@mozilla.com>
Tue, 10 May 2016 14:55:51 -0700
changeset 297773 28b45df659b7274ea988430538f941ba21dfc2ac
parent 297772 cf899587f05e7bf3104da618297ce6abb6e97a0f
child 297774 9f4983dfd88188dc9c679d095133fabbcadb48db
push id30267
push userryanvm@gmail.com
push dateWed, 18 May 2016 16:13:07 +0000
treeherdermozilla-central@c4449eab07d3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1271794
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1271794 - Use SSE2 instructions on win32. r=glandium We've decided supporting the small number of x86 machines without SSE2 instructions is no longer worth the cost in developer time nor the performance impact for other users. https://groups.google.com/d/msg/mozilla.dev.platform/dZC39mj5V-s/Xt_UqZXkAAAJ Set -arch:SSE2 by default on x86 if an arch hasn't already been supplied. This ensures we'll continue to build with the right instruction set if the compiler changes its default in the future, while still allowing custom builds to set a lower minimum. Also updates the filter to strip all arch switches on win64 when building the sandbox. The 64-bit compiler doesn't support -arch:SSE2 either. MozReview-Commit-ID: JzTRGPn9vzI
js/src/old-configure.in
old-configure.in
security/sandbox/win/wow_helper/Makefile.in
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -977,20 +977,26 @@ case "$target" in
         WIN32_CONSOLE_EXE_LDFLAGS=-SUBSYSTEM:CONSOLE,$WIN32_SUBSYSTEM_VERSION
         WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
         DSO_LDOPTS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
         _USE_CPP_INCLUDE_FLAG=1
         _DEFINES_CFLAGS='-FI $(topobjdir)/js/src/js-confdefs.h -DMOZILLA_CLIENT'
         _DEFINES_CXXFLAGS='-FI $(topobjdir)/js/src/js-confdefs.h -DMOZILLA_CLIENT'
         CFLAGS="$CFLAGS -W3 -Gy"
         CXXFLAGS="$CXXFLAGS -W3 -Gy"
-        if test "$CPU_ARCH" = "x86"; then
-            dnl VS2012+ defaults to -arch:SSE2.
-            CFLAGS="$CFLAGS -arch:IA32"
-            CXXFLAGS="$CXXFLAGS -arch:IA32"
+        if test "$CPU_ARCH" = "x86";then
+          dnl VS2012+ defaults to -arch:SSE2. We want to target nothing
+          dnl more recent, so set that explicitly here unless another
+          dnl target arch has already been set.
+          if test -z `echo $CFLAGS | grep -i [-/]arch:` ; then
+            CFLAGS="$CFLAGS -arch:SSE2"
+            fi
+          if test -z `echo $CXXFLAGS | grep -i [-/]arch:` ; then
+            CXXFLAGS="$CXXFLAGS -arch:SSE2"
+          fi
         fi
         dnl VS2013+ requires -FS when parallel building by make -jN.
         dnl If nothing, compiler sometimes causes C1041 error.
         CFLAGS="$CFLAGS -FS"
         CXXFLAGS="$CXXFLAGS -FS"
         # khuey says we can safely ignore MSVC warning C4251
         # MSVC warning C4244 (implicit type conversion may lose data) warns
         # and requires workarounds for perfectly valid code.  Also, GCC/clang
--- a/old-configure.in
+++ b/old-configure.in
@@ -1373,19 +1373,25 @@ case "$target" in
         WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
         DSO_LDOPTS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
         _USE_CPP_INCLUDE_FLAG=1
         _DEFINES_CFLAGS='-FI $(topobjdir)/mozilla-config.h -DMOZILLA_CLIENT'
         _DEFINES_CXXFLAGS='-FI $(topobjdir)/mozilla-config.h -DMOZILLA_CLIENT'
         CFLAGS="$CFLAGS -W3 -Gy"
         CXXFLAGS="$CXXFLAGS -W3 -Gy"
         if test "$CPU_ARCH" = "x86"; then
-            dnl VS2012+ defaults to -arch:SSE2.
-            CFLAGS="$CFLAGS -arch:IA32"
-            CXXFLAGS="$CXXFLAGS -arch:IA32"
+            dnl VS2012+ defaults to -arch:SSE2. We want to target nothing
+            dnl more recent, so set that explicitly here unless another
+            dnl target arch has already been set.
+            if test -z `echo $CFLAGS | grep -i [-/]arch:`; then
+              CFLAGS="$CFLAGS -arch:SSE2"
+            fi
+            if test -z `echo $CXXFLAGS | grep -i [-/]arch:`; then
+              CXXFLAGS="$CXXFLAGS -arch:SSE2"
+            fi
             SSE_FLAGS="-arch:SSE"
             SSE2_FLAGS="-arch:SSE2"
             dnl MSVC allows the use of intrinsics without any flags
             dnl and doesn't have a separate arch for SSSE3
             SSSE3_FLAGS="-arch:SSE2"
         fi
         dnl VS2013+ requires -FS when parallel building by make -jN.
         dnl If nothing, compiler sometimes causes C1041 error.
--- a/security/sandbox/win/wow_helper/Makefile.in
+++ b/security/sandbox/win/wow_helper/Makefile.in
@@ -27,17 +27,17 @@ MOZ_WINCONSOLE = 0
 
 include $(topsrcdir)/config/config.mk
 
 # Munge the LIB variable to contain paths to the x64 CRT and system libraries.
 # Unconveniently, none of the paths have the same convention, including the
 # compiler path above.
 LIB = $(call lazy,LIB,$$(shell python -c 'import os; print ";".join(s.lower().replace(os.sep, "/").replace("/vc/lib", "/vc/lib/amd64").replace("/um/x86", "/um/x64").replace("/ucrt/x86", "/ucrt/x64") for s in os.environ["LIB"].split(";"))'))
 
-CXXFLAGS := $(filter-out -arch:IA32,$(CXXFLAGS))
+CXXFLAGS := $(filter-out -arch:%,$(CXXFLAGS))
 
 # OS_COMPILE_CXXFLAGS includes mozilla-config.h, which contains x86-specific
 # defines breaking the build.
 OS_COMPILE_CXXFLAGS :=
 
 # LNK1246: '/SAFESEH' not compatible with 'x64' target machine
 LDFLAGS := $(filter-out -SAFESEH,$(LDFLAGS))