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
--- 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 += [