Bug 1054811 - Set HAVE_X86_AVX2 for VS2012 or later. r=glandium
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 21 Aug 2014 15:46:45 +0900
changeset 200751 750ff46e6fdf22772ca083bab8b6d8871430cb27
parent 200750 c8387e2ab3352848eefa848fa27772d320a3fa7b
child 200752 4af1d462595380b3796004a892feedd81af3b8a6
push id47994
push userm_kato@ga2.so-net.ne.jp
push dateThu, 21 Aug 2014 06:47:47 +0000
treeherdermozilla-inbound@750ff46e6fdf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1054811
milestone34.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 1054811 - Set HAVE_X86_AVX2 for VS2012 or later. r=glandium
configure.in
--- a/configure.in
+++ b/configure.in
@@ -1366,18 +1366,16 @@ if test "$GNU_CC"; then
     x86 | x86_64)
       AC_MSG_CHECKING(for x86 AVX2 asm support in compiler)
       AC_TRY_COMPILE([],
                      [asm volatile ("vpermq      \$0xd8,%ymm0,%ymm0 \n");],
                      result="yes", result="no")
       AC_MSG_RESULT("$result")
       if test "$result" = "yes"; then
           HAVE_X86_AVX2=1
-          AC_DEFINE(HAVE_X86_AVX2)
-          AC_SUBST(HAVE_X86_AVX2)
       fi
     esac
 
     DSO_LDOPTS='-shared'
     if test "$GCC_USE_GNU_LD"; then
         # Some tools like ASan use a runtime library that is only
         # linked against executables, so we must allow undefined
         # symbols for shared objects in some cases.
@@ -2163,16 +2161,20 @@ ia64*-hpux*)
         dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
         dnl Probably also a compiler bug, but what can you do?
         PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
         LDFLAGS="$LDFLAGS -DYNAMICBASE"
         dnl Minimum reqiurement of Gecko is VS2010 or later which supports
         dnl both SSSE3 and SSE4.1.
         HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1
         HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=1
+        if test "$_CC_SUITE" -ge "11"; then
+            dnl allow AVX2 code from VS2012
+            HAVE_X86_AVX2=1
+        fi
         MOZ_MEMORY=1
     fi
     AC_DEFINE(HAVE_SNPRINTF)
     AC_DEFINE(_WINDOWS)
     AC_DEFINE(WIN32)
     AC_DEFINE(XP_WIN)
     AC_DEFINE(XP_WIN32)
     AC_DEFINE(HW_THREADS)
@@ -8698,16 +8700,17 @@ AC_SUBST(TARGET_XPCOM_ABI)
 AC_SUBST(OS_TARGET)
 AC_SUBST(OS_ARCH)
 AC_SUBST(OS_RELEASE)
 AC_SUBST(OS_TEST)
 AC_SUBST(CPU_ARCH)
 AC_SUBST(INTEL_ARCHITECTURE)
 AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSSE3)
 AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSE4_1)
+AC_SUBST(HAVE_X86_AVX2)
 AC_SUBST(GCC_USE_GNU_LD)
 
 AC_SUBST(MOZ_CHROME_FILE_FORMAT)
 
 AC_SUBST(WRAP_LDFLAGS)
 AC_SUBST(MKSHLIB)
 AC_SUBST(MKCSHLIB)
 AC_SUBST(MKSHLIB_FORCE_ALL)