diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/breakpad/src/build/common.gypi qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/breakpad/src/build/common.gypi --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/breakpad/src/build/common.gypi 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/breakpad/src/build/common.gypi 2016-07-17 18:06:28.022746102 +0200 @@ -80,8 +80,8 @@ # The system root for cross-compiles. Default: none. 'sysroot%': '', - # On Linux, we build with sse2 for Chromium builds. - 'disable_sse2%': 0, + # Do not assume SSE2 by default (Fedora patch). + 'disable_sse2%': 1 }, 'target_arch%': '<(target_arch)', @@ -725,17 +725,13 @@ 'conditions': [ ['disable_sse2==0', { 'cflags': [ - '-march=pentium4', '-msse2', '-mfpmath=sse', ], }], ], - # -mmmx allows mmintrin.h to be used for mmx intrinsics. - # video playback is mmx and sse2 optimized. 'cflags': [ '-m32', - '-mmmx', ], 'ldflags': [ '-m32', diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/build/common.gypi qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/build/common.gypi --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/build/common.gypi 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/build/common.gypi 2016-07-17 18:06:28.025746118 +0200 @@ -3898,15 +3898,7 @@ # value used during computation does not change depending on # how the compiler optimized the code, since the value is # always kept in its specified precision. - # - # Refer to http://crbug.com/348761 for rationale behind SSE2 - # being a minimum requirement for 32-bit Linux builds and - # http://crbug.com/313032 for an example where this has "bit" - # us in the past. 'cflags': [ - '-msse2', - '-mfpmath=sse', - '-mmmx', # Allows mmintrin.h for MMX intrinsics. '-m32', ], 'ldflags': [ diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/cc/BUILD.gn qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/cc/BUILD.gn --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/cc/BUILD.gn 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/cc/BUILD.gn 2016-07-17 19:24:47.069349645 +0200 @@ -528,13 +528,6 @@ "trees/tree_synchronizer.h", ] - if (target_cpu == "x86" || target_cpu == "x64") { - sources += [ - "raster/texture_compressor_etc1_sse.cc", - "raster/texture_compressor_etc1_sse.h", - ] - } - configs += [ "//build/config:precompiled_headers" ] public_deps = [ @@ -544,6 +537,7 @@ deps = [ "//base", "//base/third_party/dynamic_annotations", + "//cc:cc_opts", "//cc/proto", "//cc/surfaces:surface_id", "//gpu", @@ -563,6 +557,36 @@ } } +source_set("cc_opts") { + public_deps = [ + "//cc:cc_opts_sse", + ] +} + +source_set("cc_opts_sse") { + if (target_cpu == "x86" || target_cpu == "x64") { + deps = [ + "//base", + ] + + defines = [ "CC_IMPLEMENTATION=1" ] + + if (!is_debug && (is_win || is_android)) { + configs -= [ "//build/config/compiler:optimize" ] + configs += [ "//build/config/compiler:optimize_max" ] + } + + sources = [ + "raster/texture_compressor.h", + "raster/texture_compressor_etc1.h", + "raster/texture_compressor_etc1_sse.cc", + "raster/texture_compressor_etc1_sse.h", + ] + + cflags = [ "-msse2" ] + } +} + source_set("test_support") { testonly = true sources = [ diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/cc/cc.gyp qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/cc/cc.gyp --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/cc/cc.gyp 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/cc/cc.gyp 2016-07-17 19:23:10.962834059 +0200 @@ -595,14 +595,6 @@ 'includes': [ '../build/android/increase_size_for_speed.gypi', ], - 'conditions': [ - ['target_arch == "ia32" or target_arch == "x64"', { - 'sources': [ - 'raster/texture_compressor_etc1_sse.cc', - 'raster/texture_compressor_etc1_sse.h', - ], - }], - ], }, { # GN version: "//cc/proto" @@ -667,6 +659,7 @@ '<(DEPTH)/ui/events/events.gyp:events_base', '<(DEPTH)/ui/gfx/gfx.gyp:gfx', '<(DEPTH)/ui/gfx/gfx.gyp:gfx_geometry', + 'cc_opts', ], 'defines': [ 'CC_SURFACES_IMPLEMENTATION=1', @@ -704,5 +697,41 @@ '../build/android/increase_size_for_speed.gypi', ], }, + { + 'target_name': 'cc_opts', + 'type': 'static_library', + 'conditions': [ + ['target_arch == "ia32" or target_arch == "x64"', { + 'defines': [ + 'CC_IMPLEMENTATION=1', + ], + 'dependencies': [ + 'cc_opts_sse', + ] + }], + ], + }, + { + 'target_name': 'cc_opts_sse', + 'type': 'static_library', + 'dependencies': [ + '<(DEPTH)/base/base.gyp:base', + ], + 'conditions': [ + ['target_arch == "ia32" or target_arch == "x64"', { + 'defines': [ + 'CC_IMPLEMENTATION=1', + ], + 'sources': [ + # Conditional compilation for SSE2 code on x86 and x64 machines + 'raster/texture_compressor_etc1_sse.cc', + 'raster/texture_compressor_etc1_sse.h', + ], + 'cflags': [ + '-msse2', + ], + }], + ], + }, ], } diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/BUILD.gn qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/BUILD.gn --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/BUILD.gn 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/BUILD.gn 2016-07-17 18:06:36.080790050 +0200 @@ -279,13 +279,13 @@ } if (current_cpu == "x86" || current_cpu == "x64") { - sources += [ - "simd/convert_rgb_to_yuv_sse2.cc", - "simd/convert_rgb_to_yuv_ssse3.cc", - "simd/convert_yuv_to_rgb_x86.cc", - "simd/filter_yuv_sse2.cc", + sources += [ "simd/convert_yuv_to_rgb_x86.cc" ] + deps += [ + ":media_yasm", + ":media_mmx", + ":media_sse", + ":media_sse2", ] - deps += [ ":media_yasm" ] } configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] @@ -484,10 +484,47 @@ } if (current_cpu == "x86" || current_cpu == "x64") { + source_set("media_mmx") { + sources = [ "simd/filter_yuv_mmx.cc" ] + configs += [ "//media:media_config" ] + if (!is_win) { + cflags = [ "-mmmx" ] + } + } + + source_set("media_sse") { + sources = [ + "simd/sinc_resampler_sse.cc", + ] + configs += [ + "//media:media_config", + "//media:media_implementation", + ] + if (!is_win) { + cflags = [ "-msse" ] + } + } + + source_set("media_sse2") { + sources = [ + "simd/convert_rgb_to_yuv_sse2.cc", + "simd/convert_rgb_to_yuv_ssse3.cc", + "simd/filter_yuv_sse2.cc", + ] + configs += [ + "//media:media_config", + "//media:media_implementation", + ] + if (!is_win) { + cflags = [ "-msse2" ] + } + } + import("//third_party/yasm/yasm_assemble.gni") yasm_assemble("media_yasm") { sources = [ "simd/convert_rgb_to_yuv_ssse3.asm", + "simd/convert_yuv_to_rgb_mmx.asm", "simd/convert_yuv_to_rgb_sse.asm", "simd/convert_yuva_to_argb_mmx.asm", "simd/empty_register_state_mmx.asm", diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/media.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/media.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/media.cc 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/media.cc 2016-07-17 18:06:36.080790050 +0200 @@ -11,6 +11,8 @@ #include "base/synchronization/lock.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" +#include "media/base/sinc_resampler.h" +#include "media/base/vector_math.h" #include "media/base/yuv_convert.h" #if !defined(MEDIA_DISABLE_FFMPEG) @@ -29,6 +31,8 @@ TRACE_EVENT_WARMUP_CATEGORY("media"); // Perform initialization of libraries which require runtime CPU detection. + vector_math::Initialize(); + SincResampler::InitializeCPUSpecificFeatures(); InitializeCPUSpecificYUVConversions(); #if !defined(MEDIA_DISABLE_FFMPEG) diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb.h qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb.h --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb.h 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb.h 2016-07-17 19:32:39.210872688 +0200 @@ -65,6 +65,17 @@ int rgbstride, YUVType yuv_type); +MEDIA_EXPORT void ConvertYUVToRGB32_MMX(const uint8_t* yplane, + const uint8_t* uplane, + const uint8_t* vplane, + uint8_t* rgbframe, + int width, + int height, + int ystride, + int uvstride, + int rgbstride, + YUVType yuv_type); + MEDIA_EXPORT void ConvertYUVAToARGB_MMX(const uint8_t* yplane, const uint8_t* uplane, const uint8_t* vplane, @@ -124,6 +135,13 @@ ptrdiff_t width, const int16_t* convert_table); +MEDIA_EXPORT void ConvertYUVToRGB32Row_MMX(const uint8_t* yplane, + const uint8_t* uplane, + const uint8_t* vplane, + uint8_t* rgbframe, + ptrdiff_t width, + const int16_t* convert_table); + MEDIA_EXPORT void ConvertYUVToRGB32Row_SSE(const uint8_t* yplane, const uint8_t* uplane, const uint8_t* vplane, @@ -131,6 +149,14 @@ ptrdiff_t width, const int16_t* convert_table); +MEDIA_EXPORT void ScaleYUVToRGB32Row_MMX(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, + uint8_t* rgb_buf, + ptrdiff_t width, + ptrdiff_t source_dx, + const int16_t* convert_table); + MEDIA_EXPORT void ScaleYUVToRGB32Row_SSE(const uint8_t* y_buf, const uint8_t* u_buf, const uint8_t* v_buf, @@ -147,6 +173,14 @@ ptrdiff_t source_dx, const int16_t* convert_table); +MEDIA_EXPORT void LinearScaleYUVToRGB32Row_MMX(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, + uint8_t* rgb_buf, + ptrdiff_t width, + ptrdiff_t source_dx, + const int16_t* convert_table); + MEDIA_EXPORT void LinearScaleYUVToRGB32Row_SSE(const uint8_t* y_buf, const uint8_t* u_buf, const uint8_t* v_buf, diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_mmx.asm qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_mmx.asm --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_mmx.asm 1970-01-01 01:00:00.000000000 +0100 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_mmx.asm 2016-07-17 18:06:36.101790164 +0200 @@ -0,0 +1,23 @@ +; Copyright (c) 2011 The Chromium Authors. All rights reserved. +; Use of this source code is governed by a BSD-style license that can be +; found in the LICENSE file. + +%include "third_party/x86inc/x86inc.asm" + +; +; This file uses MMX instructions. +; + SECTION_TEXT + CPU MMX + +; Use movq to save the output. +%define MOVQ movq + +; extern "C" void ConvertYUVToRGB32Row_MMX(const uint8* y_buf, +; const uint8* u_buf, +; const uint8* v_buf, +; uint8* rgb_buf, +; ptrdiff_t width, +; const int16* convert_table); +%define SYMBOL ConvertYUVToRGB32Row_MMX +%include "convert_yuv_to_rgb_mmx.inc" diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_x86.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_x86.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_x86.cc 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_x86.cc 2016-07-17 19:36:04.063964591 +0200 @@ -47,6 +47,34 @@ EmptyRegisterState(); } +void ConvertYUVToRGB32_MMX(const uint8_t* yplane, + const uint8_t* uplane, + const uint8_t* vplane, + uint8_t* rgbframe, + int width, + int height, + int ystride, + int uvstride, + int rgbstride, + YUVType yuv_type) { + unsigned int y_shift = GetVerticalShift(yuv_type); + for (int y = 0; y < height; ++y) { + uint8_t* rgb_row = rgbframe + y * rgbstride; + const uint8_t* y_ptr = yplane + y * ystride; + const uint8_t* u_ptr = uplane + (y >> y_shift) * uvstride; + const uint8_t* v_ptr = vplane + (y >> y_shift) * uvstride; + + ConvertYUVToRGB32Row_MMX(y_ptr, + u_ptr, + v_ptr, + rgb_row, + width, + GetLookupTable(yuv_type)); + } + + EmptyRegisterState(); +} + void ConvertYUVToRGB32_SSE(const uint8_t* yplane, const uint8_t* uplane, const uint8_t* vplane, diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/simd/filter_yuv.h qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/simd/filter_yuv.h --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/simd/filter_yuv.h 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/simd/filter_yuv.h 2016-07-17 19:37:17.605356580 +0200 @@ -20,6 +20,12 @@ int source_width, uint8_t source_y_fraction); +MEDIA_EXPORT void FilterYUVRows_MMX(uint8_t* ybuf, + const uint8_t* y0_ptr, + const uint8_t* y1_ptr, + int source_width, + uint8_t source_y_fraction); + MEDIA_EXPORT void FilterYUVRows_SSE2(uint8_t* ybuf, const uint8_t* y0_ptr, const uint8_t* y1_ptr, diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/simd/filter_yuv_mmx.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/simd/filter_yuv_mmx.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/simd/filter_yuv_mmx.cc 1970-01-01 01:00:00.000000000 +0100 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/simd/filter_yuv_mmx.cc 2016-07-17 19:37:56.249562560 +0200 @@ -0,0 +1,79 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#if defined(_MSC_VER) +#include +#else +#include +#endif + +#include "build/build_config.h" +#include "media/base/simd/filter_yuv.h" + +namespace media { + +#if defined(COMPILER_MSVC) +// Warning 4799 is about calling emms before the function exits. +// We calls emms in a frame level so suppress this warning. +#pragma warning(push) +#pragma warning(disable: 4799) +#endif + +void FilterYUVRows_MMX(uint8_t* dest, + const uint8_t* src0, + const uint8_t* src1, + int width, + uint8_t fraction) { + int pixel = 0; + + // Process the unaligned bytes first. + int unaligned_width = + (8 - (reinterpret_cast(dest) & 7)) & 7; + while (pixel < width && pixel < unaligned_width) { + dest[pixel] = (src0[pixel] * (256 - fraction) + + src1[pixel] * fraction) >> 8; + ++pixel; + } + + __m64 zero = _mm_setzero_si64(); + __m64 src1_fraction = _mm_set1_pi16(fraction); + __m64 src0_fraction = _mm_set1_pi16(256 - fraction); + const __m64* src0_64 = reinterpret_cast(src0 + pixel); + const __m64* src1_64 = reinterpret_cast(src1 + pixel); + __m64* dest64 = reinterpret_cast<__m64*>(dest + pixel); + __m64* end64 = reinterpret_cast<__m64*>( + reinterpret_cast(dest + width) & ~7); + + while (dest64 < end64) { + __m64 src0 = *src0_64++; + __m64 src1 = *src1_64++; + __m64 src2 = _mm_unpackhi_pi8(src0, zero); + __m64 src3 = _mm_unpackhi_pi8(src1, zero); + src0 = _mm_unpacklo_pi8(src0, zero); + src1 = _mm_unpacklo_pi8(src1, zero); + src0 = _mm_mullo_pi16(src0, src0_fraction); + src1 = _mm_mullo_pi16(src1, src1_fraction); + src2 = _mm_mullo_pi16(src2, src0_fraction); + src3 = _mm_mullo_pi16(src3, src1_fraction); + src0 = _mm_add_pi16(src0, src1); + src2 = _mm_add_pi16(src2, src3); + src0 = _mm_srli_pi16(src0, 8); + src2 = _mm_srli_pi16(src2, 8); + src0 = _mm_packs_pu16(src0, src2); + *dest64++ = src0; + pixel += 8; + } + + while (pixel < width) { + dest[pixel] = (src0[pixel] * (256 - fraction) + + src1[pixel] * fraction) >> 8; + ++pixel; + } +} + +#if defined(COMPILER_MSVC) +#pragma warning(pop) +#endif + +} // namespace media diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/simd/sinc_resampler_sse.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/simd/sinc_resampler_sse.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/simd/sinc_resampler_sse.cc 1970-01-01 01:00:00.000000000 +0100 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/simd/sinc_resampler_sse.cc 2016-07-17 18:06:36.111790219 +0200 @@ -0,0 +1,50 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "media/base/sinc_resampler.h" + +#include + +namespace media { + +float SincResampler::Convolve_SSE(const float* input_ptr, const float* k1, + const float* k2, + double kernel_interpolation_factor) { + __m128 m_input; + __m128 m_sums1 = _mm_setzero_ps(); + __m128 m_sums2 = _mm_setzero_ps(); + + // Based on |input_ptr| alignment, we need to use loadu or load. Unrolling + // these loops hurt performance in local testing. + if (reinterpret_cast(input_ptr) & 0x0F) { + for (int i = 0; i < kKernelSize; i += 4) { + m_input = _mm_loadu_ps(input_ptr + i); + m_sums1 = _mm_add_ps(m_sums1, _mm_mul_ps(m_input, _mm_load_ps(k1 + i))); + m_sums2 = _mm_add_ps(m_sums2, _mm_mul_ps(m_input, _mm_load_ps(k2 + i))); + } + } else { + for (int i = 0; i < kKernelSize; i += 4) { + m_input = _mm_load_ps(input_ptr + i); + m_sums1 = _mm_add_ps(m_sums1, _mm_mul_ps(m_input, _mm_load_ps(k1 + i))); + m_sums2 = _mm_add_ps(m_sums2, _mm_mul_ps(m_input, _mm_load_ps(k2 + i))); + } + } + + // Linearly interpolate the two "convolutions". + m_sums1 = _mm_mul_ps(m_sums1, _mm_set_ps1( + static_cast(1.0 - kernel_interpolation_factor))); + m_sums2 = _mm_mul_ps(m_sums2, _mm_set_ps1( + static_cast(kernel_interpolation_factor))); + m_sums1 = _mm_add_ps(m_sums1, m_sums2); + + // Sum components together. + float result; + m_sums2 = _mm_add_ps(_mm_movehl_ps(m_sums1, m_sums1), m_sums1); + _mm_store_ss(&result, _mm_add_ss(m_sums2, _mm_shuffle_ps( + m_sums2, m_sums2, 1))); + + return result; +} + +} // namespace media diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/simd/vector_math_sse.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/simd/vector_math_sse.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/simd/vector_math_sse.cc 1970-01-01 01:00:00.000000000 +0100 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/simd/vector_math_sse.cc 2016-07-17 18:06:36.112790224 +0200 @@ -0,0 +1,118 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "media/base/vector_math_testing.h" + +#include + +#include // NOLINT + +namespace media { +namespace vector_math { + +void FMUL_SSE(const float src[], float scale, int len, float dest[]) { + const int rem = len % 4; + const int last_index = len - rem; + __m128 m_scale = _mm_set_ps1(scale); + for (int i = 0; i < last_index; i += 4) + _mm_store_ps(dest + i, _mm_mul_ps(_mm_load_ps(src + i), m_scale)); + + // Handle any remaining values that wouldn't fit in an SSE pass. + for (int i = last_index; i < len; ++i) + dest[i] = src[i] * scale; +} + +void FMAC_SSE(const float src[], float scale, int len, float dest[]) { + const int rem = len % 4; + const int last_index = len - rem; + __m128 m_scale = _mm_set_ps1(scale); + for (int i = 0; i < last_index; i += 4) { + _mm_store_ps(dest + i, _mm_add_ps(_mm_load_ps(dest + i), + _mm_mul_ps(_mm_load_ps(src + i), m_scale))); + } + + // Handle any remaining values that wouldn't fit in an SSE pass. + for (int i = last_index; i < len; ++i) + dest[i] += src[i] * scale; +} + +// Convenience macro to extract float 0 through 3 from the vector |a|. This is +// needed because compilers other than clang don't support access via +// operator[](). +#define EXTRACT_FLOAT(a, i) \ + (i == 0 ? \ + _mm_cvtss_f32(a) : \ + _mm_cvtss_f32(_mm_shuffle_ps(a, a, i))) + +std::pair EWMAAndMaxPower_SSE( + float initial_value, const float src[], int len, float smoothing_factor) { + // When the recurrence is unrolled, we see that we can split it into 4 + // separate lanes of evaluation: + // + // y[n] = a(S[n]^2) + (1-a)(y[n-1]) + // = a(S[n]^2) + (1-a)^1(aS[n-1]^2) + (1-a)^2(aS[n-2]^2) + ... + // = z[n] + (1-a)^1(z[n-1]) + (1-a)^2(z[n-2]) + (1-a)^3(z[n-3]) + // + // where z[n] = a(S[n]^2) + (1-a)^4(z[n-4]) + (1-a)^8(z[n-8]) + ... + // + // Thus, the strategy here is to compute z[n], z[n-1], z[n-2], and z[n-3] in + // each of the 4 lanes, and then combine them to give y[n]. + + const int rem = len % 4; + const int last_index = len - rem; + + const __m128 smoothing_factor_x4 = _mm_set_ps1(smoothing_factor); + const float weight_prev = 1.0f - smoothing_factor; + const __m128 weight_prev_x4 = _mm_set_ps1(weight_prev); + const __m128 weight_prev_squared_x4 = + _mm_mul_ps(weight_prev_x4, weight_prev_x4); + const __m128 weight_prev_4th_x4 = + _mm_mul_ps(weight_prev_squared_x4, weight_prev_squared_x4); + + // Compute z[n], z[n-1], z[n-2], and z[n-3] in parallel in lanes 3, 2, 1 and + // 0, respectively. + __m128 max_x4 = _mm_setzero_ps(); + __m128 ewma_x4 = _mm_setr_ps(0.0f, 0.0f, 0.0f, initial_value); + int i; + for (i = 0; i < last_index; i += 4) { + ewma_x4 = _mm_mul_ps(ewma_x4, weight_prev_4th_x4); + const __m128 sample_x4 = _mm_load_ps(src + i); + const __m128 sample_squared_x4 = _mm_mul_ps(sample_x4, sample_x4); + max_x4 = _mm_max_ps(max_x4, sample_squared_x4); + // Note: The compiler optimizes this to a single multiply-and-accumulate + // instruction: + ewma_x4 = _mm_add_ps(ewma_x4, + _mm_mul_ps(sample_squared_x4, smoothing_factor_x4)); + } + + // y[n] = z[n] + (1-a)^1(z[n-1]) + (1-a)^2(z[n-2]) + (1-a)^3(z[n-3]) + float ewma = EXTRACT_FLOAT(ewma_x4, 3); + ewma_x4 = _mm_mul_ps(ewma_x4, weight_prev_x4); + ewma += EXTRACT_FLOAT(ewma_x4, 2); + ewma_x4 = _mm_mul_ps(ewma_x4, weight_prev_x4); + ewma += EXTRACT_FLOAT(ewma_x4, 1); + ewma_x4 = _mm_mul_ss(ewma_x4, weight_prev_x4); + ewma += EXTRACT_FLOAT(ewma_x4, 0); + + // Fold the maximums together to get the overall maximum. + max_x4 = _mm_max_ps(max_x4, + _mm_shuffle_ps(max_x4, max_x4, _MM_SHUFFLE(3, 3, 1, 1))); + max_x4 = _mm_max_ss(max_x4, _mm_shuffle_ps(max_x4, max_x4, 2)); + + std::pair result(ewma, EXTRACT_FLOAT(max_x4, 0)); + + // Handle remaining values at the end of |src|. + for (; i < len; ++i) { + result.first *= weight_prev; + const float sample = src[i]; + const float sample_squared = sample * sample; + result.first += sample_squared * smoothing_factor; + result.second = std::max(result.second, sample_squared); + } + + return result; +} + +} // namespace vector_math +} // namespace media diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/sinc_resampler.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/sinc_resampler.cc 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler.cc 2016-07-17 19:40:18.772322232 +0200 @@ -81,17 +81,12 @@ #include #include +#include "base/cpu.h" #include "base/logging.h" #include "build/build_config.h" -#if defined(ARCH_CPU_X86_FAMILY) -#include -#define CONVOLVE_FUNC Convolve_SSE -#elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON) +#if defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON) #include -#define CONVOLVE_FUNC Convolve_NEON -#else -#define CONVOLVE_FUNC Convolve_C #endif namespace media { @@ -112,10 +107,41 @@ return sinc_scale_factor; } +#undef CONVOLVE_FUNC + static int CalculateChunkSize(int block_size_, double io_ratio) { return block_size_ / io_ratio; } +// If we know the minimum architecture at compile time, avoid CPU detection. +// Force NaCl code to use C routines since (at present) nothing there uses these +// methods and plumbing the -msse built library is non-trivial. +#if defined(ARCH_CPU_X86_FAMILY) && !defined(OS_NACL) +#if defined(__SSE__) +#define CONVOLVE_FUNC Convolve_SSE +void SincResampler::InitializeCPUSpecificFeatures() {} +#else +// X86 CPU detection required. Functions will be set by +// InitializeCPUSpecificFeatures(). +#define CONVOLVE_FUNC g_convolve_proc_ + +typedef float (*ConvolveProc)(const float*, const float*, const float*, double); +static ConvolveProc g_convolve_proc_ = NULL; + +void SincResampler::InitializeCPUSpecificFeatures() { + CHECK(!g_convolve_proc_); + g_convolve_proc_ = base::CPU().has_sse() ? Convolve_SSE : Convolve_C; +} +#endif +#elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON) +#define CONVOLVE_FUNC Convolve_NEON +void SincResampler::InitializeCPUSpecificFeatures() {} +#else +// Unknown architecture. +#define CONVOLVE_FUNC Convolve_C +void SincResampler::InitializeCPUSpecificFeatures() {} +#endif + SincResampler::SincResampler(double io_sample_rate_ratio, int request_frames, const ReadCB& read_cb) @@ -343,46 +369,7 @@ kernel_interpolation_factor * sum2); } -#if defined(ARCH_CPU_X86_FAMILY) -float SincResampler::Convolve_SSE(const float* input_ptr, const float* k1, - const float* k2, - double kernel_interpolation_factor) { - __m128 m_input; - __m128 m_sums1 = _mm_setzero_ps(); - __m128 m_sums2 = _mm_setzero_ps(); - - // Based on |input_ptr| alignment, we need to use loadu or load. Unrolling - // these loops hurt performance in local testing. - if (reinterpret_cast(input_ptr) & 0x0F) { - for (int i = 0; i < kKernelSize; i += 4) { - m_input = _mm_loadu_ps(input_ptr + i); - m_sums1 = _mm_add_ps(m_sums1, _mm_mul_ps(m_input, _mm_load_ps(k1 + i))); - m_sums2 = _mm_add_ps(m_sums2, _mm_mul_ps(m_input, _mm_load_ps(k2 + i))); - } - } else { - for (int i = 0; i < kKernelSize; i += 4) { - m_input = _mm_load_ps(input_ptr + i); - m_sums1 = _mm_add_ps(m_sums1, _mm_mul_ps(m_input, _mm_load_ps(k1 + i))); - m_sums2 = _mm_add_ps(m_sums2, _mm_mul_ps(m_input, _mm_load_ps(k2 + i))); - } - } - - // Linearly interpolate the two "convolutions". - m_sums1 = _mm_mul_ps(m_sums1, _mm_set_ps1( - static_cast(1.0 - kernel_interpolation_factor))); - m_sums2 = _mm_mul_ps(m_sums2, _mm_set_ps1( - static_cast(kernel_interpolation_factor))); - m_sums1 = _mm_add_ps(m_sums1, m_sums2); - - // Sum components together. - float result; - m_sums2 = _mm_add_ps(_mm_movehl_ps(m_sums1, m_sums1), m_sums1); - _mm_store_ss(&result, _mm_add_ss(m_sums2, _mm_shuffle_ps( - m_sums2, m_sums2, 1))); - - return result; -} -#elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON) +#if defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON) float SincResampler::Convolve_NEON(const float* input_ptr, const float* k1, const float* k2, double kernel_interpolation_factor) { diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/sinc_resampler.h qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler.h --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/sinc_resampler.h 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler.h 2016-07-17 18:06:36.163790503 +0200 @@ -35,6 +35,10 @@ kKernelStorageSize = kKernelSize * (kKernelOffsetCount + 1), }; + // Selects runtime specific CPU features like SSE. Must be called before + // using SincResampler. + static void InitializeCPUSpecificFeatures(); + // Callback type for providing more data into the resampler. Expects |frames| // of data to be rendered into |destination|; zero padded if not enough frames // are available to satisfy the request. diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/sinc_resampler_perftest.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler_perftest.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/sinc_resampler_perftest.cc 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler_perftest.cc 2016-07-17 18:06:36.171790546 +0200 @@ -4,6 +4,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/cpu.h" #include "base/time/time.h" #include "build/build_config.h" #include "media/base/sinc_resampler.h" @@ -61,6 +62,9 @@ &resampler, SincResampler::Convolve_C, true, "unoptimized_aligned"); #if defined(CONVOLVE_FUNC) +#if defined(ARCH_CPU_X86_FAMILY) + ASSERT_TRUE(base::CPU().has_sse()); +#endif RunConvolveBenchmark( &resampler, SincResampler::CONVOLVE_FUNC, true, "optimized_aligned"); RunConvolveBenchmark( diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/sinc_resampler_unittest.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler_unittest.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/sinc_resampler_unittest.cc 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler_unittest.cc 2016-07-17 19:41:45.620785149 +0200 @@ -9,6 +9,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/cpu.h" #include "base/macros.h" #include "base/strings/string_number_conversions.h" #include "base/time/time.h" @@ -164,6 +165,10 @@ static const double kKernelInterpolationFactor = 0.5; TEST(SincResamplerTest, Convolve) { +#if defined(ARCH_CPU_X86_FAMILY) + ASSERT_TRUE(base::CPU().has_sse()); +#endif + // Initialize a dummy resampler. MockSource mock_source; SincResampler resampler( diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/vector_math.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/vector_math.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/vector_math.cc 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/vector_math.cc 2016-07-17 18:06:36.173790557 +0200 @@ -7,12 +7,17 @@ #include +#include "base/cpu.h" #include "base/logging.h" #include "build/build_config.h" +namespace media { +namespace vector_math { + +// If we know the minimum architecture at compile time, avoid CPU detection. // NaCl does not allow intrinsics. #if defined(ARCH_CPU_X86_FAMILY) && !defined(OS_NACL) -#include +#if defined(__SSE__) // Don't use custom SSE versions where the auto-vectorized C version performs // better, which is anywhere clang is used. #if !defined(__clang__) @@ -23,20 +28,52 @@ #define FMUL_FUNC FMUL_C #endif #define EWMAAndMaxPower_FUNC EWMAAndMaxPower_SSE +void Initialize() {} +#else +// X86 CPU detection required. Functions will be set by Initialize(). +#if !defined(__clang__) +#define FMAC_FUNC g_fmac_proc_ +#define FMUL_FUNC g_fmul_proc_ +#else +#define FMAC_FUNC FMAC_C +#define FMUL_FUNC FMUL_C +#endif +#define EWMAAndMaxPower_FUNC g_ewma_power_proc_ + +#if !defined(__clang__) +typedef void (*MathProc)(const float src[], float scale, int len, float dest[]); +static MathProc g_fmac_proc_ = NULL; +static MathProc g_fmul_proc_ = NULL; +#endif +typedef std::pair (*EWMAAndMaxPowerProc)( + float initial_value, const float src[], int len, float smoothing_factor); +static EWMAAndMaxPowerProc g_ewma_power_proc_ = NULL; + +void Initialize() { + CHECK(!g_fmac_proc_); + CHECK(!g_fmul_proc_); + CHECK(!g_ewma_power_proc_); + const bool kUseSSE = base::CPU().has_sse(); +#if !defined(__clang__) + g_fmac_proc_ = kUseSSE ? FMAC_SSE : FMAC_C; + g_fmul_proc_ = kUseSSE ? FMUL_SSE : FMUL_C; +#endif + g_ewma_power_proc_ = kUseSSE ? EWMAAndMaxPower_SSE : EWMAAndMaxPower_C; +} +#endif #elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON) #include #define FMAC_FUNC FMAC_NEON #define FMUL_FUNC FMUL_NEON #define EWMAAndMaxPower_FUNC EWMAAndMaxPower_NEON +void Initialize() {} #else #define FMAC_FUNC FMAC_C #define FMUL_FUNC FMUL_C #define EWMAAndMaxPower_FUNC EWMAAndMaxPower_C +void Initialize() {} #endif -namespace media { -namespace vector_math { - void FMAC(const float src[], float scale, int len, float dest[]) { // Ensure |src| and |dest| are 16-byte aligned. DCHECK_EQ(0u, reinterpret_cast(src) & (kRequiredAlignment - 1)); @@ -89,111 +126,6 @@ return result; } -#if defined(ARCH_CPU_X86_FAMILY) && !defined(OS_NACL) -void FMUL_SSE(const float src[], float scale, int len, float dest[]) { - const int rem = len % 4; - const int last_index = len - rem; - __m128 m_scale = _mm_set_ps1(scale); - for (int i = 0; i < last_index; i += 4) - _mm_store_ps(dest + i, _mm_mul_ps(_mm_load_ps(src + i), m_scale)); - - // Handle any remaining values that wouldn't fit in an SSE pass. - for (int i = last_index; i < len; ++i) - dest[i] = src[i] * scale; -} - -void FMAC_SSE(const float src[], float scale, int len, float dest[]) { - const int rem = len % 4; - const int last_index = len - rem; - __m128 m_scale = _mm_set_ps1(scale); - for (int i = 0; i < last_index; i += 4) { - _mm_store_ps(dest + i, _mm_add_ps(_mm_load_ps(dest + i), - _mm_mul_ps(_mm_load_ps(src + i), m_scale))); - } - - // Handle any remaining values that wouldn't fit in an SSE pass. - for (int i = last_index; i < len; ++i) - dest[i] += src[i] * scale; -} - -// Convenience macro to extract float 0 through 3 from the vector |a|. This is -// needed because compilers other than clang don't support access via -// operator[](). -#define EXTRACT_FLOAT(a, i) \ - (i == 0 ? \ - _mm_cvtss_f32(a) : \ - _mm_cvtss_f32(_mm_shuffle_ps(a, a, i))) - -std::pair EWMAAndMaxPower_SSE( - float initial_value, const float src[], int len, float smoothing_factor) { - // When the recurrence is unrolled, we see that we can split it into 4 - // separate lanes of evaluation: - // - // y[n] = a(S[n]^2) + (1-a)(y[n-1]) - // = a(S[n]^2) + (1-a)^1(aS[n-1]^2) + (1-a)^2(aS[n-2]^2) + ... - // = z[n] + (1-a)^1(z[n-1]) + (1-a)^2(z[n-2]) + (1-a)^3(z[n-3]) - // - // where z[n] = a(S[n]^2) + (1-a)^4(z[n-4]) + (1-a)^8(z[n-8]) + ... - // - // Thus, the strategy here is to compute z[n], z[n-1], z[n-2], and z[n-3] in - // each of the 4 lanes, and then combine them to give y[n]. - - const int rem = len % 4; - const int last_index = len - rem; - - const __m128 smoothing_factor_x4 = _mm_set_ps1(smoothing_factor); - const float weight_prev = 1.0f - smoothing_factor; - const __m128 weight_prev_x4 = _mm_set_ps1(weight_prev); - const __m128 weight_prev_squared_x4 = - _mm_mul_ps(weight_prev_x4, weight_prev_x4); - const __m128 weight_prev_4th_x4 = - _mm_mul_ps(weight_prev_squared_x4, weight_prev_squared_x4); - - // Compute z[n], z[n-1], z[n-2], and z[n-3] in parallel in lanes 3, 2, 1 and - // 0, respectively. - __m128 max_x4 = _mm_setzero_ps(); - __m128 ewma_x4 = _mm_setr_ps(0.0f, 0.0f, 0.0f, initial_value); - int i; - for (i = 0; i < last_index; i += 4) { - ewma_x4 = _mm_mul_ps(ewma_x4, weight_prev_4th_x4); - const __m128 sample_x4 = _mm_load_ps(src + i); - const __m128 sample_squared_x4 = _mm_mul_ps(sample_x4, sample_x4); - max_x4 = _mm_max_ps(max_x4, sample_squared_x4); - // Note: The compiler optimizes this to a single multiply-and-accumulate - // instruction: - ewma_x4 = _mm_add_ps(ewma_x4, - _mm_mul_ps(sample_squared_x4, smoothing_factor_x4)); - } - - // y[n] = z[n] + (1-a)^1(z[n-1]) + (1-a)^2(z[n-2]) + (1-a)^3(z[n-3]) - float ewma = EXTRACT_FLOAT(ewma_x4, 3); - ewma_x4 = _mm_mul_ps(ewma_x4, weight_prev_x4); - ewma += EXTRACT_FLOAT(ewma_x4, 2); - ewma_x4 = _mm_mul_ps(ewma_x4, weight_prev_x4); - ewma += EXTRACT_FLOAT(ewma_x4, 1); - ewma_x4 = _mm_mul_ss(ewma_x4, weight_prev_x4); - ewma += EXTRACT_FLOAT(ewma_x4, 0); - - // Fold the maximums together to get the overall maximum. - max_x4 = _mm_max_ps(max_x4, - _mm_shuffle_ps(max_x4, max_x4, _MM_SHUFFLE(3, 3, 1, 1))); - max_x4 = _mm_max_ss(max_x4, _mm_shuffle_ps(max_x4, max_x4, 2)); - - std::pair result(ewma, EXTRACT_FLOAT(max_x4, 0)); - - // Handle remaining values at the end of |src|. - for (; i < len; ++i) { - result.first *= weight_prev; - const float sample = src[i]; - const float sample_squared = sample * sample; - result.first += sample_squared * smoothing_factor; - result.second = std::max(result.second, sample_squared); - } - - return result; -} -#endif - #if defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON) void FMAC_NEON(const float src[], float scale, int len, float dest[]) { const int rem = len % 4; diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/vector_math.h qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/vector_math.h --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/vector_math.h 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/vector_math.h 2016-07-17 18:06:36.174790563 +0200 @@ -15,6 +15,11 @@ // Required alignment for inputs and outputs to all vector math functions enum { kRequiredAlignment = 16 }; +// Selects runtime specific optimizations such as SSE. Must be called prior to +// calling FMAC() or FMUL(). Called during media library initialization; most +// users should never have to call this. +MEDIA_EXPORT void Initialize(); + // Multiply each element of |src| (up to |len|) by |scale| and add to |dest|. // |src| and |dest| must be aligned by kRequiredAlignment. MEDIA_EXPORT void FMAC(const float src[], float scale, int len, float dest[]); diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/vector_math_perftest.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/vector_math_perftest.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/vector_math_perftest.cc 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/vector_math_perftest.cc 2016-07-17 19:43:25.736318783 +0200 @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/macros.h" +#include "base/cpu.h" #include "base/memory/aligned_memory.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" @@ -81,15 +82,11 @@ DISALLOW_COPY_AND_ASSIGN(VectorMathPerfTest); }; -// Define platform dependent function names for SIMD optimized methods. +// Define platform independent function name for FMAC* perf tests. #if defined(ARCH_CPU_X86_FAMILY) #define FMAC_FUNC FMAC_SSE -#define FMUL_FUNC FMUL_SSE -#define EWMAAndMaxPower_FUNC EWMAAndMaxPower_SSE #elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON) #define FMAC_FUNC FMAC_NEON -#define FMUL_FUNC FMUL_NEON -#define EWMAAndMaxPower_FUNC EWMAAndMaxPower_NEON #endif // Benchmark for each optimized vector_math::FMAC() method. @@ -98,6 +95,9 @@ RunBenchmark( vector_math::FMAC_C, true, "vector_math_fmac", "unoptimized"); #if defined(FMAC_FUNC) +#if defined(ARCH_CPU_X86_FAMILY) + ASSERT_TRUE(base::CPU().has_sse()); +#endif // Benchmark FMAC_FUNC() with unaligned size. ASSERT_NE((kVectorSize - 1) % (vector_math::kRequiredAlignment / sizeof(float)), 0U); @@ -111,12 +111,24 @@ #endif } +#undef FMAC_FUNC + +// Define platform independent function name for FMULBenchmark* tests. +#if defined(ARCH_CPU_X86_FAMILY) +#define FMUL_FUNC FMUL_SSE +#elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON) +#define FMUL_FUNC FMUL_NEON +#endif + // Benchmark for each optimized vector_math::FMUL() method. TEST_F(VectorMathPerfTest, FMUL) { // Benchmark FMUL_C(). RunBenchmark( vector_math::FMUL_C, true, "vector_math_fmul", "unoptimized"); #if defined(FMUL_FUNC) +#if defined(ARCH_CPU_X86_FAMILY) + ASSERT_TRUE(base::CPU().has_sse()); +#endif // Benchmark FMUL_FUNC() with unaligned size. ASSERT_NE((kVectorSize - 1) % (vector_math::kRequiredAlignment / sizeof(float)), 0U); @@ -130,6 +142,14 @@ #endif } +#undef FMUL_FUNC + +#if defined(ARCH_CPU_X86_FAMILY) +#define EWMAAndMaxPower_FUNC EWMAAndMaxPower_SSE +#elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON) +#define EWMAAndMaxPower_FUNC EWMAAndMaxPower_NEON +#endif + // Benchmark for each optimized vector_math::EWMAAndMaxPower() method. TEST_F(VectorMathPerfTest, EWMAAndMaxPower) { // Benchmark EWMAAndMaxPower_C(). @@ -138,6 +158,9 @@ "vector_math_ewma_and_max_power", "unoptimized"); #if defined(EWMAAndMaxPower_FUNC) +#if defined(ARCH_CPU_X86_FAMILY) + ASSERT_TRUE(base::CPU().has_sse()); +#endif // Benchmark EWMAAndMaxPower_FUNC() with unaligned size. ASSERT_NE((kVectorSize - 1) % (vector_math::kRequiredAlignment / sizeof(float)), 0U); @@ -155,4 +178,6 @@ #endif } +#undef EWMAAndMaxPower_FUNC + } // namespace media diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/vector_math_testing.h qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/vector_math_testing.h --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/vector_math_testing.h 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/vector_math_testing.h 2016-07-17 18:06:36.193790666 +0200 @@ -19,7 +19,7 @@ MEDIA_EXPORT std::pair EWMAAndMaxPower_C( float initial_value, const float src[], int len, float smoothing_factor); -#if defined(ARCH_CPU_X86_FAMILY) && !defined(OS_NACL) +#if defined(ARCH_CPU_X86_FAMILY) MEDIA_EXPORT void FMAC_SSE(const float src[], float scale, int len, float dest[]); MEDIA_EXPORT void FMUL_SSE(const float src[], float scale, int len, diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/vector_math_unittest.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/vector_math_unittest.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/vector_math_unittest.cc 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/vector_math_unittest.cc 2016-07-17 19:44:10.094555220 +0200 @@ -7,6 +7,7 @@ #include #include "base/macros.h" +#include "base/cpu.h" #include "base/memory/aligned_memory.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string_number_conversions.h" @@ -77,6 +78,7 @@ #if defined(ARCH_CPU_X86_FAMILY) { + ASSERT_TRUE(base::CPU().has_sse()); SCOPED_TRACE("FMAC_SSE"); FillTestVectors(kInputFillValue, kOutputFillValue); vector_math::FMAC_SSE( @@ -118,6 +120,7 @@ #if defined(ARCH_CPU_X86_FAMILY) { + ASSERT_TRUE(base::CPU().has_sse()); SCOPED_TRACE("FMUL_SSE"); FillTestVectors(kInputFillValue, kOutputFillValue); vector_math::FMUL_SSE( @@ -226,6 +229,7 @@ #if defined(ARCH_CPU_X86_FAMILY) { + ASSERT_TRUE(base::CPU().has_sse()); SCOPED_TRACE("EWMAAndMaxPower_SSE"); const std::pair& result = vector_math::EWMAAndMaxPower_SSE( initial_value_, data_.get(), data_len_, smoothing_factor_); diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/yuv_convert.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/yuv_convert.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/yuv_convert.cc 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/yuv_convert.cc 2016-07-17 18:06:36.196790682 +0200 @@ -33,7 +33,7 @@ #include "media/base/simd/convert_yuv_to_rgb.h" #include "media/base/simd/filter_yuv.h" -#if defined(ARCH_CPU_X86_FAMILY) +#if defined(ARCH_CPU_X86_FAMILY) && defined(__MMX__) #if defined(COMPILER_MSVC) #include #else @@ -134,7 +134,7 @@ // Empty SIMD registers state after using them. void EmptyRegisterStateStub() {} -#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) +#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) && defined(__MMX__) void EmptyRegisterStateIntrinsic() { _mm_empty(); } #endif typedef void (*EmptyRegisterStateProc)(); @@ -248,34 +248,46 @@ // Assembly code confuses MemorySanitizer. Also not available in iOS builds. #if defined(ARCH_CPU_X86_FAMILY) && !defined(MEMORY_SANITIZER) && \ !defined(OS_IOS) - g_convert_yuva_to_argb_proc_ = ConvertYUVAToARGB_MMX; + base::CPU cpu; + if (cpu.has_mmx()) { + g_convert_yuv_to_rgb32_row_proc_ = ConvertYUVToRGB32Row_MMX; + g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_MMX; + g_convert_yuv_to_rgb32_proc_ = ConvertYUVToRGB32_MMX; + g_convert_yuva_to_argb_proc_ = ConvertYUVAToARGB_MMX; + g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_MMX; #if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) - g_empty_register_state_proc_ = EmptyRegisterStateIntrinsic; + g_filter_yuv_rows_proc_ = FilterYUVRows_MMX; +#endif +#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) && defined(__MMX__) + g_empty_register_state_proc_ = EmptyRegisterStateIntrinsic; #else - g_empty_register_state_proc_ = EmptyRegisterState_MMX; + g_empty_register_state_proc_ = EmptyRegisterState_MMX; #endif + } - g_convert_yuv_to_rgb32_row_proc_ = ConvertYUVToRGB32Row_SSE; - g_convert_yuv_to_rgb32_proc_ = ConvertYUVToRGB32_SSE; + if (cpu.has_sse()) { + g_convert_yuv_to_rgb32_row_proc_ = ConvertYUVToRGB32Row_SSE; + g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE; + g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_SSE; + g_convert_yuv_to_rgb32_proc_ = ConvertYUVToRGB32_SSE; + } - g_filter_yuv_rows_proc_ = FilterYUVRows_SSE2; - g_convert_rgb32_to_yuv_proc_ = ConvertRGB32ToYUV_SSE2; + if (cpu.has_sse2()) { + g_filter_yuv_rows_proc_ = FilterYUVRows_SSE2; + g_convert_rgb32_to_yuv_proc_ = ConvertRGB32ToYUV_SSE2; #if defined(ARCH_CPU_X86_64) - g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE2_X64; + g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE2_X64; - // Technically this should be in the MMX section, but MSVC will optimize out - // the export of LinearScaleYUVToRGB32Row_MMX, which is required by the unit - // tests, if that decision can be made at compile time. Since all X64 CPUs - // have SSE2, we can hack around this by making the selection here. - g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_MMX_X64; -#else - g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE; - g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_SSE; + // Technically this should be in the MMX section, but MSVC will optimize out + // the export of LinearScaleYUVToRGB32Row_MMX, which is required by the unit + // tests, if that decision can be made at compile time. Since all X64 CPUs + // have SSE2, we can hack around this by making the selection here. + g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_MMX_X64; #endif + } - base::CPU cpu; if (cpu.has_ssse3()) { g_convert_rgb24_to_yuv_proc_ = &ConvertRGB24ToYUV_SSSE3; diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/yuv_convert_perftest.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/yuv_convert_perftest.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/yuv_convert_perftest.cc 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/yuv_convert_perftest.cc 2016-07-17 19:48:57.702119844 +0200 @@ -69,6 +69,29 @@ DISALLOW_COPY_AND_ASSIGN(YUVConvertPerfTest); }; +TEST_F(YUVConvertPerfTest, ConvertYUVToRGB32Row_MMX) { + ASSERT_TRUE(base::CPU().has_mmx()); + + base::TimeTicks start = base::TimeTicks::Now(); + for (int i = 0; i < kPerfTestIterations; ++i) { + for (int row = 0; row < kSourceHeight; ++row) { + int chroma_row = row / 2; + ConvertYUVToRGB32Row_MMX( + yuv_bytes_.get() + row * kSourceWidth, + yuv_bytes_.get() + kSourceUOffset + (chroma_row * kSourceWidth / 2), + yuv_bytes_.get() + kSourceVOffset + (chroma_row * kSourceWidth / 2), + rgb_bytes_converted_.get(), + kWidth, + GetLookupTable(YV12)); + } + } + media::EmptyRegisterState(); + double total_time_seconds = (base::TimeTicks::Now() - start).InSecondsF(); + perf_test::PrintResult( + "yuv_convert_perftest", "", "ConvertYUVToRGB32Row_MMX", + kPerfTestIterations / total_time_seconds, "runs/s", true); +} + TEST_F(YUVConvertPerfTest, ConvertYUVToRGB32Row_SSE) { ASSERT_TRUE(base::CPU().has_sse()); @@ -159,9 +182,32 @@ } #endif -// 64-bit release + component builds on Windows are too smart and optimizes -// away the function being tested. -#if defined(OS_WIN) && (defined(ARCH_CPU_X86) || !defined(COMPONENT_BUILD)) +TEST_F(YUVConvertPerfTest, ScaleYUVToRGB32Row_MMX) { + ASSERT_TRUE(base::CPU().has_mmx()); + + const int kSourceDx = 80000; // This value means a scale down. + + base::TimeTicks start = base::TimeTicks::Now(); + for (int i = 0; i < kPerfTestIterations; ++i) { + for (int row = 0; row < kSourceHeight; ++row) { + int chroma_row = row / 2; + ScaleYUVToRGB32Row_MMX( + yuv_bytes_.get() + row * kSourceWidth, + yuv_bytes_.get() + kSourceUOffset + (chroma_row * kSourceWidth / 2), + yuv_bytes_.get() + kSourceVOffset + (chroma_row * kSourceWidth / 2), + rgb_bytes_converted_.get(), + kWidth, + kSourceDx, + GetLookupTable(YV12)); + } + } + media::EmptyRegisterState(); + double total_time_seconds = (base::TimeTicks::Now() - start).InSecondsF(); + perf_test::PrintResult( + "yuv_convert_perftest", "", "ScaleYUVToRGB32Row_MMX", + kPerfTestIterations / total_time_seconds, "runs/s", true); +} + TEST_F(YUVConvertPerfTest, ScaleYUVToRGB32Row_SSE) { ASSERT_TRUE(base::CPU().has_sse()); @@ -188,6 +234,32 @@ kPerfTestIterations / total_time_seconds, "runs/s", true); } +TEST_F(YUVConvertPerfTest, LinearScaleYUVToRGB32Row_MMX) { + ASSERT_TRUE(base::CPU().has_mmx()); + + const int kSourceDx = 80000; // This value means a scale down. + + base::TimeTicks start = base::TimeTicks::Now(); + for (int i = 0; i < kPerfTestIterations; ++i) { + for (int row = 0; row < kSourceHeight; ++row) { + int chroma_row = row / 2; + LinearScaleYUVToRGB32Row_MMX( + yuv_bytes_.get() + row * kSourceWidth, + yuv_bytes_.get() + kSourceUOffset + (chroma_row * kSourceWidth / 2), + yuv_bytes_.get() + kSourceVOffset + (chroma_row * kSourceWidth / 2), + rgb_bytes_converted_.get(), + kWidth, + kSourceDx, + GetLookupTable(YV12)); + } + } + media::EmptyRegisterState(); + double total_time_seconds = (base::TimeTicks::Now() - start).InSecondsF(); + perf_test::PrintResult( + "yuv_convert_perftest", "", "LinearScaleYUVToRGB32Row_MMX", + kPerfTestIterations / total_time_seconds, "runs/s", true); +} + TEST_F(YUVConvertPerfTest, LinearScaleYUVToRGB32Row_SSE) { ASSERT_TRUE(base::CPU().has_sse()); @@ -213,7 +285,6 @@ "yuv_convert_perftest", "", "LinearScaleYUVToRGB32Row_SSE", kPerfTestIterations / total_time_seconds, "runs/s", true); } -#endif // defined(OS_WIN) && (ARCH_CPU_X86 || COMPONENT_BUILD) #endif // !defined(ARCH_CPU_ARM_FAMILY) && !defined(ARCH_CPU_MIPS_FAMILY) diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/yuv_convert_unittest.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/yuv_convert_unittest.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/base/yuv_convert_unittest.cc 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/base/yuv_convert_unittest.cc 2016-07-17 18:06:36.201790710 +0200 @@ -635,6 +635,37 @@ EXPECT_EQ(0, error); } +TEST(YUVConvertTest, ConvertYUVToRGB32Row_MMX) { + base::CPU cpu; + if (!cpu.has_mmx()) { + LOG(WARNING) << "System not supported. Test skipped."; + return; + } + + scoped_ptr yuv_bytes(new uint8[kYUV12Size]); + scoped_ptr rgb_bytes_reference(new uint8[kRGBSize]); + scoped_ptr rgb_bytes_converted(new uint8[kRGBSize]); + ReadYV12Data(&yuv_bytes); + + const int kWidth = 167; + ConvertYUVToRGB32Row_C(yuv_bytes.get(), + yuv_bytes.get() + kSourceUOffset, + yuv_bytes.get() + kSourceVOffset, + rgb_bytes_reference.get(), + kWidth, + GetLookupTable(YV12)); + ConvertYUVToRGB32Row_MMX(yuv_bytes.get(), + yuv_bytes.get() + kSourceUOffset, + yuv_bytes.get() + kSourceVOffset, + rgb_bytes_converted.get(), + kWidth, + GetLookupTable(YV12)); + media::EmptyRegisterState(); + EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(), + rgb_bytes_converted.get(), + kWidth * kBpp)); +} + TEST(YUVConvertTest, ConvertYUVToRGB32Row_SSE) { base::CPU cpu; if (!cpu.has_sse()) { @@ -666,9 +697,40 @@ kWidth * kBpp)); } -// 64-bit release + component builds on Windows are too smart and optimizes -// away the function being tested. -#if defined(OS_WIN) && (defined(ARCH_CPU_X86) || !defined(COMPONENT_BUILD)) +TEST(YUVConvertTest, ScaleYUVToRGB32Row_MMX) { + base::CPU cpu; + if (!cpu.has_mmx()) { + LOG(WARNING) << "System not supported. Test skipped."; + return; + } + + scoped_ptr yuv_bytes(new uint8[kYUV12Size]); + scoped_ptr rgb_bytes_reference(new uint8[kRGBSize]); + scoped_ptr rgb_bytes_converted(new uint8[kRGBSize]); + ReadYV12Data(&yuv_bytes); + + const int kWidth = 167; + const int kSourceDx = 80000; // This value means a scale down. + ScaleYUVToRGB32Row_C(yuv_bytes.get(), + yuv_bytes.get() + kSourceUOffset, + yuv_bytes.get() + kSourceVOffset, + rgb_bytes_reference.get(), + kWidth, + kSourceDx, + GetLookupTable(YV12)); + ScaleYUVToRGB32Row_MMX(yuv_bytes.get(), + yuv_bytes.get() + kSourceUOffset, + yuv_bytes.get() + kSourceVOffset, + rgb_bytes_converted.get(), + kWidth, + kSourceDx, + GetLookupTable(YV12)); + media::EmptyRegisterState(); + EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(), + rgb_bytes_converted.get(), + kWidth * kBpp)); +} + TEST(YUVConvertTest, ScaleYUVToRGB32Row_SSE) { base::CPU cpu; if (!cpu.has_sse()) { @@ -703,6 +765,40 @@ kWidth * kBpp)); } +TEST(YUVConvertTest, LinearScaleYUVToRGB32Row_MMX) { + base::CPU cpu; + if (!cpu.has_mmx()) { + LOG(WARNING) << "System not supported. Test skipped."; + return; + } + + scoped_ptr yuv_bytes(new uint8[kYUV12Size]); + scoped_ptr rgb_bytes_reference(new uint8[kRGBSize]); + scoped_ptr rgb_bytes_converted(new uint8[kRGBSize]); + ReadYV12Data(&yuv_bytes); + + const int kWidth = 167; + const int kSourceDx = 80000; // This value means a scale down. + LinearScaleYUVToRGB32Row_C(yuv_bytes.get(), + yuv_bytes.get() + kSourceUOffset, + yuv_bytes.get() + kSourceVOffset, + rgb_bytes_reference.get(), + kWidth, + kSourceDx, + GetLookupTable(YV12)); + LinearScaleYUVToRGB32Row_MMX(yuv_bytes.get(), + yuv_bytes.get() + kSourceUOffset, + yuv_bytes.get() + kSourceVOffset, + rgb_bytes_converted.get(), + kWidth, + kSourceDx, + GetLookupTable(YV12)); + media::EmptyRegisterState(); + EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(), + rgb_bytes_converted.get(), + kWidth * kBpp)); +} + TEST(YUVConvertTest, LinearScaleYUVToRGB32Row_SSE) { base::CPU cpu; if (!cpu.has_sse()) { @@ -736,7 +832,6 @@ rgb_bytes_converted.get(), kWidth * kBpp)); } -#endif // defined(OS_WIN) && (ARCH_CPU_X86 || COMPONENT_BUILD) TEST(YUVConvertTest, FilterYUVRows_C_OutOfBounds) { scoped_ptr src(new uint8_t[16]); @@ -753,6 +848,30 @@ } } +#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) +TEST(YUVConvertTest, FilterYUVRows_MMX_OutOfBounds) { + base::CPU cpu; + if (!cpu.has_mmx()) { + LOG(WARNING) << "System not supported. Test skipped."; + return; + } + + scoped_ptr src(new uint8[16]); + scoped_ptr dst(new uint8[16]); + + memset(src.get(), 0xff, 16); + memset(dst.get(), 0, 16); + + media::FilterYUVRows_MMX(dst.get(), src.get(), src.get(), 1, 255); + media::EmptyRegisterState(); + + EXPECT_EQ(255u, dst[0]); + for (int i = 1; i < 16; ++i) { + EXPECT_EQ(0u, dst[i]); + } +} +#endif // defined(MEDIA_MMX_INTRINSICS_AVAILABLE) + TEST(YUVConvertTest, FilterYUVRows_SSE2_OutOfBounds) { base::CPU cpu; if (!cpu.has_sse2()) { @@ -774,6 +893,38 @@ } } +#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) +TEST(YUVConvertTest, FilterYUVRows_MMX_UnalignedDestination) { + base::CPU cpu; + if (!cpu.has_mmx()) { + LOG(WARNING) << "System not supported. Test skipped."; + return; + } + + const int kSize = 32; + scoped_ptr src(new uint8[kSize]); + scoped_ptr dst_sample(new uint8[kSize]); + scoped_ptr dst(new uint8[kSize]); + + memset(dst_sample.get(), 0, kSize); + memset(dst.get(), 0, kSize); + for (int i = 0; i < kSize; ++i) + src[i] = 100 + i; + + media::FilterYUVRows_C(dst_sample.get(), + src.get(), src.get(), 17, 128); + + // Generate an unaligned output address. + uint8* dst_ptr = + reinterpret_cast( + (reinterpret_cast(dst.get() + 8) & ~7) + 1); + media::FilterYUVRows_MMX(dst_ptr, src.get(), src.get(), 17, 128); + media::EmptyRegisterState(); + + EXPECT_EQ(0, memcmp(dst_sample.get(), dst_ptr, 17)); +} +#endif // defined(MEDIA_MMX_INTRINSICS_AVAILABLE) + TEST(YUVConvertTest, FilterYUVRows_SSE2_UnalignedDestination) { base::CPU cpu; if (!cpu.has_sse2()) { diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/BUILD.gn qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/BUILD.gn --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/BUILD.gn 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/BUILD.gn 2016-07-17 19:52:10.846175461 +0200 @@ -907,6 +907,26 @@ "//base", "//ui/gfx/geometry", ] + if (current_cpu == "x86" || current_cpu == "x64") { + deps += [ + ":shared_memory_support_sse", + ] + } +} + +if (current_cpu == "x86" || current_cpu == "x64") { + source_set("shared_memory_support_sse") { + sources = [ + "base/simd/vector_math_sse.cc", + ] + configs += [ + "//media:media_config", + "//media:media_implementation", + ] + if (!is_win) { + cflags = [ "-msse" ] + } + } } # TODO(watk): Refactor tests that could be made to run on Android. See diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/media.gyp qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/media.gyp --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/media/media.gyp 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/media/media.gyp 2016-07-17 18:06:36.231790873 +0200 @@ -1138,12 +1138,12 @@ ['target_arch=="ia32" or target_arch=="x64"', { 'dependencies': [ 'media_asm', + 'media_mmx', + 'media_sse', + 'media_sse2', ], 'sources': [ - 'base/simd/convert_rgb_to_yuv_sse2.cc', - 'base/simd/convert_rgb_to_yuv_ssse3.cc', 'base/simd/convert_yuv_to_rgb_x86.cc', - 'base/simd/filter_yuv_sse2.cc', ], }], ['OS!="linux" and OS!="win"', { @@ -1712,6 +1712,11 @@ 'USE_NEON' ], }], + ['target_arch=="ia32" or target_arch=="x64"', { + 'dependencies': [ + 'shared_memory_support_sse' + ], + }], ], }, ], @@ -1723,6 +1728,7 @@ 'type': 'static_library', 'sources': [ 'base/simd/convert_rgb_to_yuv_ssse3.asm', + 'base/simd/convert_yuv_to_rgb_mmx.asm', 'base/simd/convert_yuv_to_rgb_sse.asm', 'base/simd/convert_yuva_to_argb_mmx.asm', 'base/simd/empty_register_state_mmx.asm', @@ -1803,6 +1809,75 @@ '../third_party/yasm/yasm_compile.gypi', ], }, + { + # GN version: //media/base:media_mmx + 'target_name': 'media_mmx', + 'type': 'static_library', + 'cflags': [ + '-mmmx', + ], + 'defines': [ + 'MEDIA_IMPLEMENTATION', + ], + 'include_dirs': [ + '..', + ], + 'sources': [ + 'base/simd/filter_yuv_mmx.cc', + ], + }, + { + # GN version: //media/base:media_sse + 'target_name': 'media_sse', + 'type': 'static_library', + 'cflags': [ + '-msse', + ], + 'defines': [ + 'MEDIA_IMPLEMENTATION', + ], + 'include_dirs': [ + '..', + ], + 'sources': [ + 'base/simd/sinc_resampler_sse.cc', + ], + }, + { + # GN version: //media/base:media_sse2 + 'target_name': 'media_sse2', + 'type': 'static_library', + 'cflags': [ + '-msse2', + ], + 'defines': [ + 'MEDIA_IMPLEMENTATION', + ], + 'include_dirs': [ + '..', + ], + 'sources': [ + 'base/simd/convert_rgb_to_yuv_sse2.cc', + 'base/simd/convert_rgb_to_yuv_ssse3.cc', + 'base/simd/filter_yuv_sse2.cc', + ], + }, + { + 'target_name': 'shared_memory_support_sse', + 'type': 'static_library', + 'cflags': [ + '-msse', + ], + 'defines': [ + 'MEDIA_IMPLEMENTATION', + ], + 'include_dirs': [ + '..', + ], + 'sources': [ + 'base/simd/vector_math_sse.cc', + ], + }, ], # targets }], ['OS=="android"', { diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/skia/BUILD.gn qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/skia/BUILD.gn --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/skia/BUILD.gn 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/skia/BUILD.gn 2016-07-17 19:56:57.665743057 +0200 @@ -307,11 +307,6 @@ if (!is_ios) { sources += [ "ext/platform_canvas.cc" ] } - if (!is_ios && (current_cpu == "x86" || current_cpu == "x64")) { - sources += [ "ext/convolver_SSE2.cc" ] - } else if (current_cpu == "mipsel" && mips_dsp_rev >= 2) { - sources += [ "ext/convolver_mips_dspr2.cc" ] - } # The skia gypi values are relative to the skia_dir, so we need to rebase. sources += gypi_skia_core.sources @@ -597,7 +592,15 @@ ] if (current_cpu == "x86" || current_cpu == "x64") { - sources = gypi_skia_opts.sse2_sources + sources = gypi_skia_opts.sse2_sources + + [ + # Chrome-specific. + "ext/convolver_SSE2.cc", + "ext/convolver_SSE2.h", + ] + if (!is_win || is_clang) { + cflags += [ "-msse2" ] + } deps += [ ":skia_opts_avx", ":skia_opts_avx2", @@ -632,6 +635,13 @@ if (mips_dsp_rev >= 1) { sources = gypi_skia_opts.mips_dsp_sources + if (mips_dsp_rev >= 2) { + sources += [ + # Chrome-specific. + "ext/convolver_mips_dspr2.cc", + "ext/convolver_mips_dspr2.h", + ] + } } else { sources = gypi_skia_opts.none_sources } diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/skia/ext/convolver.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/skia/ext/convolver.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/skia/ext/convolver.cc 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/skia/ext/convolver.cc 2016-07-17 18:06:40.213812591 +0200 @@ -362,10 +362,13 @@ void SetupSIMD(ConvolveProcs *procs) { #ifdef SIMD_SSE2 - procs->extra_horizontal_reads = 3; - procs->convolve_vertically = &ConvolveVertically_SSE2; - procs->convolve_4rows_horizontally = &Convolve4RowsHorizontally_SSE2; - procs->convolve_horizontally = &ConvolveHorizontally_SSE2; + base::CPU cpu; + if (cpu.has_sse2()) { + procs->extra_horizontal_reads = 3; + procs->convolve_vertically = &ConvolveVertically_SSE2; + procs->convolve_4rows_horizontally = &Convolve4RowsHorizontally_SSE2; + procs->convolve_horizontally = &ConvolveHorizontally_SSE2; + } #elif defined SIMD_MIPS_DSPR2 procs->extra_horizontal_reads = 3; procs->convolve_vertically = &ConvolveVertically_mips_dspr2; diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/skia/ext/convolver.h qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/skia/ext/convolver.h --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/skia/ext/convolver.h 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/skia/ext/convolver.h 2016-07-17 20:01:19.498174087 +0200 @@ -11,6 +11,7 @@ #include #include "build/build_config.h" +#include "base/cpu.h" #include "third_party/skia/include/core/SkSize.h" #include "third_party/skia/include/core/SkTypes.h" diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/skia/skia_chrome.gypi qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/skia/skia_chrome.gypi --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/skia/skia_chrome.gypi 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/skia/skia_chrome.gypi 2016-07-17 18:06:40.215812602 +0200 @@ -9,6 +9,7 @@ { 'dependencies': [ 'skia_library', + 'skia_chrome_opts', '../base/base.gyp:base', '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', ], @@ -66,22 +67,16 @@ 'ext/skia_utils_base.cc', ], }], + ['OS == "ios"', { + 'dependencies!': [ + 'skia_chrome_opts', + ], + }], [ 'OS != "android" and (OS != "linux" or use_cairo==1)', { 'sources!': [ 'ext/bitmap_platform_device_skia.cc', ], }], - [ 'OS != "ios" and target_arch != "arm" and target_arch != "mipsel" and \ - target_arch != "arm64" and target_arch != "mips64el"', { - 'sources': [ - 'ext/convolver_SSE2.cc', - ], - }], - [ 'target_arch == "mipsel" and mips_dsp_rev >= 2',{ - 'sources': [ - 'ext/convolver_mips_dspr2.cc', - ], - }], ], 'target_conditions': [ diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/skia/skia.gyp qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/skia/skia.gyp --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/skia/skia.gyp 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/skia/skia.gyp 2016-07-17 18:06:40.215812602 +0200 @@ -128,6 +128,37 @@ # targets that are not dependent upon the component type 'targets': [ { + 'target_name': 'skia_chrome_opts', + 'type': 'static_library', + 'include_dirs': [ + '..', + 'config', + '../third_party/skia/include/core', + ], + 'conditions': [ + [ 'os_posix == 1 and OS != "mac" and OS != "android" and \ + target_arch != "arm" and target_arch != "mipsel" and \ + target_arch != "arm64" and target_arch != "mips64el"', { + 'cflags': [ + '-msse2', + ], + }], + [ 'target_arch != "arm" and target_arch != "mipsel" and \ + target_arch != "arm64" and target_arch != "mips64el"', { + 'sources': [ + 'ext/convolver_SSE2.cc', + 'ext/convolver_SSE2.h', + ], + }], + [ 'target_arch == "mipsel" and mips_dsp_rev >= 2',{ + 'sources': [ + 'ext/convolver_mips_dspr2.cc', + 'ext/convolver_mips_dspr2.h', + ], + }], + ], + }, + { 'target_name': 'image_operations_bench', # The optimize: 'max' scattered throughout are particularly # important when compiled by MSVC 2013, which seems diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/skia/skia_library_opts.gyp qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/skia/skia_library_opts.gyp --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/skia/skia_library_opts.gyp 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/skia/skia_library_opts.gyp 2016-07-17 18:06:40.216812607 +0200 @@ -19,10 +19,22 @@ }, 'targets': [ - # SSE files have to be built in a separate target, because gcc needs - # different -msse flags for different SSE levels which enable use of SSE - # intrinsics but also allow emission of SSE2 instructions for scalar code. - # gyp does not allow per-file compiler flags. + # Due to an unfortunate intersection of lameness between gcc and gyp, + # we have to build the *_SSE2.cpp files in a separate target. The + # gcc lameness is that, in order to compile SSE2 intrinsics code, it + # must be passed the -msse2 flag. However, with this flag, it may + # emit SSE2 instructions even for scalar code, such as the CPUID + # test used to test for the presence of SSE2. So that, and all other + # code must be compiled *without* -msse2. The gyp lameness is that it + # does not allow file-specific CFLAGS, so we must create this extra + # target for those files to be compiled with -msse2. + # + # This is actually only a problem on 32-bit Linux (all Intel Macs have + # SSE2, Linux x86_64 has SSE2 by definition, and MSC will happily emit + # SSE2 from instrinsics, which generating plain ol' 386 for everything + # else). However, to keep the .gyp file simple and avoid platform-specific + # build breakage, we do this on all platforms. + # For about the same reason, we need to compile the ARM opts files # separately as well. { @@ -45,12 +57,13 @@ ], 'include_dirs': [ '<@(include_dirs)' ], 'conditions': [ + [ 'os_posix == 1 and OS != "mac" and OS != "android" and \ + target_arch != "arm" and target_arch != "arm64" and \ + target_arch != "mipsel" and target_arch != "mips64el"', { + 'cflags': [ '-msse2' ], + }], [ 'target_arch != "arm" and target_arch != "mipsel" and \ target_arch != "arm64" and target_arch != "mips64el"', { - # Chrome builds with -msse2 locally, so sse2_sources could in theory - # be in the regular skia target. But we need skia_opts for arm - # anyway, so putting sse2_sources here is simpler than making this - # conditionally a type none target on x86. 'sources': [ '<@(sse2_sources)' ], 'dependencies': [ 'skia_opts_ssse3', diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/qcms/BUILD.gn qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/qcms/BUILD.gn --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/qcms/BUILD.gn 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/qcms/BUILD.gn 2016-07-17 20:06:47.037962770 +0200 @@ -27,8 +27,8 @@ ] if (current_cpu == "x86" || current_cpu == "x64") { - defines = [ "SSE2_ENABLE" ] - sources += [ "src/transform-sse2.c" ] + defines = [ "SSE2_ENABLE" ] # runtime detection + deps = [ "qcms_sse2" ] } } @@ -64,3 +64,15 @@ public_configs = [ ":qcms_config" ] } } + +source_set("qcms_sse2") { + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + public_configs = [ ":qcms_config" ] + + if (current_cpu == "x86" || current_cpu == "x64") { + defines = [ "SSE2_ENABLE" ] + sources = [ "src/transform-sse2.c" ] + cflags = [ "-msse2" ] + } +} diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/qcms/qcms.gyp qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/qcms/qcms.gyp --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/qcms/qcms.gyp 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/qcms/qcms.gyp 2016-07-17 20:08:22.446483691 +0200 @@ -42,10 +42,10 @@ 'conditions': [ ['target_arch=="ia32" or target_arch=="x64"', { 'defines': [ - 'SSE2_ENABLE', + 'SSE2_ENABLE', # runtime detection ], - 'sources': [ - 'src/transform-sse2.c', + 'dependencies': [ + 'qcms_sse2', ], }], ], @@ -85,6 +85,29 @@ }], ], }, + { + 'target_name': 'qcms_sse2', + 'type': 'static_library', + 'conditions': [ + ['target_arch == "ia32" or target_arch == "x64"', { + 'defines': [ + 'SSE2_ENABLE', + ], + 'sources': [ + # Conditional compilation for SSE2 code on x86 and x64 machines + 'src/transform-sse2.c', + ], + 'cflags': [ + '-msse2', + ], + }], + ], + 'direct_dependent_settings': { + 'include_dirs': [ + './src', + ], + }, + }, ], } diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp 2016-07-17 18:06:40.274812924 +0200 @@ -26,6 +26,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// include this first to get it before the CPU() function-like macro +#include "base/cpu.h" + #include "platform/audio/DirectConvolver.h" #if OS(MACOSX) @@ -35,14 +38,20 @@ #include "platform/audio/VectorMath.h" #include "wtf/CPU.h" -#if (CPU(X86) || CPU(X86_64)) && !(OS(MACOSX) || USE(WEBAUDIO_IPP)) +#if ((CPU(X86) && defined(__SSE2__)) || CPU(X86_64)) && !(OS(MACOSX) || USE(WEBAUDIO_IPP)) #include #endif +#if defined(BUILD_ONLY_THE_SSE2_PARTS) && !defined(__SSE2__) +#error SSE2 parts must be built with -msse2 +#endif + namespace blink { using namespace VectorMath; +#ifndef BUILD_ONLY_THE_SSE2_PARTS + DirectConvolver::DirectConvolver(size_t inputBlockSize) : m_inputBlockSize(inputBlockSize) #if USE(WEBAUDIO_IPP) @@ -50,10 +59,26 @@ #endif // USE(WEBAUDIO_IPP) , m_buffer(inputBlockSize * 2) { +#if CPU(X86) + base::CPU cpu; + m_haveSSE2 = cpu.has_sse2(); +#endif } +#endif + +#ifdef BUILD_ONLY_THE_SSE2_PARTS +void DirectConvolver::m_processSSE2(AudioFloatArray* convolutionKernel, const float* sourceP, float* destP, size_t framesToProcess) +#else void DirectConvolver::process(AudioFloatArray* convolutionKernel, const float* sourceP, float* destP, size_t framesToProcess) +#endif { +#if CPU(X86) && !defined(__SSE2__) + if (m_haveSSE2) { + m_processSSE2(convolutionKernel, sourceP, destP, framesToProcess); + return; + } +#endif ASSERT(framesToProcess == m_inputBlockSize); if (framesToProcess != m_inputBlockSize) return; @@ -98,7 +123,7 @@ #endif // CPU(X86) #else size_t i = 0; -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) // Convolution using SSE2. Currently only do this if both |kernelSize| and |framesToProcess| // are multiples of 4. If not, use the straightforward loop below. @@ -408,7 +433,7 @@ } destP[i++] = sum; } -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) } #endif #endif // OS(MACOSX) @@ -418,6 +443,8 @@ #endif } +#ifndef BUILD_ONLY_THE_SSE2_PARTS + void DirectConvolver::reset() { m_buffer.zero(); @@ -426,5 +453,7 @@ #endif // USE(WEBAUDIO_IPP) } +#endif + } // namespace blink diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.h qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.h --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.h 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.h 2016-07-17 20:16:19.967090904 +0200 @@ -32,6 +32,7 @@ #include "platform/PlatformExport.h" #include "platform/audio/AudioArray.h" #include "wtf/Allocator.h" +#include "wtf/CPU.h" #include "wtf/Noncopyable.h" #if USE(WEBAUDIO_IPP) @@ -57,6 +58,11 @@ AudioFloatArray m_overlayBuffer; #endif // USE(WEBAUDIO_IPP) AudioFloatArray m_buffer; + +#if CPU(X86) + bool m_haveSSE2; + void m_processSSE2(AudioFloatArray* convolutionKernel, const float* sourceP, float* destP, size_t framesToProcess); +#endif }; } // namespace blink diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolverSSE2.cpp qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolverSSE2.cpp --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolverSSE2.cpp 1970-01-01 01:00:00.000000000 +0100 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolverSSE2.cpp 2016-07-17 18:06:40.274812924 +0200 @@ -0,0 +1,2 @@ +#define BUILD_ONLY_THE_SSE2_PARTS +#include "DirectConvolver.cpp" diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.cpp qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.cpp --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.cpp 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.cpp 2016-07-17 20:18:38.755848676 +0200 @@ -26,15 +26,22 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// include this first to get it before the CPU() function-like macro +#include "base/cpu.h" + #include "platform/audio/SincResampler.h" #include "platform/audio/AudioBus.h" #include "wtf/CPU.h" #include "wtf/MathExtras.h" -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) #include #endif +#if defined(BUILD_ONLY_THE_SSE2_PARTS) && !defined(__SSE2__) +#error SSE2 parts must be built with -msse2 +#endif + // Input buffer layout, dividing the total buffer into regions (r0 - r5): // // |----------------|----------------------------------------------------------------|----------------| @@ -64,6 +71,8 @@ namespace blink { +#ifndef BUILD_ONLY_THE_SSE2_PARTS + SincResampler::SincResampler(double scaleFactor, unsigned kernelSize, unsigned numberOfKernelOffsets) : m_scaleFactor(scaleFactor) , m_kernelSize(kernelSize) @@ -77,6 +86,10 @@ , m_sourceProvider(nullptr) , m_isBufferPrimed(false) { +#if CPU(X86) + base::CPU cpu; + m_haveSSE2 = cpu.has_sse2(); +#endif initializeKernel(); } @@ -193,8 +206,20 @@ } } +#endif + +#ifdef BUILD_ONLY_THE_SSE2_PARTS +void SincResampler::m_processSSE2(AudioSourceProvider* sourceProvider, float* destination, size_t framesToProcess) +#else void SincResampler::process(AudioSourceProvider* sourceProvider, float* destination, size_t framesToProcess) +#endif { +#if CPU(X86) && !defined(__SSE2__) + if (m_haveSSE2) { + m_processSSE2(sourceProvider, destination, framesToProcess); + return; + } +#endif bool isGood = sourceProvider && m_blockSize > m_kernelSize && m_inputBuffer.size() >= m_blockSize + m_kernelSize && !(m_kernelSize % 2); ASSERT(isGood); if (!isGood) @@ -256,7 +281,7 @@ { float input; -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) // If the sourceP address is not 16-byte aligned, the first several frames (at most three) should be processed seperately. while ((reinterpret_cast(inputP) & 0x0F) && n) { CONVOLVE_ONE_SAMPLE diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.h qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.h --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.h 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.h 2016-07-17 20:19:17.818061951 +0200 @@ -33,6 +33,7 @@ #include "platform/audio/AudioArray.h" #include "platform/audio/AudioSourceProvider.h" #include "wtf/Allocator.h" +#include "wtf/CPU.h" #include "wtf/Noncopyable.h" namespace blink { @@ -84,6 +85,11 @@ // The buffer is primed once at the very beginning of processing. bool m_isBufferPrimed; + +#if CPU(X86) + bool m_haveSSE2; + void m_processSSE2(AudioSourceProvider*, float* destination, size_t framesToProcess); +#endif }; } // namespace blink diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResamplerSSE2.cpp qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResamplerSSE2.cpp --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResamplerSSE2.cpp 1970-01-01 01:00:00.000000000 +0100 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResamplerSSE2.cpp 2016-07-17 18:06:40.282812967 +0200 @@ -0,0 +1,2 @@ +#define BUILD_ONLY_THE_SSE2_PARTS +#include "SincResampler.cpp" diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.cpp qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.cpp --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.cpp 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.cpp 2016-07-17 18:06:40.282812967 +0200 @@ -22,6 +22,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// include this first to get it before the CPU() function-like macro +#include "base/cpu.h" + #include "platform/audio/VectorMath.h" #include "wtf/Assertions.h" #include "wtf/CPU.h" @@ -32,10 +35,14 @@ #include #endif -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) #include #endif +#if defined(BUILD_ONLY_THE_SSE2_PARTS) && !defined(__SSE2__) +#error SSE2 parts must be built with -msse2 +#endif + #if HAVE(ARM_NEON_INTRINSICS) #include #endif @@ -118,11 +125,25 @@ } #else +#ifdef BUILD_ONLY_THE_SSE2_PARTS +namespace SSE2 { +#endif + +#if CPU(X86) && !defined(__SSE2__) +static base::CPU cpu; +#endif + void vsma(const float* sourceP, int sourceStride, const float* scale, float* destP, int destStride, size_t framesToProcess) { +#if CPU(X86) && !defined(__SSE2__) + if (cpu.has_sse2()) { + blink::VectorMath::SSE2::vsma(sourceP, sourceStride, scale, destP, destStride, framesToProcess); + return; + } +#endif int n = framesToProcess; -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) if ((sourceStride == 1) && (destStride == 1)) { float k = *scale; @@ -193,9 +214,15 @@ void vsmul(const float* sourceP, int sourceStride, const float* scale, float* destP, int destStride, size_t framesToProcess) { +#if CPU(X86) && !defined(__SSE2__) + if (cpu.has_sse2()) { + blink::VectorMath::SSE2::vsmul(sourceP, sourceStride, scale, destP, destStride, framesToProcess); + return; + } +#endif int n = framesToProcess; -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) if ((sourceStride == 1) && (destStride == 1)) { float k = *scale; @@ -266,16 +293,22 @@ sourceP += sourceStride; destP += destStride; } -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) } #endif } void vadd(const float* source1P, int sourceStride1, const float* source2P, int sourceStride2, float* destP, int destStride, size_t framesToProcess) { +#if CPU(X86) && !defined(__SSE2__) + if (cpu.has_sse2()) { + blink::VectorMath::SSE2::vadd(source1P, sourceStride1, source2P, sourceStride2, destP, destStride, framesToProcess); + return; + } +#endif int n = framesToProcess; -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) if ((sourceStride1 ==1) && (sourceStride2 == 1) && (destStride == 1)) { // If the sourceP address is not 16-byte aligned, the first several frames (at most three) should be processed separately. while ((reinterpret_cast(source1P) & 0x0F) && n) { @@ -378,17 +411,23 @@ source2P += sourceStride2; destP += destStride; } -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) } #endif } void vmul(const float* source1P, int sourceStride1, const float* source2P, int sourceStride2, float* destP, int destStride, size_t framesToProcess) { +#if CPU(X86) && !defined(__SSE2__) + if (cpu.has_sse2()) { + blink::VectorMath::SSE2::vmul(source1P, sourceStride1, source2P, sourceStride2, destP, destStride, framesToProcess); + return; + } +#endif int n = framesToProcess; -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) if ((sourceStride1 == 1) && (sourceStride2 == 1) && (destStride == 1)) { // If the source1P address is not 16-byte aligned, the first several frames (at most three) should be processed separately. while ((reinterpret_cast(source1P) & 0x0F) && n) { @@ -460,8 +499,14 @@ void zvmul(const float* real1P, const float* imag1P, const float* real2P, const float* imag2P, float* realDestP, float* imagDestP, size_t framesToProcess) { +#if CPU(X86) && !defined(__SSE2__) + if (cpu.has_sse2()) { + blink::VectorMath::SSE2::zvmul(real1P, imag1P, real2P, imag2P, realDestP, imagDestP, framesToProcess); + return; + } +#endif unsigned i = 0; -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) // Only use the SSE optimization in the very common case that all addresses are 16-byte aligned. // Otherwise, fall through to the scalar code below. if (!(reinterpret_cast(real1P) & 0x0F) @@ -516,10 +561,16 @@ void vsvesq(const float* sourceP, int sourceStride, float* sumP, size_t framesToProcess) { +#if CPU(X86) && !defined(__SSE2__) + if (cpu.has_sse2()) { + blink::VectorMath::SSE2::vsvesq(sourceP, sourceStride, sumP, framesToProcess); + return; + } +#endif int n = framesToProcess; float sum = 0; -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) if (sourceStride == 1) { // If the sourceP address is not 16-byte aligned, the first several frames (at most three) should be processed separately. while ((reinterpret_cast(sourceP) & 0x0F) && n) { @@ -581,10 +632,16 @@ void vmaxmgv(const float* sourceP, int sourceStride, float* maxP, size_t framesToProcess) { +#if CPU(X86) && !defined(__SSE2__) + if (cpu.has_sse2()) { + blink::VectorMath::SSE2::vmaxmgv(sourceP, sourceStride, maxP, framesToProcess); + return; + } +#endif int n = framesToProcess; float max = 0; -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) if (sourceStride == 1) { // If the sourceP address is not 16-byte aligned, the first several frames (at most three) should be processed separately. while ((reinterpret_cast(sourceP) & 0x0F) && n) { @@ -648,6 +705,8 @@ *maxP = max; } +#ifndef BUILD_ONLY_THE_SSE2_PARTS + void vclip(const float* sourceP, int sourceStride, const float* lowThresholdP, const float* highThresholdP, float* destP, int destStride, size_t framesToProcess) { int n = framesToProcess; @@ -678,6 +737,12 @@ } } +#endif + +#ifdef BUILD_ONLY_THE_SSE2_PARTS +} // namespace SSE2 +#endif + #endif // OS(MACOSX) } // namespace VectorMath diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.h qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.h --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.h 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.h 2016-07-17 20:23:13.405325950 +0200 @@ -26,6 +26,7 @@ #define VectorMath_h #include "platform/PlatformExport.h" +#include "wtf/CPU.h" #include "wtf/build_config.h" #include @@ -55,6 +56,28 @@ // Copies elements while clipping values to the threshold inputs. PLATFORM_EXPORT void vclip(const float* sourceP, int sourceStride, const float* lowThresholdP, const float* highThresholdP, float* destP, int destStride, size_t framesToProcess); +#if CPU(X86) +namespace SSE2 { +// Vector scalar multiply and then add. +PLATFORM_EXPORT void vsma(const float* sourceP, int sourceStride, const float* scale, float* destP, int destStride, size_t framesToProcess); + +PLATFORM_EXPORT void vsmul(const float* sourceP, int sourceStride, const float* scale, float* destP, int destStride, size_t framesToProcess); +PLATFORM_EXPORT void vadd(const float* source1P, int sourceStride1, const float* source2P, int sourceStride2, float* destP, int destStride, size_t framesToProcess); + +// Finds the maximum magnitude of a float vector. +PLATFORM_EXPORT void vmaxmgv(const float* sourceP, int sourceStride, float* maxP, size_t framesToProcess); + +// Sums the squares of a float vector's elements. +PLATFORM_EXPORT void vsvesq(const float* sourceP, int sourceStride, float* sumP, size_t framesToProcess); + +// For an element-by-element multiply of two float vectors. +PLATFORM_EXPORT void vmul(const float* source1P, int sourceStride1, const float* source2P, int sourceStride2, float* destP, int destStride, size_t framesToProcess); + +// Multiplies two complex vectors. +PLATFORM_EXPORT void zvmul(const float* real1P, const float* imag1P, const float* real2P, const float* imag2P, float* realDestP, float* imagDestP, size_t framesToProcess); +} +#endif + } // namespace VectorMath } // namespace blink diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMathSSE2.cpp qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMathSSE2.cpp --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMathSSE2.cpp 1970-01-01 01:00:00.000000000 +0100 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMathSSE2.cpp 2016-07-17 18:06:40.283812973 +0200 @@ -0,0 +1,2 @@ +#define BUILD_ONLY_THE_SSE2_PARTS +#include "VectorMath.cpp" diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/blink_platform.gyp qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/blink_platform.gyp --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/blink_platform.gyp 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/blink_platform.gyp 2016-07-17 18:06:40.283812973 +0200 @@ -379,6 +379,11 @@ '<(DEPTH)/third_party/openmax_dl/dl/dl.gyp:openmax_dl', ], }], + ['target_arch == "ia32"', { + 'dependencies': [ + 'blink_sse2', + ], + }], ['target_arch=="arm"', { 'dependencies': [ 'blink_arm_neon', @@ -394,6 +399,37 @@ }], ], }, + { + 'target_name': 'blink_sse2', + 'conditions': [ + ['target_arch=="ia32"', { + 'type': 'static_library', + 'dependencies': [ + '<(DEPTH)/third_party/khronos/khronos.gyp:khronos_headers', + '../config.gyp:config', + '../wtf/wtf.gyp:wtf', + 'blink_common', + 'blink_heap_asm_stubs', + 'blink_prerequisites', + ], + 'defines': [ + 'BLINK_PLATFORM_IMPLEMENTATION=1', + 'INSIDE_BLINK', + ], + 'sources': [ + 'audio/DirectConvolverSSE2.cpp', + 'audio/SincResamplerSSE2.cpp', + 'audio/VectorMathSSE2.cpp', + ], + 'cflags': [ + '-msse2', + '-mfpmath=sse', + ], + },{ # target_arch != "ia32" + 'type': 'none', + }], + ], + }, # The *NEON.cpp files fail to compile when -mthumb is passed. Force # them to build in ARM mode. # See https://bugs.webkit.org/show_bug.cgi?id=62916. diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h 2016-07-17 18:06:40.284812978 +0200 @@ -5,7 +5,7 @@ #ifndef WebGLImageConversionSSE_h #define WebGLImageConversionSSE_h -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) #include diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp 2016-07-17 18:06:40.285812984 +0200 @@ -422,7 +422,7 @@ const uint32_t* source32 = reinterpret_cast_ptr(source); uint32_t* destination32 = reinterpret_cast_ptr(destination); -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) SIMD::unpackOneRowOfBGRA8LittleToRGBA8(source32, destination32, pixelsPerRow); #endif for (unsigned i = 0; i < pixelsPerRow; ++i) { @@ -629,7 +629,7 @@ // FIXME: this routine is lossy and must be removed. template<> void pack(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow) { -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) SIMD::packOneRowOfRGBA8LittleToR8(source, destination, pixelsPerRow); #endif for (unsigned i = 0; i < pixelsPerRow; ++i) { @@ -740,7 +740,7 @@ // FIXME: this routine is lossy and must be removed. template<> void pack(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow) { -#if CPU(X86) || CPU(X86_64) +#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64) SIMD::packOneRowOfRGBA8LittleToRGBA8(source, destination, pixelsPerRow); #else for (unsigned i = 0; i < pixelsPerRow; ++i) { diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/webrtc/common_audio/real_fourier.cc qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/webrtc/common_audio/real_fourier.cc --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/third_party/webrtc/common_audio/real_fourier.cc 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/third_party/webrtc/common_audio/real_fourier.cc 2016-07-17 18:06:40.285812984 +0200 @@ -14,6 +14,7 @@ #include "webrtc/common_audio/real_fourier_ooura.h" #include "webrtc/common_audio/real_fourier_openmax.h" #include "webrtc/common_audio/signal_processing/include/spl_inl.h" +#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h" namespace webrtc { @@ -23,7 +24,15 @@ rtc::scoped_ptr RealFourier::Create(int fft_order) { #if defined(RTC_USE_OPENMAX_DL) +#if defined(WEBRTC_ARCH_X86_FAMILY) && !defined(__SSE2__) + // x86 CPU detection required. + if (WebRtc_GetCPUInfo(kSSE2)) + return rtc::scoped_ptr(new RealFourierOpenmax(fft_order)); + else + return rtc::scoped_ptr(new RealFourierOoura(fft_order)); +#else return rtc::scoped_ptr(new RealFourierOpenmax(fft_order)); +#endif #else return rtc::scoped_ptr(new RealFourierOoura(fft_order)); #endif diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/tools/gyp/pylib/gyp/generator/ninja.py qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/tools/gyp/pylib/gyp/generator/ninja.py --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/tools/gyp/pylib/gyp/generator/ninja.py 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/tools/gyp/pylib/gyp/generator/ninja.py 2016-07-17 18:06:40.306813098 +0200 @@ -1302,6 +1302,8 @@ # Make sure that we have relative paths to our out/(Release|Debug), where we generate our .pri file, and then prepend $$PWD to them. prefixed_objects = ['$$PWD/' + o for o in toAbsPaths(objects)] prefixed_archives = ['$$PWD/' + o for o in toAbsPaths(libs)] + if len(solibs): + prefixed_solibs = ['$$PWD/' + so for so in toAbsPaths(solibs)] pri_file.write("QMAKE_LFLAGS += %s\n" % qmakeLiteral(' '.join(prefixed_lflags))) pri_file.write("OBJECTS += %s\n" % qmakeLiteral(' '.join(prefixed_objects))) @@ -1310,6 +1312,8 @@ pri_file.write("LIBS_PRIVATE += -Wl,--start-group %s -Wl,--end-group\n" % qmakeLiteral(' '.join(prefixed_archives))) else: pri_file.write("LIBS_PRIVATE += %s\n" % qmakeLiteral(' '.join(prefixed_archives))) + if len(solibs): + pri_file.write("LIBS_PRIVATE += %s\n" % qmakeLiteral(' '.join(prefixed_solibs))) # External libs have to come after objects/archives, the linker resolve them in order. pri_file.write("LIBS_PRIVATE += %s\n" % qmakeLiteral(' '.join(prefixed_library_dirs + prefixed_libraries))) # Make sure that if ninja modifies one of the inputs, qmake/make will link again. diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/v8/build/standalone.gypi qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/v8/build/standalone.gypi --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/v8/build/standalone.gypi 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/v8/build/standalone.gypi 2016-07-17 20:29:04.969207948 +0200 @@ -117,6 +117,9 @@ }, { 'gomadir': 'v8_sse2.gyp +# rename all target names +SUBTARGETS=`grep "'target_name': '" v8.gyp | sed -e "s/^.*'target_name': '//g" -e "s/',$//g"` +SEDS= +for SUBTARGET in $SUBTARGETS ; do + SEDS=$SEDS\ -e\ "s/'$SUBTARGET\(['#]\)/'${SUBTARGET}_sse2\1/g" +done +# in addition: +# * set v8_target_arch to "ia32" (instead of "x87") +# * rename all actions +# * fix mksnapshot_exec to match the renamed target +# * rename the generated snapshot.cc (but not mksnapshot.cc) to snapshot_sse2.cc +# * rename the generated *libraries.cc to *libraries_sse2.cc +# * rename the generated *.bin to *_sse2.bin +# * set product_name and product_dir for the v8_sse2 target +sed -e "s/^\( 'variables': {\)/\1\n 'v8_target_arch': 'ia32',/g" \ + -e "s/\('action_name': '\)/\1v8_sse2_/g" \ + $SEDS \ + -e "s/\('mksnapshot_exec': '.*mksnapshot\)/\1_sse2/g" \ + -e "s#/snapshot\.cc#/snapshot_sse2.cc#g" \ + -e "s/libraries\.cc/libraries_sse2.cc/g" \ + -e "s/\.bin/_sse2.bin/g" \ + -e "s#^\( *\)\('target_name': 'v8_sse2',\)#\1\2\n\1'product_name': 'v8',\n\1'product_dir': '<(PRODUCT_DIR)/lib/sse2',#g" \ + v8.gyp >>v8_sse2.gyp diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/v8/tools/gyp/v8.gyp qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/v8/tools/gyp/v8.gyp --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/v8/tools/gyp/v8.gyp 2016-05-26 15:53:47.000000000 +0200 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/v8/tools/gyp/v8.gyp 2016-07-17 18:06:40.366813425 +0200 @@ -36,6 +36,14 @@ 'v8_experimental_extra_library_files%': [], 'mksnapshot_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot<(EXECUTABLE_SUFFIX)', 'remove_v8base_debug_symbols%': 0, + 'conditions': [ + # build V8 shared on ia32 so we can swap x87 vs. SSE2 builds + ['target_arch == "ia32"', { + 'v8_component%': 'shared_library', + }, { + 'v8_component%': '<(component)', + }], + ], }, 'includes': ['../../build/toolchain.gypi', '../../build/features.gypi'], 'targets': [ @@ -49,8 +57,8 @@ }, { 'toolsets': ['target'], }], - ['component=="shared_library"', { - 'type': '<(component)', + ['v8_component=="shared_library"', { + 'type': '<(v8_component)', 'sources': [ # Note: on non-Windows we still build this file so that gyp # has some sources to link into the component. @@ -161,7 +169,7 @@ 'js2c', ], }], - ['component=="shared_library"', { + ['v8_component=="shared_library"', { 'defines': [ 'V8_SHARED', 'BUILDING_V8_SHARED', @@ -244,7 +252,7 @@ 'toolsets': ['target'], 'dependencies': ['js2c'], }], - ['component=="shared_library"', { + ['v8_component=="shared_library"', { 'defines': [ 'BUILDING_V8_SHARED', 'V8_SHARED', @@ -272,7 +280,7 @@ 'natives_blob', ], }], - ['component=="shared_library"', { + ['v8_component=="shared_library"', { 'defines': [ 'V8_SHARED', 'BUILDING_V8_SHARED', @@ -1481,7 +1489,7 @@ # See http://crbug.com/485155. 'msvs_shard': 4, }], - ['component=="shared_library"', { + ['v8_component=="shared_library"', { 'defines': [ 'BUILDING_V8_SHARED', 'V8_SHARED', diff -Nur qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/v8/tools/gyp/v8_sse2.gyp qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/v8/tools/gyp/v8_sse2.gyp --- qtwebengine-opensource-src-5.7.0/src/3rdparty/chromium/v8/tools/gyp/v8_sse2.gyp 1970-01-01 01:00:00.000000000 +0100 +++ qtwebengine-opensource-src-5.7.0-no-sse2/src/3rdparty/chromium/v8/tools/gyp/v8_sse2.gyp 2016-07-17 20:34:22.753909119 +0200 @@ -0,0 +1,2151 @@ +# Generated from v8.gyp by make-v8-sse2-gyp.sh +# Copyright 2012 the V8 project authors. All rights reserved. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +{ + 'variables': { + 'v8_target_arch': 'ia32', + 'icu_use_data_file_flag%': 0, + 'v8_code': 1, + 'v8_random_seed%': 314159265, + 'v8_vector_stores%': 0, + 'embed_script%': "", + 'v8_extra_library_files%': [], + 'v8_experimental_extra_library_files%': [], + 'mksnapshot_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot_sse2<(EXECUTABLE_SUFFIX)', + 'remove_v8base_debug_symbols%': 0, + 'conditions': [ + # build V8 shared on ia32 so we can swap x87 vs. SSE2 builds + ['target_arch == "ia32"', { + 'v8_component%': 'shared_library', + }, { + 'v8_component%': '<(component)', + }], + ], + }, + 'includes': ['../../build/toolchain.gypi', '../../build/features.gypi'], + 'targets': [ + { + 'target_name': 'v8_sse2', + 'product_name': 'v8', + 'product_dir': '<(PRODUCT_DIR)/lib/sse2', + 'dependencies_traverse': 1, + 'dependencies': ['v8_maybe_snapshot_sse2'], + 'conditions': [ + ['want_separate_host_toolset==1', { + 'toolsets': ['host', 'target'], + }, { + 'toolsets': ['target'], + }], + ['v8_component=="shared_library"', { + 'type': '<(v8_component)', + 'sources': [ + # Note: on non-Windows we still build this file so that gyp + # has some sources to link into the component. + '../../src/v8dll-main.cc', + ], + 'include_dirs': [ + '../..', + ], + 'defines': [ + 'V8_SHARED', + 'BUILDING_V8_SHARED', + ], + 'direct_dependent_settings': { + 'defines': [ + 'V8_SHARED', + 'USING_V8_SHARED', + ], + }, + 'target_conditions': [ + ['OS=="android" and _toolset=="target"', { + 'libraries': [ + '-llog', + ], + 'include_dirs': [ + 'src/common/android/include', + ], + }], + ], + 'conditions': [ + ['OS=="mac"', { + 'xcode_settings': { + 'OTHER_LDFLAGS': ['-dynamiclib', '-all_load'] + }, + }], + ['soname_version!=""', { + 'product_extension': 'so.<(soname_version)', + }], + ], + }, + { + 'type': 'none', + }], + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '../../include', + ], + }, + }, + { + # This rule delegates to either v8_snapshot, v8_nosnapshot, or + # v8_external_snapshot, depending on the current variables. + # The intention is to make the 'calling' rules a bit simpler. + 'target_name': 'v8_maybe_snapshot_sse2', + 'type': 'none', + 'conditions': [ + ['v8_use_snapshot!="true"', { + # The dependency on v8_base should come from a transitive + # dependency however the Android toolchain requires libv8_base.a + # to appear before libv8_snapshot.a so it's listed explicitly. + 'dependencies': ['v8_base_sse2', 'v8_nosnapshot_sse2'], + }], + ['v8_use_snapshot=="true" and v8_use_external_startup_data==0', { + # The dependency on v8_base should come from a transitive + # dependency however the Android toolchain requires libv8_base.a + # to appear before libv8_snapshot.a so it's listed explicitly. + 'dependencies': ['v8_base_sse2', 'v8_snapshot_sse2'], + }], + ['v8_use_snapshot=="true" and v8_use_external_startup_data==1 and want_separate_host_toolset==0', { + 'dependencies': ['v8_base_sse2', 'v8_external_snapshot_sse2'], + 'inputs': [ '<(PRODUCT_DIR)/snapshot_blob_sse2.bin', ], + }], + ['v8_use_snapshot=="true" and v8_use_external_startup_data==1 and want_separate_host_toolset==1', { + 'dependencies': ['v8_base_sse2', 'v8_external_snapshot_sse2'], + 'target_conditions': [ + ['_toolset=="host"', { + 'inputs': [ + '<(PRODUCT_DIR)/snapshot_blob_host_sse2.bin', + ], + }, { + 'inputs': [ + '<(PRODUCT_DIR)/snapshot_blob_sse2.bin', + ], + }], + ], + }], + ['want_separate_host_toolset==1', { + 'toolsets': ['host', 'target'], + }, { + 'toolsets': ['target'], + }], + ] + }, + { + 'target_name': 'v8_snapshot_sse2', + 'type': 'static_library', + 'conditions': [ + ['want_separate_host_toolset==1', { + 'toolsets': ['host', 'target'], + 'dependencies': [ + 'mksnapshot_sse2#host', + 'js2c_sse2#host', + ], + }, { + 'toolsets': ['target'], + 'dependencies': [ + 'mksnapshot_sse2', + 'js2c_sse2', + ], + }], + ['v8_component=="shared_library"', { + 'defines': [ + 'V8_SHARED', + 'BUILDING_V8_SHARED', + ], + 'direct_dependent_settings': { + 'defines': [ + 'V8_SHARED', + 'USING_V8_SHARED', + ], + }, + }], + ], + 'dependencies': [ + 'v8_base_sse2', + ], + 'include_dirs+': [ + '../..', + ], + 'sources': [ + '<(SHARED_INTERMEDIATE_DIR)/libraries_sse2.cc', + '<(SHARED_INTERMEDIATE_DIR)/experimental-libraries_sse2.cc', + '<(SHARED_INTERMEDIATE_DIR)/extras-libraries_sse2.cc', + '<(SHARED_INTERMEDIATE_DIR)/experimental-extras-libraries_sse2.cc', + '<(INTERMEDIATE_DIR)/snapshot_sse2.cc', + ], + 'actions': [ + { + 'action_name': 'v8_sse2_run_mksnapshot', + 'inputs': [ + '<(mksnapshot_exec)', + '<(embed_script)', + ], + 'outputs': [ + '<(INTERMEDIATE_DIR)/snapshot_sse2.cc', + ], + 'variables': { + 'mksnapshot_flags': [ + '--log-snapshot-positions', + '--logfile', '<(INTERMEDIATE_DIR)/snapshot.log', + ], + 'conditions': [ + ['v8_random_seed!=0', { + 'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'], + }], + ['v8_vector_stores!=0', { + 'mksnapshot_flags': ['--vector-stores'], + }], + ], + }, + 'action': [ + '<(mksnapshot_exec)', + '<@(mksnapshot_flags)', + '--startup_src', '<@(INTERMEDIATE_DIR)/snapshot_sse2.cc', + '<(embed_script)', + ], + }, + ], + }, + { + 'target_name': 'v8_nosnapshot_sse2', + 'type': 'static_library', + 'dependencies': [ + 'v8_base_sse2', + ], + 'include_dirs+': [ + '../..', + ], + 'sources': [ + '<(SHARED_INTERMEDIATE_DIR)/libraries_sse2.cc', + '<(SHARED_INTERMEDIATE_DIR)/experimental-libraries_sse2.cc', + '<(SHARED_INTERMEDIATE_DIR)/extras-libraries_sse2.cc', + '<(SHARED_INTERMEDIATE_DIR)/experimental-extras-libraries_sse2.cc', + '../../src/snapshot/snapshot-empty.cc', + ], + 'conditions': [ + ['want_separate_host_toolset==1', { + 'toolsets': ['host', 'target'], + 'dependencies': ['js2c_sse2#host'], + }, { + 'toolsets': ['target'], + 'dependencies': ['js2c_sse2'], + }], + ['v8_component=="shared_library"', { + 'defines': [ + 'BUILDING_V8_SHARED', + 'V8_SHARED', + ], + }], + ] + }, + { + 'target_name': 'v8_external_snapshot_sse2', + 'type': 'static_library', + 'conditions': [ + [ 'v8_use_external_startup_data==1', { + 'conditions': [ + ['want_separate_host_toolset==1', { + 'toolsets': ['host', 'target'], + 'dependencies': [ + 'mksnapshot_sse2#host', + 'js2c_sse2#host', + 'natives_blob_sse2', + ]}, { + 'toolsets': ['target'], + 'dependencies': [ + 'mksnapshot_sse2', + 'js2c_sse2', + 'natives_blob_sse2', + ], + }], + ['v8_component=="shared_library"', { + 'defines': [ + 'V8_SHARED', + 'BUILDING_V8_SHARED', + ], + 'direct_dependent_settings': { + 'defines': [ + 'V8_SHARED', + 'USING_V8_SHARED', + ], + }, + }], + ], + 'dependencies': [ + 'v8_base_sse2', + ], + 'include_dirs+': [ + '../..', + ], + 'sources': [ + '../../src/snapshot/natives-external.cc', + '../../src/snapshot/snapshot-external.cc', + ], + 'actions': [ + { + 'action_name': 'v8_sse2_run_mksnapshot (external)', + 'inputs': [ + '<(mksnapshot_exec)', + ], + 'variables': { + 'mksnapshot_flags': [ + '--log-snapshot-positions', + '--logfile', '<(INTERMEDIATE_DIR)/snapshot.log', + ], + 'conditions': [ + ['v8_random_seed!=0', { + 'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'], + }], + ['v8_vector_stores!=0', { + 'mksnapshot_flags': ['--vector-stores'], + }], + ], + }, + 'conditions': [ + ['want_separate_host_toolset==1', { + 'target_conditions': [ + ['_toolset=="host"', { + 'outputs': [ + '<(PRODUCT_DIR)/snapshot_blob_host_sse2.bin', + ], + 'action': [ + '<(mksnapshot_exec)', + '<@(mksnapshot_flags)', + '--startup_blob', '<(PRODUCT_DIR)/snapshot_blob_host_sse2.bin', + '<(embed_script)', + ], + }, { + 'outputs': [ + '<(PRODUCT_DIR)/snapshot_blob_sse2.bin', + ], + 'action': [ + '<(mksnapshot_exec)', + '<@(mksnapshot_flags)', + '--startup_blob', '<(PRODUCT_DIR)/snapshot_blob_sse2.bin', + '<(embed_script)', + ], + }], + ], + }, { + 'outputs': [ + '<(PRODUCT_DIR)/snapshot_blob_sse2.bin', + ], + 'action': [ + '<(mksnapshot_exec)', + '<@(mksnapshot_flags)', + '--startup_blob', '<(PRODUCT_DIR)/snapshot_blob_sse2.bin', + '<(embed_script)', + ], + }], + ], + }, + ], + }], + ], + }, + { + 'target_name': 'v8_base_sse2', + 'type': 'static_library', + 'dependencies': [ + 'v8_libbase_sse2', + ], + 'variables': { + 'optimize': 'max', + }, + 'include_dirs+': [ + '../..', + # To be able to find base/trace_event/common/trace_event_common.h + '../../..', + ], + 'defines': [ + # TODO(jochen): Remove again after this is globally turned on. + 'V8_IMMINENT_DEPRECATION_WARNINGS', + ], + 'sources': [ ### gcmole(all) ### + '../../include/v8-debug.h', + '../../include/v8-experimental.h', + '../../include/v8-platform.h', + '../../include/v8-profiler.h', + '../../include/v8-testing.h', + '../../include/v8-util.h', + '../../include/v8-version.h', + '../../include/v8.h', + '../../include/v8config.h', + '../../src/accessors.cc', + '../../src/accessors.h', + '../../src/address-map.cc', + '../../src/address-map.h', + '../../src/allocation.cc', + '../../src/allocation.h', + '../../src/allocation-site-scopes.cc', + '../../src/allocation-site-scopes.h', + '../../src/api-experimental.cc', + '../../src/api-experimental.h', + '../../src/api.cc', + '../../src/api.h', + '../../src/api-natives.cc', + '../../src/api-natives.h', + '../../src/arguments.cc', + '../../src/arguments.h', + '../../src/assembler.cc', + '../../src/assembler.h', + '../../src/assert-scope.h', + '../../src/assert-scope.cc', + '../../src/ast/ast-expression-rewriter.cc', + '../../src/ast/ast-expression-rewriter.h', + '../../src/ast/ast-expression-visitor.cc', + '../../src/ast/ast-expression-visitor.h', + '../../src/ast/ast-literal-reindexer.cc', + '../../src/ast/ast-literal-reindexer.h', + '../../src/ast/ast-numbering.cc', + '../../src/ast/ast-numbering.h', + '../../src/ast/ast-value-factory.cc', + '../../src/ast/ast-value-factory.h', + '../../src/ast/ast.cc', + '../../src/ast/ast.h', + '../../src/ast/modules.cc', + '../../src/ast/modules.h', + '../../src/ast/prettyprinter.cc', + '../../src/ast/prettyprinter.h', + '../../src/ast/scopeinfo.cc', + '../../src/ast/scopeinfo.h', + '../../src/ast/scopes.cc', + '../../src/ast/scopes.h', + '../../src/ast/variables.cc', + '../../src/ast/variables.h', + '../../src/atomic-utils.h', + '../../src/background-parsing-task.cc', + '../../src/background-parsing-task.h', + '../../src/bailout-reason.cc', + '../../src/bailout-reason.h', + '../../src/basic-block-profiler.cc', + '../../src/basic-block-profiler.h', + '../../src/bignum-dtoa.cc', + '../../src/bignum-dtoa.h', + '../../src/bignum.cc', + '../../src/bignum.h', + '../../src/bit-vector.cc', + '../../src/bit-vector.h', + '../../src/bootstrapper.cc', + '../../src/bootstrapper.h', + '../../src/builtins.cc', + '../../src/builtins.h', + '../../src/cached-powers.cc', + '../../src/cached-powers.h', + '../../src/cancelable-task.cc', + '../../src/cancelable-task.h', + '../../src/char-predicates.cc', + '../../src/char-predicates-inl.h', + '../../src/char-predicates.h', + '../../src/checks.h', + '../../src/code-factory.cc', + '../../src/code-factory.h', + '../../src/code-stubs.cc', + '../../src/code-stubs.h', + '../../src/code-stubs-hydrogen.cc', + '../../src/codegen.cc', + '../../src/codegen.h', + '../../src/compilation-cache.cc', + '../../src/compilation-cache.h', + '../../src/compilation-dependencies.cc', + '../../src/compilation-dependencies.h', + '../../src/compilation-statistics.cc', + '../../src/compilation-statistics.h', + '../../src/compiler/access-builder.cc', + '../../src/compiler/access-builder.h', + '../../src/compiler/access-info.cc', + '../../src/compiler/access-info.h', + '../../src/compiler/all-nodes.cc', + '../../src/compiler/all-nodes.h', + '../../src/compiler/ast-graph-builder.cc', + '../../src/compiler/ast-graph-builder.h', + '../../src/compiler/ast-loop-assignment-analyzer.cc', + '../../src/compiler/ast-loop-assignment-analyzer.h', + '../../src/compiler/basic-block-instrumentor.cc', + '../../src/compiler/basic-block-instrumentor.h', + '../../src/compiler/branch-elimination.cc', + '../../src/compiler/branch-elimination.h', + '../../src/compiler/bytecode-branch-analysis.cc', + '../../src/compiler/bytecode-branch-analysis.h', + '../../src/compiler/bytecode-graph-builder.cc', + '../../src/compiler/bytecode-graph-builder.h', + '../../src/compiler/change-lowering.cc', + '../../src/compiler/change-lowering.h', + '../../src/compiler/c-linkage.cc', + '../../src/compiler/coalesced-live-ranges.cc', + '../../src/compiler/coalesced-live-ranges.h', + '../../src/compiler/code-generator-impl.h', + '../../src/compiler/code-generator.cc', + '../../src/compiler/code-generator.h', + '../../src/compiler/code-stub-assembler.cc', + '../../src/compiler/code-stub-assembler.h', + '../../src/compiler/common-node-cache.cc', + '../../src/compiler/common-node-cache.h', + '../../src/compiler/common-operator-reducer.cc', + '../../src/compiler/common-operator-reducer.h', + '../../src/compiler/common-operator.cc', + '../../src/compiler/common-operator.h', + '../../src/compiler/control-builders.cc', + '../../src/compiler/control-builders.h', + '../../src/compiler/control-equivalence.cc', + '../../src/compiler/control-equivalence.h', + '../../src/compiler/control-flow-optimizer.cc', + '../../src/compiler/control-flow-optimizer.h', + '../../src/compiler/dead-code-elimination.cc', + '../../src/compiler/dead-code-elimination.h', + '../../src/compiler/diamond.h', + '../../src/compiler/escape-analysis.cc', + '../../src/compiler/escape-analysis.h', + "../../src/compiler/escape-analysis-reducer.cc", + "../../src/compiler/escape-analysis-reducer.h", + '../../src/compiler/fast-accessor-assembler.cc', + '../../src/compiler/fast-accessor-assembler.h', + '../../src/compiler/frame.cc', + '../../src/compiler/frame.h', + '../../src/compiler/frame-elider.cc', + '../../src/compiler/frame-elider.h', + "../../src/compiler/frame-states.cc", + "../../src/compiler/frame-states.h", + '../../src/compiler/gap-resolver.cc', + '../../src/compiler/gap-resolver.h', + '../../src/compiler/graph-reducer.cc', + '../../src/compiler/graph-reducer.h', + '../../src/compiler/graph-replay.cc', + '../../src/compiler/graph-replay.h', + '../../src/compiler/graph-trimmer.cc', + '../../src/compiler/graph-trimmer.h', + '../../src/compiler/graph-visualizer.cc', + '../../src/compiler/graph-visualizer.h', + '../../src/compiler/graph.cc', + '../../src/compiler/graph.h', + '../../src/compiler/greedy-allocator.cc', + '../../src/compiler/greedy-allocator.h', + '../../src/compiler/instruction-codes.h', + '../../src/compiler/instruction-selector-impl.h', + '../../src/compiler/instruction-selector.cc', + '../../src/compiler/instruction-selector.h', + '../../src/compiler/instruction-scheduler.cc', + '../../src/compiler/instruction-scheduler.h', + '../../src/compiler/instruction.cc', + '../../src/compiler/instruction.h', + '../../src/compiler/interpreter-assembler.cc', + '../../src/compiler/interpreter-assembler.h', + '../../src/compiler/js-builtin-reducer.cc', + '../../src/compiler/js-builtin-reducer.h', + '../../src/compiler/js-call-reducer.cc', + '../../src/compiler/js-call-reducer.h', + '../../src/compiler/js-context-relaxation.cc', + '../../src/compiler/js-context-relaxation.h', + '../../src/compiler/js-context-specialization.cc', + '../../src/compiler/js-context-specialization.h', + '../../src/compiler/js-frame-specialization.cc', + '../../src/compiler/js-frame-specialization.h', + '../../src/compiler/js-generic-lowering.cc', + '../../src/compiler/js-generic-lowering.h', + '../../src/compiler/js-global-object-specialization.cc', + '../../src/compiler/js-global-object-specialization.h', + '../../src/compiler/js-graph.cc', + '../../src/compiler/js-graph.h', + '../../src/compiler/js-inlining.cc', + '../../src/compiler/js-inlining.h', + '../../src/compiler/js-inlining-heuristic.cc', + '../../src/compiler/js-inlining-heuristic.h', + '../../src/compiler/js-intrinsic-lowering.cc', + '../../src/compiler/js-intrinsic-lowering.h', + '../../src/compiler/js-native-context-specialization.cc', + '../../src/compiler/js-native-context-specialization.h', + '../../src/compiler/js-operator.cc', + '../../src/compiler/js-operator.h', + '../../src/compiler/js-typed-lowering.cc', + '../../src/compiler/js-typed-lowering.h', + '../../src/compiler/jump-threading.cc', + '../../src/compiler/jump-threading.h', + '../../src/compiler/linkage.cc', + '../../src/compiler/linkage.h', + '../../src/compiler/liveness-analyzer.cc', + '../../src/compiler/liveness-analyzer.h', + '../../src/compiler/live-range-separator.cc', + '../../src/compiler/live-range-separator.h', + '../../src/compiler/load-elimination.cc', + '../../src/compiler/load-elimination.h', + '../../src/compiler/loop-analysis.cc', + '../../src/compiler/loop-analysis.h', + '../../src/compiler/loop-peeling.cc', + '../../src/compiler/loop-peeling.h', + '../../src/compiler/machine-operator-reducer.cc', + '../../src/compiler/machine-operator-reducer.h', + '../../src/compiler/machine-operator.cc', + '../../src/compiler/machine-operator.h', + '../../src/compiler/move-optimizer.cc', + '../../src/compiler/move-optimizer.h', + '../../src/compiler/node-aux-data.h', + '../../src/compiler/node-cache.cc', + '../../src/compiler/node-cache.h', + '../../src/compiler/node-marker.cc', + '../../src/compiler/node-marker.h', + '../../src/compiler/node-matchers.cc', + '../../src/compiler/node-matchers.h', + '../../src/compiler/node-properties.cc', + '../../src/compiler/node-properties.h', + '../../src/compiler/node.cc', + '../../src/compiler/node.h', + '../../src/compiler/opcodes.cc', + '../../src/compiler/opcodes.h', + '../../src/compiler/operator-properties.cc', + '../../src/compiler/operator-properties.h', + '../../src/compiler/operator.cc', + '../../src/compiler/operator.h', + '../../src/compiler/osr.cc', + '../../src/compiler/osr.h', + '../../src/compiler/pipeline.cc', + '../../src/compiler/pipeline.h', + '../../src/compiler/pipeline-statistics.cc', + '../../src/compiler/pipeline-statistics.h', + '../../src/compiler/raw-machine-assembler.cc', + '../../src/compiler/raw-machine-assembler.h', + '../../src/compiler/register-allocator.cc', + '../../src/compiler/register-allocator.h', + '../../src/compiler/register-allocator-verifier.cc', + '../../src/compiler/register-allocator-verifier.h', + '../../src/compiler/representation-change.cc', + '../../src/compiler/representation-change.h', + '../../src/compiler/schedule.cc', + '../../src/compiler/schedule.h', + '../../src/compiler/scheduler.cc', + '../../src/compiler/scheduler.h', + '../../src/compiler/select-lowering.cc', + '../../src/compiler/select-lowering.h', + '../../src/compiler/simplified-lowering.cc', + '../../src/compiler/simplified-lowering.h', + '../../src/compiler/simplified-operator-reducer.cc', + '../../src/compiler/simplified-operator-reducer.h', + '../../src/compiler/simplified-operator.cc', + '../../src/compiler/simplified-operator.h', + '../../src/compiler/source-position.cc', + '../../src/compiler/source-position.h', + '../../src/compiler/state-values-utils.cc', + '../../src/compiler/state-values-utils.h', + '../../src/compiler/tail-call-optimization.cc', + '../../src/compiler/tail-call-optimization.h', + '../../src/compiler/type-hint-analyzer.cc', + '../../src/compiler/type-hint-analyzer.h', + '../../src/compiler/type-hints.cc', + '../../src/compiler/type-hints.h', + '../../src/compiler/typer.cc', + '../../src/compiler/typer.h', + '../../src/compiler/value-numbering-reducer.cc', + '../../src/compiler/value-numbering-reducer.h', + '../../src/compiler/verifier.cc', + '../../src/compiler/verifier.h', + '../../src/compiler/wasm-compiler.cc', + '../../src/compiler/wasm-compiler.h', + '../../src/compiler/wasm-linkage.cc', + '../../src/compiler/zone-pool.cc', + '../../src/compiler/zone-pool.h', + '../../src/compiler.cc', + '../../src/compiler.h', + '../../src/context-measure.cc', + '../../src/context-measure.h', + '../../src/contexts-inl.h', + '../../src/contexts.cc', + '../../src/contexts.h', + '../../src/conversions-inl.h', + '../../src/conversions.cc', + '../../src/conversions.h', + '../../src/counters.cc', + '../../src/counters.h', + '../../src/crankshaft/hydrogen-alias-analysis.h', + '../../src/crankshaft/hydrogen-bce.cc', + '../../src/crankshaft/hydrogen-bce.h', + '../../src/crankshaft/hydrogen-bch.cc', + '../../src/crankshaft/hydrogen-bch.h', + '../../src/crankshaft/hydrogen-canonicalize.cc', + '../../src/crankshaft/hydrogen-canonicalize.h', + '../../src/crankshaft/hydrogen-check-elimination.cc', + '../../src/crankshaft/hydrogen-check-elimination.h', + '../../src/crankshaft/hydrogen-dce.cc', + '../../src/crankshaft/hydrogen-dce.h', + '../../src/crankshaft/hydrogen-dehoist.cc', + '../../src/crankshaft/hydrogen-dehoist.h', + '../../src/crankshaft/hydrogen-environment-liveness.cc', + '../../src/crankshaft/hydrogen-environment-liveness.h', + '../../src/crankshaft/hydrogen-escape-analysis.cc', + '../../src/crankshaft/hydrogen-escape-analysis.h', + '../../src/crankshaft/hydrogen-flow-engine.h', + '../../src/crankshaft/hydrogen-gvn.cc', + '../../src/crankshaft/hydrogen-gvn.h', + '../../src/crankshaft/hydrogen-infer-representation.cc', + '../../src/crankshaft/hydrogen-infer-representation.h', + '../../src/crankshaft/hydrogen-infer-types.cc', + '../../src/crankshaft/hydrogen-infer-types.h', + '../../src/crankshaft/hydrogen-instructions.cc', + '../../src/crankshaft/hydrogen-instructions.h', + '../../src/crankshaft/hydrogen-load-elimination.cc', + '../../src/crankshaft/hydrogen-load-elimination.h', + '../../src/crankshaft/hydrogen-mark-deoptimize.cc', + '../../src/crankshaft/hydrogen-mark-deoptimize.h', + '../../src/crankshaft/hydrogen-mark-unreachable.cc', + '../../src/crankshaft/hydrogen-mark-unreachable.h', + '../../src/crankshaft/hydrogen-osr.cc', + '../../src/crankshaft/hydrogen-osr.h', + '../../src/crankshaft/hydrogen-range-analysis.cc', + '../../src/crankshaft/hydrogen-range-analysis.h', + '../../src/crankshaft/hydrogen-redundant-phi.cc', + '../../src/crankshaft/hydrogen-redundant-phi.h', + '../../src/crankshaft/hydrogen-removable-simulates.cc', + '../../src/crankshaft/hydrogen-removable-simulates.h', + '../../src/crankshaft/hydrogen-representation-changes.cc', + '../../src/crankshaft/hydrogen-representation-changes.h', + '../../src/crankshaft/hydrogen-sce.cc', + '../../src/crankshaft/hydrogen-sce.h', + '../../src/crankshaft/hydrogen-store-elimination.cc', + '../../src/crankshaft/hydrogen-store-elimination.h', + '../../src/crankshaft/hydrogen-types.cc', + '../../src/crankshaft/hydrogen-types.h', + '../../src/crankshaft/hydrogen-uint32-analysis.cc', + '../../src/crankshaft/hydrogen-uint32-analysis.h', + '../../src/crankshaft/hydrogen.cc', + '../../src/crankshaft/hydrogen.h', + '../../src/crankshaft/lithium-allocator-inl.h', + '../../src/crankshaft/lithium-allocator.cc', + '../../src/crankshaft/lithium-allocator.h', + '../../src/crankshaft/lithium-codegen.cc', + '../../src/crankshaft/lithium-codegen.h', + '../../src/crankshaft/lithium.cc', + '../../src/crankshaft/lithium.h', + '../../src/crankshaft/lithium-inl.h', + '../../src/crankshaft/typing.cc', + '../../src/crankshaft/typing.h', + '../../src/crankshaft/unique.h', + '../../src/date.cc', + '../../src/date.h', + '../../src/dateparser-inl.h', + '../../src/dateparser.cc', + '../../src/dateparser.h', + '../../src/debug/debug-evaluate.cc', + '../../src/debug/debug-evaluate.h', + '../../src/debug/debug-frames.cc', + '../../src/debug/debug-frames.h', + '../../src/debug/debug-scopes.cc', + '../../src/debug/debug-scopes.h', + '../../src/debug/debug.cc', + '../../src/debug/debug.h', + '../../src/debug/liveedit.cc', + '../../src/debug/liveedit.h', + '../../src/deoptimizer.cc', + '../../src/deoptimizer.h', + '../../src/disasm.h', + '../../src/disassembler.cc', + '../../src/disassembler.h', + '../../src/diy-fp.cc', + '../../src/diy-fp.h', + '../../src/double.h', + '../../src/dtoa.cc', + '../../src/dtoa.h', + '../../src/effects.h', + '../../src/elements-kind.cc', + '../../src/elements-kind.h', + '../../src/elements.cc', + '../../src/elements.h', + '../../src/execution.cc', + '../../src/execution.h', + '../../src/extensions/externalize-string-extension.cc', + '../../src/extensions/externalize-string-extension.h', + '../../src/extensions/free-buffer-extension.cc', + '../../src/extensions/free-buffer-extension.h', + '../../src/extensions/gc-extension.cc', + '../../src/extensions/gc-extension.h', + '../../src/extensions/statistics-extension.cc', + '../../src/extensions/statistics-extension.h', + '../../src/extensions/trigger-failure-extension.cc', + '../../src/extensions/trigger-failure-extension.h', + '../../src/factory.cc', + '../../src/factory.h', + '../../src/fast-dtoa.cc', + '../../src/fast-dtoa.h', + '../../src/field-index.h', + '../../src/field-index-inl.h', + '../../src/fixed-dtoa.cc', + '../../src/fixed-dtoa.h', + '../../src/flag-definitions.h', + '../../src/flags.cc', + '../../src/flags.h', + '../../src/frames-inl.h', + '../../src/frames.cc', + '../../src/frames.h', + '../../src/full-codegen/full-codegen.cc', + '../../src/full-codegen/full-codegen.h', + '../../src/futex-emulation.cc', + '../../src/futex-emulation.h', + '../../src/gdb-jit.cc', + '../../src/gdb-jit.h', + '../../src/global-handles.cc', + '../../src/global-handles.h', + '../../src/globals.h', + '../../src/handles-inl.h', + '../../src/handles.cc', + '../../src/handles.h', + '../../src/hashmap.h', + '../../src/heap/array-buffer-tracker.cc', + '../../src/heap/array-buffer-tracker.h', + '../../src/heap/memory-reducer.cc', + '../../src/heap/memory-reducer.h', + '../../src/heap/gc-idle-time-handler.cc', + '../../src/heap/gc-idle-time-handler.h', + '../../src/heap/gc-tracer.cc', + '../../src/heap/gc-tracer.h', + '../../src/heap/heap-inl.h', + '../../src/heap/heap.cc', + '../../src/heap/heap.h', + '../../src/heap/incremental-marking-inl.h', + '../../src/heap/incremental-marking-job.cc', + '../../src/heap/incremental-marking-job.h', + '../../src/heap/incremental-marking.cc', + '../../src/heap/incremental-marking.h', + '../../src/heap/mark-compact-inl.h', + '../../src/heap/mark-compact.cc', + '../../src/heap/mark-compact.h', + '../../src/heap/object-stats.cc', + '../../src/heap/object-stats.h', + '../../src/heap/objects-visiting-inl.h', + '../../src/heap/objects-visiting.cc', + '../../src/heap/objects-visiting.h', + '../../src/heap/scavenge-job.h', + '../../src/heap/scavenge-job.cc', + '../../src/heap/scavenger-inl.h', + '../../src/heap/scavenger.cc', + '../../src/heap/scavenger.h', + '../../src/heap/slots-buffer.cc', + '../../src/heap/slots-buffer.h', + '../../src/heap/spaces-inl.h', + '../../src/heap/spaces.cc', + '../../src/heap/spaces.h', + '../../src/heap/store-buffer-inl.h', + '../../src/heap/store-buffer.cc', + '../../src/heap/store-buffer.h', + '../../src/i18n.cc', + '../../src/i18n.h', + '../../src/icu_util.cc', + '../../src/icu_util.h', + '../../src/ic/access-compiler.cc', + '../../src/ic/access-compiler.h', + '../../src/ic/call-optimization.cc', + '../../src/ic/call-optimization.h', + '../../src/ic/handler-compiler.cc', + '../../src/ic/handler-compiler.h', + '../../src/ic/ic-inl.h', + '../../src/ic/ic-state.cc', + '../../src/ic/ic-state.h', + '../../src/ic/ic.cc', + '../../src/ic/ic.h', + '../../src/ic/ic-compiler.cc', + '../../src/ic/ic-compiler.h', + '../../src/identity-map.cc', + '../../src/identity-map.h', + '../../src/interface-descriptors.cc', + '../../src/interface-descriptors.h', + '../../src/interpreter/bytecodes.cc', + '../../src/interpreter/bytecodes.h', + '../../src/interpreter/bytecode-array-builder.cc', + '../../src/interpreter/bytecode-array-builder.h', + '../../src/interpreter/bytecode-array-iterator.cc', + '../../src/interpreter/bytecode-array-iterator.h', + '../../src/interpreter/bytecode-register-allocator.cc', + '../../src/interpreter/bytecode-register-allocator.h', + '../../src/interpreter/bytecode-generator.cc', + '../../src/interpreter/bytecode-generator.h', + '../../src/interpreter/bytecode-traits.h', + '../../src/interpreter/constant-array-builder.cc', + '../../src/interpreter/constant-array-builder.h', + '../../src/interpreter/control-flow-builders.cc', + '../../src/interpreter/control-flow-builders.h', + '../../src/interpreter/interpreter.cc', + '../../src/interpreter/interpreter.h', + '../../src/isolate-inl.h', + '../../src/isolate.cc', + '../../src/isolate.h', + '../../src/json-stringifier.h', + '../../src/key-accumulator.h', + '../../src/key-accumulator.cc', + '../../src/layout-descriptor-inl.h', + '../../src/layout-descriptor.cc', + '../../src/layout-descriptor.h', + '../../src/list-inl.h', + '../../src/list.h', + '../../src/locked-queue-inl.h', + '../../src/locked-queue.h', + '../../src/log-inl.h', + '../../src/log-utils.cc', + '../../src/log-utils.h', + '../../src/log.cc', + '../../src/log.h', + '../../src/lookup.cc', + '../../src/lookup.h', + '../../src/macro-assembler.h', + '../../src/machine-type.cc', + '../../src/machine-type.h', + '../../src/messages.cc', + '../../src/messages.h', + '../../src/msan.h', + '../../src/objects-body-descriptors-inl.h', + '../../src/objects-body-descriptors.h', + '../../src/objects-debug.cc', + '../../src/objects-inl.h', + '../../src/objects-printer.cc', + '../../src/objects.cc', + '../../src/objects.h', + '../../src/optimizing-compile-dispatcher.cc', + '../../src/optimizing-compile-dispatcher.h', + '../../src/ostreams.cc', + '../../src/ostreams.h', + '../../src/parsing/expression-classifier.h', + '../../src/parsing/func-name-inferrer.cc', + '../../src/parsing/func-name-inferrer.h', + '../../src/parsing/json-parser.h', + '../../src/parsing/parameter-initializer-rewriter.cc', + '../../src/parsing/parameter-initializer-rewriter.h', + '../../src/parsing/parser-base.h', + '../../src/parsing/parser.cc', + '../../src/parsing/parser.h', + '../../src/parsing/pattern-rewriter.cc', + '../../src/parsing/preparse-data-format.h', + '../../src/parsing/preparse-data.cc', + '../../src/parsing/preparse-data.h', + '../../src/parsing/preparser.cc', + '../../src/parsing/preparser.h', + '../../src/parsing/rewriter.cc', + '../../src/parsing/rewriter.h', + '../../src/parsing/scanner-character-streams.cc', + '../../src/parsing/scanner-character-streams.h', + '../../src/parsing/scanner.cc', + '../../src/parsing/scanner.h', + '../../src/parsing/token.cc', + '../../src/parsing/token.h', + '../../src/pending-compilation-error-handler.cc', + '../../src/pending-compilation-error-handler.h', + '../../src/profiler/allocation-tracker.cc', + '../../src/profiler/allocation-tracker.h', + '../../src/profiler/circular-queue-inl.h', + '../../src/profiler/circular-queue.h', + '../../src/profiler/cpu-profiler-inl.h', + '../../src/profiler/cpu-profiler.cc', + '../../src/profiler/cpu-profiler.h', + '../../src/profiler/heap-profiler.cc', + '../../src/profiler/heap-profiler.h', + '../../src/profiler/heap-snapshot-generator-inl.h', + '../../src/profiler/heap-snapshot-generator.cc', + '../../src/profiler/heap-snapshot-generator.h', + '../../src/profiler/profile-generator-inl.h', + '../../src/profiler/profile-generator.cc', + '../../src/profiler/profile-generator.h', + '../../src/profiler/sampler.cc', + '../../src/profiler/sampler.h', + '../../src/profiler/strings-storage.cc', + '../../src/profiler/strings-storage.h', + '../../src/profiler/unbound-queue-inl.h', + '../../src/profiler/unbound-queue.h', + '../../src/property-descriptor.cc', + '../../src/property-descriptor.h', + '../../src/property-details.h', + '../../src/property.cc', + '../../src/property.h', + '../../src/prototype.h', + '../../src/regexp/bytecodes-irregexp.h', + '../../src/regexp/interpreter-irregexp.cc', + '../../src/regexp/interpreter-irregexp.h', + '../../src/regexp/jsregexp-inl.h', + '../../src/regexp/jsregexp.cc', + '../../src/regexp/jsregexp.h', + '../../src/regexp/regexp-ast.cc', + '../../src/regexp/regexp-ast.h', + '../../src/regexp/regexp-macro-assembler-irregexp-inl.h', + '../../src/regexp/regexp-macro-assembler-irregexp.cc', + '../../src/regexp/regexp-macro-assembler-irregexp.h', + '../../src/regexp/regexp-macro-assembler-tracer.cc', + '../../src/regexp/regexp-macro-assembler-tracer.h', + '../../src/regexp/regexp-macro-assembler.cc', + '../../src/regexp/regexp-macro-assembler.h', + '../../src/regexp/regexp-parser.cc', + '../../src/regexp/regexp-parser.h', + '../../src/regexp/regexp-stack.cc', + '../../src/regexp/regexp-stack.h', + '../../src/register-configuration.cc', + '../../src/register-configuration.h', + '../../src/runtime-profiler.cc', + '../../src/runtime-profiler.h', + '../../src/runtime/runtime-array.cc', + '../../src/runtime/runtime-atomics.cc', + '../../src/runtime/runtime-classes.cc', + '../../src/runtime/runtime-collections.cc', + '../../src/runtime/runtime-compiler.cc', + '../../src/runtime/runtime-date.cc', + '../../src/runtime/runtime-debug.cc', + '../../src/runtime/runtime-forin.cc', + '../../src/runtime/runtime-function.cc', + '../../src/runtime/runtime-futex.cc', + '../../src/runtime/runtime-generator.cc', + '../../src/runtime/runtime-i18n.cc', + '../../src/runtime/runtime-internal.cc', + '../../src/runtime/runtime-interpreter.cc', + '../../src/runtime/runtime-json.cc', + '../../src/runtime/runtime-literals.cc', + '../../src/runtime/runtime-liveedit.cc', + '../../src/runtime/runtime-maths.cc', + '../../src/runtime/runtime-numbers.cc', + '../../src/runtime/runtime-object.cc', + '../../src/runtime/runtime-observe.cc', + '../../src/runtime/runtime-operators.cc', + '../../src/runtime/runtime-proxy.cc', + '../../src/runtime/runtime-regexp.cc', + '../../src/runtime/runtime-scopes.cc', + '../../src/runtime/runtime-simd.cc', + '../../src/runtime/runtime-strings.cc', + '../../src/runtime/runtime-symbol.cc', + '../../src/runtime/runtime-test.cc', + '../../src/runtime/runtime-typedarray.cc', + '../../src/runtime/runtime-uri.cc', + '../../src/runtime/runtime-utils.h', + '../../src/runtime/runtime.cc', + '../../src/runtime/runtime.h', + '../../src/safepoint-table.cc', + '../../src/safepoint-table.h', + '../../src/signature.h', + '../../src/simulator.h', + '../../src/small-pointer-list.h', + '../../src/snapshot/natives.h', + '../../src/snapshot/natives-common.cc', + '../../src/snapshot/serialize.cc', + '../../src/snapshot/serialize.h', + '../../src/snapshot/snapshot.h', + '../../src/snapshot/snapshot-common.cc', + '../../src/snapshot/snapshot-source-sink.cc', + '../../src/snapshot/snapshot-source-sink.h', + '../../src/splay-tree.h', + '../../src/splay-tree-inl.h', + '../../src/startup-data-util.cc', + '../../src/startup-data-util.h', + '../../src/string-builder.cc', + '../../src/string-builder.h', + '../../src/string-search.h', + '../../src/string-stream.cc', + '../../src/string-stream.h', + '../../src/strtod.cc', + '../../src/strtod.h', + '../../src/ic/stub-cache.cc', + '../../src/ic/stub-cache.h', + '../../src/tracing/trace-event.cc', + '../../src/tracing/trace-event.h', + '../../src/transitions-inl.h', + '../../src/transitions.cc', + '../../src/transitions.h', + '../../src/type-cache.cc', + '../../src/type-cache.h', + '../../src/type-feedback-vector-inl.h', + '../../src/type-feedback-vector.cc', + '../../src/type-feedback-vector.h', + '../../src/type-info.cc', + '../../src/type-info.h', + '../../src/types-inl.h', + '../../src/types.cc', + '../../src/types.h', + '../../src/typing-asm.cc', + '../../src/typing-asm.h', + '../../src/typing-reset.cc', + '../../src/typing-reset.h', + '../../src/unicode-inl.h', + '../../src/unicode.cc', + '../../src/unicode.h', + '../../src/unicode-cache-inl.h', + '../../src/unicode-cache.h', + '../../src/unicode-decoder.cc', + '../../src/unicode-decoder.h', + '../../src/utils.cc', + '../../src/utils.h', + '../../src/v8.cc', + '../../src/v8.h', + '../../src/v8memory.h', + '../../src/v8threads.cc', + '../../src/v8threads.h', + '../../src/vector.h', + '../../src/version.cc', + '../../src/version.h', + '../../src/vm-state-inl.h', + '../../src/vm-state.h', + '../../src/wasm/asm-wasm-builder.cc', + '../../src/wasm/asm-wasm-builder.h', + '../../src/wasm/ast-decoder.cc', + '../../src/wasm/ast-decoder.h', + '../../src/wasm/decoder.h', + '../../src/wasm/encoder.cc', + '../../src/wasm/encoder.h', + '../../src/wasm/module-decoder.cc', + '../../src/wasm/module-decoder.h', + '../../src/wasm/wasm-js.cc', + '../../src/wasm/wasm-js.h', + '../../src/wasm/wasm-macro-gen.h', + '../../src/wasm/wasm-module.cc', + '../../src/wasm/wasm-module.h', + '../../src/wasm/wasm-opcodes.cc', + '../../src/wasm/wasm-opcodes.h', + '../../src/wasm/wasm-result.cc', + '../../src/wasm/wasm-result.h', + '../../src/zone.cc', + '../../src/zone.h', + '../../src/zone-allocator.h', + '../../src/zone-containers.h', + '../../src/third_party/fdlibm/fdlibm.cc', + '../../src/third_party/fdlibm/fdlibm.h', + ], + 'conditions': [ + ['OS!="win" and remove_v8base_debug_symbols==1', { + 'cflags!': ['-g', '-gdwarf-4'], + }], + ['want_separate_host_toolset==1', { + 'toolsets': ['host', 'target'], + }, { + 'toolsets': ['target'], + }], + ['v8_target_arch=="arm"', { + 'sources': [ ### gcmole(arch:arm) ### + '../../src/arm/assembler-arm-inl.h', + '../../src/arm/assembler-arm.cc', + '../../src/arm/assembler-arm.h', + '../../src/arm/builtins-arm.cc', + '../../src/arm/code-stubs-arm.cc', + '../../src/arm/code-stubs-arm.h', + '../../src/arm/codegen-arm.cc', + '../../src/arm/codegen-arm.h', + '../../src/arm/constants-arm.h', + '../../src/arm/constants-arm.cc', + '../../src/arm/cpu-arm.cc', + '../../src/arm/deoptimizer-arm.cc', + '../../src/arm/disasm-arm.cc', + '../../src/arm/frames-arm.cc', + '../../src/arm/frames-arm.h', + '../../src/arm/interface-descriptors-arm.cc', + '../../src/arm/interface-descriptors-arm.h', + '../../src/arm/macro-assembler-arm.cc', + '../../src/arm/macro-assembler-arm.h', + '../../src/arm/simulator-arm.cc', + '../../src/arm/simulator-arm.h', + '../../src/compiler/arm/code-generator-arm.cc', + '../../src/compiler/arm/instruction-codes-arm.h', + '../../src/compiler/arm/instruction-scheduler-arm.cc', + '../../src/compiler/arm/instruction-selector-arm.cc', + '../../src/crankshaft/arm/lithium-arm.cc', + '../../src/crankshaft/arm/lithium-arm.h', + '../../src/crankshaft/arm/lithium-codegen-arm.cc', + '../../src/crankshaft/arm/lithium-codegen-arm.h', + '../../src/crankshaft/arm/lithium-gap-resolver-arm.cc', + '../../src/crankshaft/arm/lithium-gap-resolver-arm.h', + '../../src/debug/arm/debug-arm.cc', + '../../src/full-codegen/arm/full-codegen-arm.cc', + '../../src/ic/arm/access-compiler-arm.cc', + '../../src/ic/arm/handler-compiler-arm.cc', + '../../src/ic/arm/ic-arm.cc', + '../../src/ic/arm/ic-compiler-arm.cc', + '../../src/ic/arm/stub-cache-arm.cc', + '../../src/regexp/arm/regexp-macro-assembler-arm.cc', + '../../src/regexp/arm/regexp-macro-assembler-arm.h', + ], + }], + ['v8_target_arch=="arm64"', { + 'sources': [ ### gcmole(arch:arm64) ### + '../../src/arm64/assembler-arm64.cc', + '../../src/arm64/assembler-arm64.h', + '../../src/arm64/assembler-arm64-inl.h', + '../../src/arm64/builtins-arm64.cc', + '../../src/arm64/codegen-arm64.cc', + '../../src/arm64/codegen-arm64.h', + '../../src/arm64/code-stubs-arm64.cc', + '../../src/arm64/code-stubs-arm64.h', + '../../src/arm64/constants-arm64.h', + '../../src/arm64/cpu-arm64.cc', + '../../src/arm64/decoder-arm64.cc', + '../../src/arm64/decoder-arm64.h', + '../../src/arm64/decoder-arm64-inl.h', + '../../src/arm64/deoptimizer-arm64.cc', + '../../src/arm64/disasm-arm64.cc', + '../../src/arm64/disasm-arm64.h', + '../../src/arm64/frames-arm64.cc', + '../../src/arm64/frames-arm64.h', + '../../src/arm64/instructions-arm64.cc', + '../../src/arm64/instructions-arm64.h', + '../../src/arm64/instrument-arm64.cc', + '../../src/arm64/instrument-arm64.h', + '../../src/arm64/interface-descriptors-arm64.cc', + '../../src/arm64/interface-descriptors-arm64.h', + '../../src/arm64/macro-assembler-arm64.cc', + '../../src/arm64/macro-assembler-arm64.h', + '../../src/arm64/macro-assembler-arm64-inl.h', + '../../src/arm64/simulator-arm64.cc', + '../../src/arm64/simulator-arm64.h', + '../../src/arm64/utils-arm64.cc', + '../../src/arm64/utils-arm64.h', + '../../src/compiler/arm64/code-generator-arm64.cc', + '../../src/compiler/arm64/instruction-codes-arm64.h', + '../../src/compiler/arm64/instruction-scheduler-arm64.cc', + '../../src/compiler/arm64/instruction-selector-arm64.cc', + '../../src/crankshaft/arm64/delayed-masm-arm64.cc', + '../../src/crankshaft/arm64/delayed-masm-arm64.h', + '../../src/crankshaft/arm64/delayed-masm-arm64-inl.h', + '../../src/crankshaft/arm64/lithium-arm64.cc', + '../../src/crankshaft/arm64/lithium-arm64.h', + '../../src/crankshaft/arm64/lithium-codegen-arm64.cc', + '../../src/crankshaft/arm64/lithium-codegen-arm64.h', + '../../src/crankshaft/arm64/lithium-gap-resolver-arm64.cc', + '../../src/crankshaft/arm64/lithium-gap-resolver-arm64.h', + '../../src/debug/arm64/debug-arm64.cc', + '../../src/full-codegen/arm64/full-codegen-arm64.cc', + '../../src/ic/arm64/access-compiler-arm64.cc', + '../../src/ic/arm64/handler-compiler-arm64.cc', + '../../src/ic/arm64/ic-arm64.cc', + '../../src/ic/arm64/ic-compiler-arm64.cc', + '../../src/ic/arm64/stub-cache-arm64.cc', + '../../src/regexp/arm64/regexp-macro-assembler-arm64.cc', + '../../src/regexp/arm64/regexp-macro-assembler-arm64.h', + ], + }], + ['v8_target_arch=="ia32"', { + 'sources': [ ### gcmole(arch:ia32) ### + '../../src/ia32/assembler-ia32-inl.h', + '../../src/ia32/assembler-ia32.cc', + '../../src/ia32/assembler-ia32.h', + '../../src/ia32/builtins-ia32.cc', + '../../src/ia32/code-stubs-ia32.cc', + '../../src/ia32/code-stubs-ia32.h', + '../../src/ia32/codegen-ia32.cc', + '../../src/ia32/codegen-ia32.h', + '../../src/ia32/cpu-ia32.cc', + '../../src/ia32/deoptimizer-ia32.cc', + '../../src/ia32/disasm-ia32.cc', + '../../src/ia32/frames-ia32.cc', + '../../src/ia32/frames-ia32.h', + '../../src/ia32/interface-descriptors-ia32.cc', + '../../src/ia32/macro-assembler-ia32.cc', + '../../src/ia32/macro-assembler-ia32.h', + '../../src/compiler/ia32/code-generator-ia32.cc', + '../../src/compiler/ia32/instruction-codes-ia32.h', + '../../src/compiler/ia32/instruction-scheduler-ia32.cc', + '../../src/compiler/ia32/instruction-selector-ia32.cc', + '../../src/crankshaft/ia32/lithium-codegen-ia32.cc', + '../../src/crankshaft/ia32/lithium-codegen-ia32.h', + '../../src/crankshaft/ia32/lithium-gap-resolver-ia32.cc', + '../../src/crankshaft/ia32/lithium-gap-resolver-ia32.h', + '../../src/crankshaft/ia32/lithium-ia32.cc', + '../../src/crankshaft/ia32/lithium-ia32.h', + '../../src/debug/ia32/debug-ia32.cc', + '../../src/full-codegen/ia32/full-codegen-ia32.cc', + '../../src/ic/ia32/access-compiler-ia32.cc', + '../../src/ic/ia32/handler-compiler-ia32.cc', + '../../src/ic/ia32/ic-ia32.cc', + '../../src/ic/ia32/ic-compiler-ia32.cc', + '../../src/ic/ia32/stub-cache-ia32.cc', + '../../src/regexp/ia32/regexp-macro-assembler-ia32.cc', + '../../src/regexp/ia32/regexp-macro-assembler-ia32.h', + ], + }], + ['v8_target_arch=="x87"', { + 'sources': [ ### gcmole(arch:x87) ### + '../../src/x87/assembler-x87-inl.h', + '../../src/x87/assembler-x87.cc', + '../../src/x87/assembler-x87.h', + '../../src/x87/builtins-x87.cc', + '../../src/x87/code-stubs-x87.cc', + '../../src/x87/code-stubs-x87.h', + '../../src/x87/codegen-x87.cc', + '../../src/x87/codegen-x87.h', + '../../src/x87/cpu-x87.cc', + '../../src/x87/deoptimizer-x87.cc', + '../../src/x87/disasm-x87.cc', + '../../src/x87/frames-x87.cc', + '../../src/x87/frames-x87.h', + '../../src/x87/interface-descriptors-x87.cc', + '../../src/x87/macro-assembler-x87.cc', + '../../src/x87/macro-assembler-x87.h', + '../../src/compiler/x87/code-generator-x87.cc', + '../../src/compiler/x87/instruction-codes-x87.h', + '../../src/compiler/x87/instruction-scheduler-x87.cc', + '../../src/compiler/x87/instruction-selector-x87.cc', + '../../src/crankshaft/x87/lithium-codegen-x87.cc', + '../../src/crankshaft/x87/lithium-codegen-x87.h', + '../../src/crankshaft/x87/lithium-gap-resolver-x87.cc', + '../../src/crankshaft/x87/lithium-gap-resolver-x87.h', + '../../src/crankshaft/x87/lithium-x87.cc', + '../../src/crankshaft/x87/lithium-x87.h', + '../../src/debug/x87/debug-x87.cc', + '../../src/full-codegen/x87/full-codegen-x87.cc', + '../../src/ic/x87/access-compiler-x87.cc', + '../../src/ic/x87/handler-compiler-x87.cc', + '../../src/ic/x87/ic-x87.cc', + '../../src/ic/x87/ic-compiler-x87.cc', + '../../src/ic/x87/stub-cache-x87.cc', + '../../src/regexp/x87/regexp-macro-assembler-x87.cc', + '../../src/regexp/x87/regexp-macro-assembler-x87.h', + ], + }], + ['v8_target_arch=="mips" or v8_target_arch=="mipsel"', { + 'sources': [ ### gcmole(arch:mipsel) ### + '../../src/mips/assembler-mips.cc', + '../../src/mips/assembler-mips.h', + '../../src/mips/assembler-mips-inl.h', + '../../src/mips/builtins-mips.cc', + '../../src/mips/codegen-mips.cc', + '../../src/mips/codegen-mips.h', + '../../src/mips/code-stubs-mips.cc', + '../../src/mips/code-stubs-mips.h', + '../../src/mips/constants-mips.cc', + '../../src/mips/constants-mips.h', + '../../src/mips/cpu-mips.cc', + '../../src/mips/deoptimizer-mips.cc', + '../../src/mips/disasm-mips.cc', + '../../src/mips/frames-mips.cc', + '../../src/mips/frames-mips.h', + '../../src/mips/interface-descriptors-mips.cc', + '../../src/mips/macro-assembler-mips.cc', + '../../src/mips/macro-assembler-mips.h', + '../../src/mips/simulator-mips.cc', + '../../src/mips/simulator-mips.h', + '../../src/compiler/mips/code-generator-mips.cc', + '../../src/compiler/mips/instruction-codes-mips.h', + '../../src/compiler/mips/instruction-scheduler-mips.cc', + '../../src/compiler/mips/instruction-selector-mips.cc', + '../../src/crankshaft/mips/lithium-codegen-mips.cc', + '../../src/crankshaft/mips/lithium-codegen-mips.h', + '../../src/crankshaft/mips/lithium-gap-resolver-mips.cc', + '../../src/crankshaft/mips/lithium-gap-resolver-mips.h', + '../../src/crankshaft/mips/lithium-mips.cc', + '../../src/crankshaft/mips/lithium-mips.h', + '../../src/full-codegen/mips/full-codegen-mips.cc', + '../../src/debug/mips/debug-mips.cc', + '../../src/ic/mips/access-compiler-mips.cc', + '../../src/ic/mips/handler-compiler-mips.cc', + '../../src/ic/mips/ic-mips.cc', + '../../src/ic/mips/ic-compiler-mips.cc', + '../../src/ic/mips/stub-cache-mips.cc', + '../../src/regexp/mips/regexp-macro-assembler-mips.cc', + '../../src/regexp/mips/regexp-macro-assembler-mips.h', + ], + }], + ['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', { + 'sources': [ ### gcmole(arch:mips64el) ### + '../../src/mips64/assembler-mips64.cc', + '../../src/mips64/assembler-mips64.h', + '../../src/mips64/assembler-mips64-inl.h', + '../../src/mips64/builtins-mips64.cc', + '../../src/mips64/codegen-mips64.cc', + '../../src/mips64/codegen-mips64.h', + '../../src/mips64/code-stubs-mips64.cc', + '../../src/mips64/code-stubs-mips64.h', + '../../src/mips64/constants-mips64.cc', + '../../src/mips64/constants-mips64.h', + '../../src/mips64/cpu-mips64.cc', + '../../src/mips64/deoptimizer-mips64.cc', + '../../src/mips64/disasm-mips64.cc', + '../../src/mips64/frames-mips64.cc', + '../../src/mips64/frames-mips64.h', + '../../src/mips64/interface-descriptors-mips64.cc', + '../../src/mips64/macro-assembler-mips64.cc', + '../../src/mips64/macro-assembler-mips64.h', + '../../src/mips64/simulator-mips64.cc', + '../../src/mips64/simulator-mips64.h', + '../../src/compiler/mips64/code-generator-mips64.cc', + '../../src/compiler/mips64/instruction-codes-mips64.h', + '../../src/compiler/mips64/instruction-scheduler-mips64.cc', + '../../src/compiler/mips64/instruction-selector-mips64.cc', + '../../src/crankshaft/mips64/lithium-codegen-mips64.cc', + '../../src/crankshaft/mips64/lithium-codegen-mips64.h', + '../../src/crankshaft/mips64/lithium-gap-resolver-mips64.cc', + '../../src/crankshaft/mips64/lithium-gap-resolver-mips64.h', + '../../src/crankshaft/mips64/lithium-mips64.cc', + '../../src/crankshaft/mips64/lithium-mips64.h', + '../../src/debug/mips64/debug-mips64.cc', + '../../src/full-codegen/mips64/full-codegen-mips64.cc', + '../../src/ic/mips64/access-compiler-mips64.cc', + '../../src/ic/mips64/handler-compiler-mips64.cc', + '../../src/ic/mips64/ic-mips64.cc', + '../../src/ic/mips64/ic-compiler-mips64.cc', + '../../src/ic/mips64/stub-cache-mips64.cc', + '../../src/regexp/mips64/regexp-macro-assembler-mips64.cc', + '../../src/regexp/mips64/regexp-macro-assembler-mips64.h', + ], + }], + ['v8_target_arch=="x64" or v8_target_arch=="x32"', { + 'sources': [ ### gcmole(arch:x64) ### + '../../src/crankshaft/x64/lithium-codegen-x64.cc', + '../../src/crankshaft/x64/lithium-codegen-x64.h', + '../../src/crankshaft/x64/lithium-gap-resolver-x64.cc', + '../../src/crankshaft/x64/lithium-gap-resolver-x64.h', + '../../src/crankshaft/x64/lithium-x64.cc', + '../../src/crankshaft/x64/lithium-x64.h', + '../../src/x64/assembler-x64-inl.h', + '../../src/x64/assembler-x64.cc', + '../../src/x64/assembler-x64.h', + '../../src/x64/builtins-x64.cc', + '../../src/x64/code-stubs-x64.cc', + '../../src/x64/code-stubs-x64.h', + '../../src/x64/codegen-x64.cc', + '../../src/x64/codegen-x64.h', + '../../src/x64/cpu-x64.cc', + '../../src/x64/deoptimizer-x64.cc', + '../../src/x64/disasm-x64.cc', + '../../src/x64/frames-x64.cc', + '../../src/x64/frames-x64.h', + '../../src/x64/interface-descriptors-x64.cc', + '../../src/x64/macro-assembler-x64.cc', + '../../src/x64/macro-assembler-x64.h', + '../../src/debug/x64/debug-x64.cc', + '../../src/full-codegen/x64/full-codegen-x64.cc', + '../../src/ic/x64/access-compiler-x64.cc', + '../../src/ic/x64/handler-compiler-x64.cc', + '../../src/ic/x64/ic-x64.cc', + '../../src/ic/x64/ic-compiler-x64.cc', + '../../src/ic/x64/stub-cache-x64.cc', + '../../src/regexp/x64/regexp-macro-assembler-x64.cc', + '../../src/regexp/x64/regexp-macro-assembler-x64.h', + ], + }], + ['v8_target_arch=="x64"', { + 'sources': [ + '../../src/compiler/x64/code-generator-x64.cc', + '../../src/compiler/x64/instruction-codes-x64.h', + '../../src/compiler/x64/instruction-scheduler-x64.cc', + '../../src/compiler/x64/instruction-selector-x64.cc', + ], + }], + ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', { + 'sources': [ ### gcmole(arch:ppc) ### + '../../src/compiler/ppc/code-generator-ppc.cc', + '../../src/compiler/ppc/instruction-codes-ppc.h', + '../../src/compiler/ppc/instruction-scheduler-ppc.cc', + '../../src/compiler/ppc/instruction-selector-ppc.cc', + '../../src/crankshaft/ppc/lithium-ppc.cc', + '../../src/crankshaft/ppc/lithium-ppc.h', + '../../src/crankshaft/ppc/lithium-codegen-ppc.cc', + '../../src/crankshaft/ppc/lithium-codegen-ppc.h', + '../../src/crankshaft/ppc/lithium-gap-resolver-ppc.cc', + '../../src/crankshaft/ppc/lithium-gap-resolver-ppc.h', + '../../src/debug/ppc/debug-ppc.cc', + '../../src/full-codegen/ppc/full-codegen-ppc.cc', + '../../src/ic/ppc/access-compiler-ppc.cc', + '../../src/ic/ppc/handler-compiler-ppc.cc', + '../../src/ic/ppc/ic-ppc.cc', + '../../src/ic/ppc/ic-compiler-ppc.cc', + '../../src/ic/ppc/stub-cache-ppc.cc', + '../../src/ppc/assembler-ppc-inl.h', + '../../src/ppc/assembler-ppc.cc', + '../../src/ppc/assembler-ppc.h', + '../../src/ppc/builtins-ppc.cc', + '../../src/ppc/code-stubs-ppc.cc', + '../../src/ppc/code-stubs-ppc.h', + '../../src/ppc/codegen-ppc.cc', + '../../src/ppc/codegen-ppc.h', + '../../src/ppc/constants-ppc.h', + '../../src/ppc/constants-ppc.cc', + '../../src/ppc/cpu-ppc.cc', + '../../src/ppc/deoptimizer-ppc.cc', + '../../src/ppc/disasm-ppc.cc', + '../../src/ppc/frames-ppc.cc', + '../../src/ppc/frames-ppc.h', + '../../src/ppc/interface-descriptors-ppc.cc', + '../../src/ppc/interface-descriptors-ppc.h', + '../../src/ppc/macro-assembler-ppc.cc', + '../../src/ppc/macro-assembler-ppc.h', + '../../src/ppc/simulator-ppc.cc', + '../../src/ppc/simulator-ppc.h', + '../../src/regexp/ppc/regexp-macro-assembler-ppc.cc', + '../../src/regexp/ppc/regexp-macro-assembler-ppc.h', + ], + }], + ['OS=="win"', { + 'variables': { + 'gyp_generators': '