Bug 1371016 - aom: Add /arch:AVX2 when compiling under msvc. r?ted draft
authorRalph Giles <giles@mozilla.com>
Wed, 07 Jun 2017 12:34:31 -0700
changeset 590405 6f63882c86cf1ab5413d0d20b730b1a3785ac071
parent 590340 9562e43fcc9e134e624c3996247b17dc3c344415
child 632235 563587be8bdc38b97a944b7ae54031ecdc3c498b
push id62753
push userbmo:giles@thaumas.net
push dateWed, 07 Jun 2017 19:50:44 +0000
reviewersted
bugs1371016, 1279593
milestone55.0a1
Bug 1371016 - aom: Add /arch:AVX2 when compiling under msvc. r?ted Propagate the libvpx AVX flag changes from bug 1279593. This flag tells the compiler to generate AVX code in these modules intead of using normal SSE instructions which can trigger expensive state-switching. NB: This should only be set for AVX-specific implementation files; setting this flag for general code will invalidate our runtime simd support checks. MozReview-Commit-ID: 5BVeCTsNlup
media/libaom/moz.build
--- a/media/libaom/moz.build
+++ b/media/libaom/moz.build
@@ -93,16 +93,23 @@ if CONFIG['CLANG_CL'] or not CONFIG['_MS
             SOURCES[f].flags += ['-mssse3']
         elif f.endswith('sse4.c'):
             SOURCES[f].flags += ['-msse4.1']
         elif f.endswith('avx.c'):
             SOURCES[f].flags += ['-mavx']
         elif f.endswith('avx2.c'):
             SOURCES[f].flags += ['-mavx2']
 
+if CONFIG['_MSC_VER'] and not config['CLANG_CL']:
+    for f in SOURCES:
+        if f.endswith('avx.c'):
+            SOURCES[f].flags += ['-arch:AVX']
+        if f.endswith('avx2.c'):
+            SOURCES[f].flags += ['-arch:AVX2']
+
 # Suppress warnings in third-party code.
 if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
     CFLAGS += [
         '-Wno-sign-compare',
         '-Wno-unused-function', # so many of these warnings; just ignore them
     ]
 if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']:
     CFLAGS += [