commit d76f53909c726b7c5f62ee267898533beb6c4e65
Author: Kevin Kofler <kevin.kofler(a)chello.at>
Date: Tue Jun 13 03:35:54 2017 +0200
Update to 5.9.0
* Tue Jun 13 2017 Kevin Kofler <Kevin(a)tigcc.ticalc.org> - 5.9.0-1
- Update to 5.9.0
- Update version numbers of bundled stuff
- Use bundled libsrtp and protobuf, Chromium dropped unbundling support for them
- Use bundled libxml2 and libxslt, QtWebEngine 5.9 requires a libxml2 built with
ICU due to
https://bugreports.qt.io/browse/QTBUG-59094, Fedora libxml2 is not
- Add missing Provides: bundled(hunspell) for the spellchecking added in 5.8
- Rebase linux-pri, no-neon, system-icu-utf, no-sse2, arm-fpu-fix,
openmax-dl-neon and webrtc-neon-detect patches (port to GN)
- Sync system-nspr-prtime patch with Debian (they ported it to GN)
- Rebase fix-extractcflag patch
- Restore NEON runtime detection in Skia, drop old skia-neon patch (rewritten)
- Drop webrtc-neon, v8-gcc7, pdfium-gcc7, wtf-gcc7, fix-open-in-new-tab and
fix-dead-keys patches, fixed upstream
- Update system libvpx/libwebp version requirements (libvpx now F25+ only)
- Drop the flag hacks (-g1 -fno-delete-null-pointer-checks), fixed upstream
- Force verbose output from the GN bootstrap process
- Backport upstream patch to fix GN FTBFS on aarch64 (QTBUG-61128)
- Backport patch to fix FTBFS with GCC on aarch64 from upstream Chromium
- Fix src/3rdparty/chromium/build/linux/unbundle/re2.gn
- Delete all "toolprefix = " lines from build/toolchain/linux/BUILD.gn
.gitignore | 1 +
qt5-qtwebengine-freeworld.spec | 183 +-
...pensource-src-5.6.0-beta-fix-extractcflag.patch | 12 -
qtwebengine-opensource-src-5.7.0-linux-pri.patch | 26 -
qtwebengine-opensource-src-5.7.0-webrtc-neon.patch | 21 -
qtwebengine-opensource-src-5.7.1-arm-fpu-fix.patch | 12 -
qtwebengine-opensource-src-5.7.1-no-neon.patch | 15 -
qtwebengine-opensource-src-5.7.1-skia-neon.patch | 15 -
...engine-opensource-src-5.8.0-fix-dead-keys.patch | 40 -
...-opensource-src-5.8.0-fix-open-in-new-tab.patch | 46 -
qtwebengine-opensource-src-5.8.0-no-sse2.patch | 5311 --------------------
qtwebengine-opensource-src-5.8.0-pdfium-gcc7.patch | 600 ---
...e-opensource-src-5.8.0-system-nspr-prtime.patch | 48 -
qtwebengine-opensource-src-5.8.0-v8-gcc7.patch | 71 -
...e-opensource-src-5.8.0-webrtc-neon-detect.patch | 32 -
qtwebengine-opensource-src-5.8.0-wtf-gcc7.patch | 12 -
...pensource-src-5.9.0-aarch64-gcc-toolchain.patch | 30 +
qtwebengine-opensource-src-5.9.0-arm-fpu-fix.patch | 11 +
...ine-opensource-src-5.9.0-fix-extractcflag.patch | 12 +
qtwebengine-opensource-src-5.9.0-gn-aarch64.patch | 43 +
...opensource-src-5.9.0-gn-bootstrap-verbose.patch | 12 +
qtwebengine-opensource-src-5.9.0-linux-pri.patch | 26 +
qtwebengine-opensource-src-5.9.0-no-neon.patch | 14 +
qtwebengine-opensource-src-5.9.0-no-sse2.patch | 3108 ++++++++++++
...gine-opensource-src-5.9.0-openmax-dl-neon.patch | 38 +-
qtwebengine-opensource-src-5.9.0-skia-neon.patch | 436 ++
...ngine-opensource-src-5.9.0-system-icu-utf.patch | 129 +-
...e-opensource-src-5.9.0-system-nspr-prtime.patch | 80 +
qtwebengine-opensource-src-5.9.0-system-re2.patch | 24 +
...e-opensource-src-5.9.0-webrtc-neon-detect.patch | 14 +
sources | 2 +-
31 files changed, 4000 insertions(+), 6424 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 3a0102e..e2b0bc7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
/qtwebengine-opensource-src-5.7.1.tar.xz
/qtwebengine-opensource-src-5.8.0.tar.xz
+/qtwebengine-opensource-src-5.9.0.tar.xz
diff --git a/qt5-qtwebengine-freeworld.spec b/qt5-qtwebengine-freeworld.spec
index 82a305f..b4c5d38 100644
--- a/qt5-qtwebengine-freeworld.spec
+++ b/qt5-qtwebengine-freeworld.spec
@@ -5,12 +5,12 @@
# work around missing macro in the RPM Fusion build system (matches list in
macros.qt5-srpm)
%{!?qt5_qtwebengine_arches:%global qt5_qtwebengine_arches %{ix86} x86_64 %{arm} aarch64
mips mipsel mips64el}
-%if 0%{?fedora} > 23
-# need libvpx >= 1.5.0
+%if 0%{?fedora} > 24
+# need libvpx >= 1.6.0
%global use_system_libvpx 1
%endif
%if 0%{?fedora} > 23
-# need libwebp >= 0.5.0
+# need libwebp >= 0.5.1
%global use_system_libwebp 1
%endif
%if 0%{?use_system_libvpx} && 0%{?use_system_libwebp}
@@ -33,8 +33,8 @@
Summary: Qt5 - QtWebEngine components (freeworld version)
Name: qt5-qtwebengine-freeworld
-Version: 5.8.0
-Release: 4%{?dist}
+Version: 5.9.0
+Release: 1%{?dist}
%global major_minor %(echo %{version} | cut -d. -f-2)
%global major %(echo %{version} | cut -d. -f1)
@@ -46,7 +46,7 @@ License: (LGPLv2 with exceptions or GPLv3 with exceptions) and BSD and
LGPLv2+ a
URL:
http://www.qt.io
Source0:
http://download.qt.io/official_releases/qt/%{major_minor}/%{version}/subm...
# some tweaks to linux.pri (system libs, link libpci, run unbundling script)
-Patch0: qtwebengine-opensource-src-5.7.0-linux-pri.patch
+Patch0: qtwebengine-opensource-src-5.9.0-linux-pri.patch
# quick hack to avoid checking for the nonexistent icudtl.dat and silence the
# resulting warnings - not upstreamable as is because it removes the fallback
# mechanism for the ICU data directory (which is not used in our builds because
@@ -54,52 +54,47 @@ Patch0: qtwebengine-opensource-src-5.7.0-linux-pri.patch
Patch1: qtwebengine-opensource-src-5.6.0-no-icudtl-dat.patch
# fix extractCFlag to also look in QMAKE_CFLAGS_RELEASE, needed to detect the
# ARM flags with our %%qmake_qt5 macro, including for the next patch
-Patch2: qtwebengine-opensource-src-5.6.0-beta-fix-extractcflag.patch
+Patch2: qtwebengine-opensource-src-5.9.0-fix-extractcflag.patch
# disable NEON vector instructions on ARM where the NEON code FTBFS due to
# GCC bug
https://bugzilla.redhat.com/show_bug.cgi?id=1282495
-# otherwise, we use the arm-fpu-fix below instead (which this patch contains)
-Patch3: qtwebengine-opensource-src-5.7.1-no-neon.patch
+Patch3: qtwebengine-opensource-src-5.9.0-no-neon.patch
# use the system NSPR prtime (based on Debian patch)
# We already depend on NSPR, so it is useless to copy these functions here.
# Debian uses this just fine, and I don't see relevant modifications either.
-Patch4: qtwebengine-opensource-src-5.8.0-system-nspr-prtime.patch
+Patch4: qtwebengine-opensource-src-5.9.0-system-nspr-prtime.patch
# use the system ICU UTF functions
# We already depend on ICU, so it is useless to copy these functions here.
# I checked the history of that directory, and other than the renames I am
-# undoing, there were no modifications at all. Must be applied after Patch5.
-Patch5: qtwebengine-opensource-src-5.8.0-system-icu-utf.patch
+# undoing, there were no modifications at all. Must be applied after Patch4.
+Patch5: qtwebengine-opensource-src-5.9.0-system-icu-utf.patch
# do not require SSE2 on i686
# cumulative revert of upstream reviews 187423002, 308003004, 511773002 (parts
# relevant to QtWebEngine only), 516543004, 1152053004 and 1161853008, along
# with some custom fixes and improvements
# also build V8 shared and twice on i686 (once for x87, once for SSE2)
-# TODO: For 5.9, we will need the GN files updated (where not done yet), too.
-Patch6: qtwebengine-opensource-src-5.8.0-no-sse2.patch
-# fix ARM NEON handling in webrtc gyp files
-# Fix video_processing.gypi to only build NEON files when actually requested
-# (i.e., not if arm_neon=0 arm_neon_optional=0).
-Patch7: qtwebengine-opensource-src-5.7.0-webrtc-neon.patch
-# fix missing ARM -mfpu setting (see the comment in the no-neon patch above)
-Patch9: qtwebengine-opensource-src-5.7.1-arm-fpu-fix.patch
+Patch6: qtwebengine-opensource-src-5.9.0-no-sse2.patch
+# fix missing ARM -mfpu setting
+Patch9: qtwebengine-opensource-src-5.9.0-arm-fpu-fix.patch
# remove Android dependencies from openmax_dl ARM NEON detection (detect.c)
-Patch10: qtwebengine-opensource-src-5.7.1-openmax-dl-neon.patch
-# chromium-skia: build SkUtilsArm.cpp also on non-Android ARM
-Patch11: qtwebengine-opensource-src-5.7.1-skia-neon.patch
+Patch10: qtwebengine-opensource-src-5.9.0-openmax-dl-neon.patch
+# restore NEON runtime detection in Skia: revert upstream review 1952953004,
+# restore the non-Android Linux NEON runtime detection code lost in upstream
+# review 1890483002, also add VFPv4 runtime detection
+Patch11: qtwebengine-opensource-src-5.9.0-skia-neon.patch
# webrtc: enable the CPU feature detection for ARM Linux also for Chromium
-Patch12: qtwebengine-opensource-src-5.8.0-webrtc-neon-detect.patch
-# fix FTBFS in V8 with GCC 7 (by Ben Noordhuis, backported from Chromium RPM)
-Patch13: qtwebengine-opensource-src-5.8.0-v8-gcc7.patch
-# fix FTBFS in PDFium with GCC 7: backport upstream cleanup removing that code
-#
https://codereview.chromium.org/2154503002
-Patch14: qtwebengine-opensource-src-5.8.0-pdfium-gcc7.patch
-# fix FTBFS in the WTF part of Blink/WebKit with GCC 7
-Patch15: qtwebengine-opensource-src-5.8.0-wtf-gcc7.patch
+Patch12: qtwebengine-opensource-src-5.9.0-webrtc-neon-detect.patch
# FTBFS using qt < 5.8
Patch20: qtwebengine-opensource-src-5.8.0-qt57.patch
-# upstream fix for blank pages when a link opens in a new tab
-Patch100: qtwebengine-opensource-src-5.8.0-fix-open-in-new-tab.patch
-# upstream fix for non-functional dead keys in text fields
-Patch101: qtwebengine-opensource-src-5.8.0-fix-dead-keys.patch
+# Force verbose output from the GN bootstrap process
+Patch21: qtwebengine-opensource-src-5.9.0-gn-bootstrap-verbose.patch
+# Fix src/3rdparty/chromium/build/linux/unbundle/re2.gn
+Patch22: qtwebengine-opensource-src-5.9.0-system-re2.patch
+# Backport upstream patch to fix GN FTBFS on aarch64 (QTBUG-61128)
+#
https://codereview.qt-project.org/196178
+Patch100: qtwebengine-opensource-src-5.9.0-gn-aarch64.patch
+# Backport patch to fix FTBFS with GCC on aarch64 from upstream Chromium
+#
https://codereview.chromium.org/2545053002
+Patch101: qtwebengine-opensource-src-5.9.0-aarch64-gcc-toolchain.patch
%if 0%{?fedora} && 0%{?fedora} < 25
# work around missing qt5_qtwebengine_arches macro on F24
@@ -147,18 +142,14 @@ BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libudev)
%if 0%{?use_system_libwebp}
-BuildRequires: pkgconfig(libwebp) >= 0.5.0
+BuildRequires: pkgconfig(libwebp) >= 0.5.1
%endif
BuildRequires: pkgconfig(harfbuzz)
-BuildRequires: pkgconfig(jsoncpp)
-BuildRequires: pkgconfig(protobuf)
BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(opus)
BuildRequires: pkgconfig(libevent)
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(minizip)
-BuildRequires: pkgconfig(libxml-2.0)
-BuildRequires: pkgconfig(libxslt)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xi)
BuildRequires: pkgconfig(xcursor)
@@ -176,11 +167,10 @@ BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(libpci)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(nss)
-BuildRequires: pkgconfig(libsrtp)
BuildRequires: perl
BuildRequires: python
%if 0%{?use_system_libvpx}
-BuildRequires: pkgconfig(vpx) >= 1.5.0
+BuildRequires: pkgconfig(vpx) >= 1.6.0
%endif
# extra (non-upstream) functions needed, see
@@ -200,11 +190,11 @@ BuildRequires: pkgconfig(vpx) >= 1.5.0
# Of course, Chromium itself is bundled. It cannot be unbundled because it is
# not a library, but forked (modified) application code.
-# Some security fixes (up to version 55.0.2883.75) are backported, see:
-#
http://code.qt.io/cgit/qt/qtwebengine-chromium.git/log/?h=53-based
-# see dist/changes-5.8.0 for the version numbers (base, security fixes) and for
+# Some security fixes (up to version 58.0.3029.96) are backported, see:
+#
http://code.qt.io/cgit/qt/qtwebengine-chromium.git/log/?h=56-based
+# see dist/changes-5.9.0 for the version numbers (base, security fixes) and for
# a list of CVEs fixed by the added security backports
-Provides: bundled(chromium) = 53.0.2785.148
+Provides: bundled(chromium) = 56.0.2924.122
# Bundled in src/3rdparty/chromium/third_party:
# Check src/3rdparty/chromium/third_party/*/README.chromium for version numbers,
@@ -222,39 +212,44 @@ Provides: bundled(boringssl)
Provides: bundled(brotli)
%if !0%{?use_system_ffmpeg}
# see src/3rdparty/chromium/third_party/ffmpeg/Changelog for the version number
-Provides: bundled(ffmpeg) = 2.8
+Provides: bundled(ffmpeg) = 3.1
%endif
+Provides: bundled(hunspell) = 1.3.2
Provides: bundled(iccjpeg)
# bundled as "khronos", headers only
Provides: bundled(khronos_headers)
# bundled as "leveldatabase"
Provides: bundled(leveldb)
Provides: bundled(libjingle) = 12750
+# see src/3rdparty/chromium/third_party/libsrtp/CHANGES for the version number
+Provides: bundled(libsrtp) = 1.5.2
%if !0%{?use_system_libvpx}
-# bundled as "libvpx_new"
-# the version in README.chromium is wrong, see
-# src/3rdparty/chromium/third_party/libvpx_new/source/libvpx/CHANGELOG for the
-# real version number
-Provides: bundled(libvpx) = 1.5.0
+Provides: bundled(libvpx) = 1.6.0
%endif
%if !0%{?use_system_libwebp}
-Provides: bundled(libwebp) = 0.5.0
+Provides: bundled(libwebp) = 0.5.1
%endif
+# see src/3rdparty/chromium/third_party/libxml/linux/include/libxml/xmlversion.h
+Provides: bundled(libxml2) = 2.9.4
+# see src/3rdparty/chromium/third_party/libxslt/libxslt/xsltconfig.h for version
+Provides: bundled(libxslt) = 1.1.29
Provides: bundled(libXNVCtrl) = 302.17
-Provides: bundled(libyuv) = 1579
+Provides: bundled(libyuv) = 1634
Provides: bundled(modp_b64)
Provides: bundled(mojo)
# headers only
Provides: bundled(npapi)
-Provides: bundled(openh264) = 1.4.0
+Provides: bundled(openh264) = 1.6.0
Provides: bundled(openmax_dl) = 1.0.2
Provides: bundled(ots)
+# see src/3rdparty/chromium/third_party/protobuf/CHANGES.txt for the version
+Provides: bundled(protobuf) = 3.0.0-0.1.beta3
Provides: bundled(qcms) = 4
Provides: bundled(sfntly)
Provides: bundled(skia)
# bundled as "smhasher"
Provides: bundled(SMHasher) = 0-0.1.svn147
-Provides: bundled(sqlite) = 3.8.7.4
+Provides: bundled(sqlite) = 3.10.2
Provides: bundled(usrsctp)
Provides: bundled(webrtc) = 90
%ifarch %{ix86} x86_64
@@ -289,9 +284,10 @@ Provides: bundled(nsURLParsers)
# Bundled outside of third_party, apparently not considered as such by Chromium:
# see src/3rdparty/chromium/v8/include/v8_version.h for the version number
-Provides: bundled(v8) = 5.3.332.47
-# bundled by v8 (src/3rdparty/chromium/v8/src/third_party/fdlibm)
-# see src/3rdparty/chromium/v8/src/third_party/fdlibm/README.v8 for the version
+Provides: bundled(v8) = 5.6.326.55
+# bundled by v8 (src/3rdparty/chromium/v8/src/base/ieee754.cc)
+# The version number is 5.3, the last version that upstream released, years ago:
+#
http://www.netlib.org/fdlibm/readme
Provides: bundled(fdlibm) = 5.3
%{?_qt5_version:Requires: qt5-qtbase%{?_isa} = %{_qt5_version}}
@@ -310,24 +306,21 @@ This version is compiled with support for patent-encumbered codecs
enabled.
%patch0 -p1 -b .linux-pri
%patch1 -p1 -b .no-icudtl-dat
%patch2 -p1 -b .fix-extractcflag
-%if 0%{?arm_neon}
-%patch9 -p1 -b .arm-fpu-fix
-%else
+%if !0%{?arm_neon}
%patch3 -p1 -b .no-neon
%endif
%patch4 -p1 -b .system-nspr-prtime
%patch5 -p1 -b .system-icu-utf
%patch6 -p1 -b .no-sse2
-%patch7 -p1 -b .webrtc-neon
+%patch9 -p1 -b .arm-fpu-fix
%patch10 -p1 -b .openmax-dl-neon
%patch11 -p1 -b .skia-neon
%patch12 -p1 -b .webrtc-neon-detect
-%patch13 -p1 -b .v8-gcc7
-%patch14 -p1 -b .pdfium-gcc7
-%patch15 -p1 -b .wtf-gcc7
%patch20 -p1 -b .qt57
-%patch100 -p1 -b .fix-open-in-new-tab
-%patch101 -p1 -b .fix-dead-keys
+%patch21 -p1 -b .gn-bootstrap-verbose
+%patch22 -p1 -b .system-re2
+%patch100 -p1 -b .gn-aarch64
+%patch101 -p1 -b .aarch64-gcc-toolchain
# fix // in #include in content/renderer/gpu to avoid debugedit failure
sed -i -e 's!gpu//!gpu/!g' \
src/3rdparty/chromium/content/renderer/gpu/compositor_forwarding_message_filter.cc
@@ -335,14 +328,22 @@ sed -i -e 's!gpu//!gpu/!g' \
sed -i -e 's!\./!!g' \
src/3rdparty/chromium/third_party/angle/src/compiler/preprocessor/Tokenizer.cpp \
src/3rdparty/chromium/third_party/angle/src/compiler/translator/glslang_lex.cpp
+# delete all "toolprefix = " lines from build/toolchain/linux/BUILD.gn, as we
+# never cross-compile in native Fedora RPMs, fixes ARM and aarch64 FTBFS
+sed -i -e '/toolprefix = /d' -e 's/\${toolprefix}//g' \
+ src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
#
http://bugzilla.redhat.com/1337585
# can't just delete, but we'll overwrite with system headers to be on the safe
side
cp -bv /usr/include/re2/*.h src/3rdparty/chromium/third_party/re2/src/re2/
-%ifnarch x86_64
-# most arches run out of memory with full debuginfo, so use -g1 on non-x86_64
-sed -i -e 's/=-g$/=-g1/g' src/core/gyp_run.pro
+%if 0
+#ifarch x86_64
+# enable this to force -g2 on x86_64 (most arches run out of memory with -g2)
+# DISABLED BECAUSE OF:
+# /usr/lib/rpm/find-debuginfo.sh: line 188: 3619 Segmentation fault
+# (core dumped) eu-strip --remove-comment $r $g -f "$1" "$2"
+sed -i -e 's/symbol_level=1/symbol_level=2/g' src/core/config/common.pri
%endif
# generate qtwebengine-3rdparty.qdoc, it is missing from the tarball
@@ -360,28 +361,12 @@ cp -p src/3rdparty/chromium/LICENSE LICENSE.Chromium
export STRIP=strip
export NINJAFLAGS="-v %{_smp_mflags}"
export NINJA_PATH=%{_bindir}/ninja-build
-export CFLAGS="%{optflags}"
-%ifnarch x86_64
-# most arches run out of memory with full debuginfo, so use -g1 on non-x86_64
-export CFLAGS=`echo "$CFLAGS" | sed -e 's/ -g / -g1 /g'`
-%endif
-export CXXFLAGS="%{optflags} -fno-delete-null-pointer-checks"
-%ifnarch x86_64
-# most arches run out of memory with full debuginfo, so use -g1 on non-x86_64
-export CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ -g / -g1 /g'`
-%endif
mkdir %{_target_platform}
pushd %{_target_platform}
%{qmake_qt5} CONFIG+="webcore_debug v8base_debug force_debug_info" \
- WEBENGINE_CONFIG+="use_system_icu use_system_protobuf %{?system_ffmpeg_flag}
use_spellchecker use_proprietary_codecs" ..
-
-# if we keep these set here, gyp picks up duplicate flags
-unset CFLAGS
-export CFLAGS
-unset CXXFLAGS
-export CXXFLAGS
+ WEBENGINE_CONFIG+="use_system_icu %{?system_ffmpeg_flag} use_spellchecker
use_proprietary_codecs" ..
make %{?_smp_mflags}
@@ -410,6 +395,28 @@ echo "%{_libdir}/%{name}" \
%config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
%changelog
+* Tue Jun 13 2017 Kevin Kofler <Kevin(a)tigcc.ticalc.org> - 5.9.0-1
+- Update to 5.9.0
+- Update version numbers of bundled stuff
+- Use bundled libsrtp and protobuf, Chromium dropped unbundling support for them
+- Use bundled libxml2 and libxslt, QtWebEngine 5.9 requires a libxml2 built with
+ ICU due to
https://bugreports.qt.io/browse/QTBUG-59094, Fedora libxml2 is not
+- Add missing Provides: bundled(hunspell) for the spellchecking added in 5.8
+- Rebase linux-pri, no-neon, system-icu-utf, no-sse2, arm-fpu-fix,
+ openmax-dl-neon and webrtc-neon-detect patches (port to GN)
+- Sync system-nspr-prtime patch with Debian (they ported it to GN)
+- Rebase fix-extractcflag patch
+- Restore NEON runtime detection in Skia, drop old skia-neon patch (rewritten)
+- Drop webrtc-neon, v8-gcc7, pdfium-gcc7, wtf-gcc7, fix-open-in-new-tab and
+ fix-dead-keys patches, fixed upstream
+- Update system libvpx/libwebp version requirements (libvpx now F25+ only)
+- Drop the flag hacks (-g1 -fno-delete-null-pointer-checks), fixed upstream
+- Force verbose output from the GN bootstrap process
+- Backport upstream patch to fix GN FTBFS on aarch64 (QTBUG-61128)
+- Backport patch to fix FTBFS with GCC on aarch64 from upstream Chromium
+- Fix src/3rdparty/chromium/build/linux/unbundle/re2.gn
+- Delete all "toolprefix = " lines from build/toolchain/linux/BUILD.gn
+
* Sun Apr 30 2017 Leigh Scott <leigh123linux(a)googlemail.com> - 5.8.0-4
- Rebuild for ffmpeg update
diff --git a/qtwebengine-opensource-src-5.9.0-aarch64-gcc-toolchain.patch
b/qtwebengine-opensource-src-5.9.0-aarch64-gcc-toolchain.patch
new file mode 100644
index 0000000..76228a0
--- /dev/null
+++ b/qtwebengine-opensource-src-5.9.0-aarch64-gcc-toolchain.patch
@@ -0,0 +1,30 @@
+Index: src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
+diff --git a/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
b/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
+index 548722d3938017ac936b9088b7a686c2afbbb5fe..86cd7dabc6e86d22a266817dfbb3bf0c719f7992
100644
+--- a/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
++++ b/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
+@@ -21,6 +21,24 @@ clang_toolchain("clang_arm64") {
+ }
+ }
+
++gcc_toolchain("arm64") {
++ toolprefix = "aarch64-linux-gnu-"
++
++ cc = "${toolprefix}gcc"
++ cxx = "${toolprefix}g++"
++
++ ar = "${toolprefix}ar"
++ ld = cxx
++ readelf = "${toolprefix}readelf"
++ nm = "${toolprefix}nm"
++
++ toolchain_args = {
++ current_cpu = "arm64"
++ current_os = "linux"
++ is_clang = false
++ }
++}
++
+ gcc_toolchain("arm") {
+ toolprefix = "arm-linux-gnueabihf-"
+
diff --git a/qtwebengine-opensource-src-5.9.0-arm-fpu-fix.patch
b/qtwebengine-opensource-src-5.9.0-arm-fpu-fix.patch
new file mode 100644
index 0000000..ddf8abc
--- /dev/null
+++ b/qtwebengine-opensource-src-5.9.0-arm-fpu-fix.patch
@@ -0,0 +1,11 @@
+diff -ur qtwebengine-opensource-src-5.9.0/src/core/config/linux.pri
qtwebengine-opensource-src-5.9.0-arm-fpu-fix/src/core/config/linux.pri
+--- qtwebengine-opensource-src-5.9.0/src/core/config/linux.pri 2017-05-19
06:22:04.000000000 +0200
++++ qtwebengine-opensource-src-5.9.0-arm-fpu-fix/src/core/config/linux.pri 2017-06-10
02:32:09.984692943 +0200
+@@ -64,6 +64,7 @@
+ gn_args += arm_use_neon=true
+ } else {
+ MFPU = $$extractCFlag("-mfpu=.*")
++ !isEmpty(MFPU): gn_args += arm_fpu=\"$$MFPU\"
+ !isEmpty(MFPU):contains(MFPU, ".*neon.*") {
+ gn_args += arm_use_neon=true
+ } else {
diff --git a/qtwebengine-opensource-src-5.9.0-fix-extractcflag.patch
b/qtwebengine-opensource-src-5.9.0-fix-extractcflag.patch
new file mode 100644
index 0000000..4fcd592
--- /dev/null
+++ b/qtwebengine-opensource-src-5.9.0-fix-extractcflag.patch
@@ -0,0 +1,12 @@
+diff -ur qtwebengine-opensource-src-5.9.0/mkspecs/features/functions.prf
qtwebengine-opensource-src-5.9.0-fix-extractcflag/mkspecs/features/functions.prf
+--- qtwebengine-opensource-src-5.9.0/mkspecs/features/functions.prf 2017-05-19
06:22:04.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-fix-extractcflag/mkspecs/features/functions.prf 2017-06-08
00:36:16.303520106 +0200
+@@ -302,7 +302,7 @@
+ }
+
+ defineReplace(extractCFlag) {
+- CFLAGS = $$QMAKE_CC $$QMAKE_CFLAGS
++ CFLAGS = $$QMAKE_CC $$QMAKE_CFLAGS $$QMAKE_CFLAGS_RELEASE
+ OPTION = $$find(CFLAGS, $$1)
+ OPTION = $$split(OPTION, =)
+ return ($$member(OPTION, 1))
diff --git a/qtwebengine-opensource-src-5.9.0-gn-aarch64.patch
b/qtwebengine-opensource-src-5.9.0-gn-aarch64.patch
new file mode 100644
index 0000000..1e8f31f
--- /dev/null
+++ b/qtwebengine-opensource-src-5.9.0-gn-aarch64.patch
@@ -0,0 +1,43 @@
+From 801c957651fba94b5d7dde9cc490378a4dc3a987 Mon Sep 17 00:00:00 2001
+From: Allan Sandfeld Jensen <allan.jensen(a)qt.io>
+Date: Thu, 1 Jun 2017 11:40:02 +0200
+Subject: [PATCH] [Backport] GN: Add Arm64 Linux support
+
+Add Arm64 linux support be able to build GN binary for
+native arm64 builds.
+
+R=dpranke(a)chromium.org, brettw(a)chromium.org
+
+Review-Url:
https://codereview.chromium.org/2550673002
+
+Task-number: QTBUG-61128
+Change-Id: I3aa6b6ca7df374428a7f4a8b4db9f488a8926f6c
+Reviewed-by: Joerg Bornemann <joerg.bornemann(a)qt.io>
+---
+ chromium/tools/gn/args.cc | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/3rdparty/chromium/tools/gn/args.cc
b/src/3rdparty/chromium/tools/gn/args.cc
+index 7285d7a..54703e1 100644
+--- a/src/3rdparty/chromium/tools/gn/args.cc
++++ b/src/3rdparty/chromium/tools/gn/args.cc
+@@ -266,6 +266,7 @@ void Args::SetSystemVarsLocked(Scope* dest) const {
+ static const char kX86[] = "x86";
+ static const char kX64[] = "x64";
+ static const char kArm[] = "arm";
++ static const char kArm64[] = "arm64";
+ static const char kMips[] = "mipsel";
+ static const char kS390X[] = "s390x";
+ static const char kPPC64[] = "ppc64";
+@@ -280,6 +281,8 @@ void Args::SetSystemVarsLocked(Scope* dest) const {
+ arch = kX64;
+ else if (os_arch.substr(0, 3) == "arm")
+ arch = kArm;
++ else if (os_arch == "aarch64")
++ arch = kArm64;
+ else if (os_arch == "mips")
+ arch = kMips;
+ else if (os_arch == "s390x")
+--
+2.7.4
+
diff --git a/qtwebengine-opensource-src-5.9.0-gn-bootstrap-verbose.patch
b/qtwebengine-opensource-src-5.9.0-gn-bootstrap-verbose.patch
new file mode 100644
index 0000000..87b5beb
--- /dev/null
+++ b/qtwebengine-opensource-src-5.9.0-gn-bootstrap-verbose.patch
@@ -0,0 +1,12 @@
+diff -ur qtwebengine-opensource-src-5.9.0/src/buildtools/gn.pro
qtwebengine-opensource-src-5.9.0-gn-bootstrap-verbose/src/buildtools/gn.pro
+--- qtwebengine-opensource-src-5.9.0/src/buildtools/gn.pro 2017-05-19 06:22:04.000000000
+0200
++++
qtwebengine-opensource-src-5.9.0-gn-bootstrap-verbose/src/buildtools/gn.pro 2017-06-10
15:24:55.426814326 +0200
+@@ -20,7 +20,7 @@
+ src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../",
"$$QTWEBENGINE_ROOT")
+ gn_bootstrap =
$$system_path($$absolute_path(chromium/tools/gn/bootstrap/bootstrap.py,
$$src_3rd_party_dir))
+ gn_args = $$system_quote($$gn_args)
+- gn_configure = $$system_quote($$gn_bootstrap) --shadow
--gn-gen-args=$$gn_args $$ninja_path
++ gn_configure = $$system_quote($$gn_bootstrap) --verbose --shadow
--gn-gen-args=$$gn_args $$ninja_path
+ !system("cd $$system_quote($$system_path($$dirname(out))) &&
$$pythonPathForSystem() $$gn_configure") {
+ error("GN build error!")
+ }
diff --git a/qtwebengine-opensource-src-5.9.0-linux-pri.patch
b/qtwebengine-opensource-src-5.9.0-linux-pri.patch
new file mode 100644
index 0000000..c671f6b
--- /dev/null
+++ b/qtwebengine-opensource-src-5.9.0-linux-pri.patch
@@ -0,0 +1,26 @@
+diff -ur qtwebengine-opensource-src-5.9.0/src/core/config/linux.pri
qtwebengine-opensource-src-5.9.0-linux-pri/src/core/config/linux.pri
+--- qtwebengine-opensource-src-5.9.0/src/core/config/linux.pri 2017-05-19
06:22:04.000000000 +0200
++++ qtwebengine-opensource-src-5.9.0-linux-pri/src/core/config/linux.pri 2017-06-08
00:20:53.688419747 +0200
+@@ -148,3 +148,22 @@
+ use?(system_ffmpeg): gn_args += use_system_ffmpeg=true
+ #use?(system_protobuf): gn_args += use_system_protobuf=true
+ }
++
++# some more system packages, that are not checked for for some reason
++gn_args += use_system_re2=true
++
++# yasm is only used on x86, and passing use_system_yasm makes the build fail on
++# other architectures (e.g., ARM), so make it conditional on the architecture
++contains(QT_ARCH, "x86_64")|contains(QT_ARCH, "i386") {
++ gn_args += use_system_yasm=true
++}
++
++# link libpci instead of dlopening it, our Qt packaging depends on it anyway
++gn_args += linux_link_libpci=true
++
++# run the unbundling script Chromium provides
++CHROMIUM_SRC_DIR = "$$QTWEBENGINE_ROOT/$$getChromiumSrcDir()"
++R_G_F_PY = "$$CHROMIUM_SRC_DIR/build/linux/unbundle/replace_gn_files.py"
++R_G_F_PY_ARGS = "--system-libraries re2 yasm"
++log("Running python $$R_G_F_PY $$R_G_F_PY_ARGS$${EOL}")
++!system("python $$R_G_F_PY $$R_G_F_PY_ARGS"): error("-- unbundling
failed")
diff --git a/qtwebengine-opensource-src-5.9.0-no-neon.patch
b/qtwebengine-opensource-src-5.9.0-no-neon.patch
new file mode 100644
index 0000000..0fc7395
--- /dev/null
+++ b/qtwebengine-opensource-src-5.9.0-no-neon.patch
@@ -0,0 +1,14 @@
+diff -ur qtwebengine-opensource-src-5.9.0/src/core/config/linux.pri
qtwebengine-opensource-src-5.9.0-no-neon/src/core/config/linux.pri
+--- qtwebengine-opensource-src-5.9.0/src/core/config/linux.pri 2017-05-19
06:22:04.000000000 +0200
++++ qtwebengine-opensource-src-5.9.0-no-neon/src/core/config/linux.pri 2017-06-08
00:55:22.257781563 +0200
+@@ -70,7 +70,9 @@
+ gn_args += arm_use_neon=false
+ # If the toolchain does not explicitly specify to use NEON instructions
+ # we use arm_neon_optional for ARMv7
+- equals(MARMV, 7): gn_args += arm_optionally_use_neon=true
++ # Disable NEON entirely for now, if set in the specfile, e.g., to
++ # work around some build failure.
++ # equals(MARMV, 7): gn_args += arm_optionally_use_neon=true
+ }
+ }
+
diff --git a/qtwebengine-opensource-src-5.9.0-no-sse2.patch
b/qtwebengine-opensource-src-5.9.0-no-sse2.patch
new file mode 100644
index 0000000..4dcbc92
--- /dev/null
+++ b/qtwebengine-opensource-src-5.9.0-no-sse2.patch
@@ -0,0 +1,3108 @@
+diff -Nur
qtwebengine-opensource-src-5.9.0/examples/webengine/customdialogs/customdialogs.pro
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webengine/customdialogs/customdialogs.pro
+---
qtwebengine-opensource-src-5.9.0/examples/webengine/customdialogs/customdialogs.pro 2017-05-19
06:22:04.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webengine/customdialogs/customdialogs.pro 2017-06-12
20:48:36.743167401 +0200
+@@ -1,5 +1,7 @@
+ QT += webengine
+
++QMAKE_LFLAGS += -Wl,-rpath-link,$$OUT_PWD/../../../src/core/Release
++
+ HEADERS += \
+ server.h
+
+diff -Nur qtwebengine-opensource-src-5.9.0/examples/webengine/minimal/minimal.pro
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webengine/minimal/minimal.pro
+--- qtwebengine-opensource-src-5.9.0/examples/webengine/minimal/minimal.pro 2017-05-19
06:22:04.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webengine/minimal/minimal.pro 2017-06-12
20:48:02.646665156 +0200
+@@ -2,6 +2,8 @@
+
+ QT += webengine
+
++QMAKE_LFLAGS += -Wl,-rpath-link,$$OUT_PWD/../../../src/core/Release
++
+ SOURCES += main.cpp
+
+ RESOURCES += qml.qrc
+diff -Nur
qtwebengine-opensource-src-5.9.0/examples/webengine/quicknanobrowser/quicknanobrowser.pro
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webengine/quicknanobrowser/quicknanobrowser.pro
+---
qtwebengine-opensource-src-5.9.0/examples/webengine/quicknanobrowser/quicknanobrowser.pro 2017-05-19
06:22:04.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webengine/quicknanobrowser/quicknanobrowser.pro 2017-06-12
20:48:24.553340621 +0200
+@@ -20,5 +20,7 @@
+ QT += widgets # QApplication is required to get native styling with QtQuickControls
+ }
+
++QMAKE_LFLAGS += -Wl,-rpath-link,$$OUT_PWD/../../../src/core/Release
++
+ target.path = $$[QT_INSTALL_EXAMPLES]/webengine/quicknanobrowser
+ INSTALLS += target
+diff -Nur
qtwebengine-opensource-src-5.9.0/examples/webengine/recipebrowser/recipebrowser.pro
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webengine/recipebrowser/recipebrowser.pro
+---
qtwebengine-opensource-src-5.9.0/examples/webengine/recipebrowser/recipebrowser.pro 2017-05-19
06:22:04.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webengine/recipebrowser/recipebrowser.pro 2017-06-12
20:48:31.672239461 +0200
+@@ -2,6 +2,8 @@
+
+ QT += quick qml quickcontrols2 webengine
+
++QMAKE_LFLAGS += -Wl,-rpath-link,$$OUT_PWD/../../../src/core/Release
++
+ cross_compile {
+ posix|qnx|linux: DEFINES += QTWEBENGINE_RECIPE_BROWSER_EMBEDDED
+ }
+diff -Nur
qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/contentmanipulation/contentmanipulation.pro
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/contentmanipulation/contentmanipulation.pro
+---
qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/contentmanipulation/contentmanipulation.pro 2017-05-19
06:22:04.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/contentmanipulation/contentmanipulation.pro 2017-06-12
20:47:51.870824827 +0200
+@@ -1,5 +1,7 @@
+ QT += webenginewidgets
+
++QMAKE_LFLAGS += -Wl,-rpath-link,$$OUT_PWD/../../../src/core/Release
++
+ HEADERS = mainwindow.h
+ SOURCES = main.cpp \
+ mainwindow.cpp
+diff -Nur
qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/cookiebrowser/cookiebrowser.pro
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/cookiebrowser/cookiebrowser.pro
+---
qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/cookiebrowser/cookiebrowser.pro 2017-05-19
06:22:04.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/cookiebrowser/cookiebrowser.pro 2017-06-12
20:47:00.603584486 +0200
+@@ -3,6 +3,8 @@
+ TEMPLATE = app
+ CONFIG += c++11
+
++QMAKE_LFLAGS += -Wl,-rpath-link,$$OUT_PWD/../../../src/core/Release
++
+ SOURCES += \
+ main.cpp\
+ mainwindow.cpp
+diff -Nur
qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/demobrowser/demobrowser.pro
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/demobrowser/demobrowser.pro
+---
qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/demobrowser/demobrowser.pro 2017-05-19
06:22:04.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/demobrowser/demobrowser.pro 2017-06-12
20:47:26.036207636 +0200
+@@ -3,6 +3,8 @@
+ QT += webenginewidgets network widgets printsupport
+ CONFIG += c++11
+
++QMAKE_LFLAGS += -Wl,-rpath-link,$$OUT_PWD/../../../src/core/Release
++
+ qtHaveModule(uitools):!embedded: QT += uitools
+ else: DEFINES += QT_NO_UITOOLS
+
+diff -Nur
qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/markdowneditor/markdowneditor.pro
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/markdowneditor/markdowneditor.pro
+---
qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/markdowneditor/markdowneditor.pro 2017-05-19
06:22:04.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/markdowneditor/markdowneditor.pro 2017-06-12
20:47:36.026059609 +0200
+@@ -3,6 +3,8 @@
+ QT += webenginewidgets webchannel
+ CONFIG += c++11
+
++QMAKE_LFLAGS += -Wl,-rpath-link,$$OUT_PWD/../../../src/core/Release
++
+ HEADERS += \
+ mainwindow.h \
+ previewpage.h \
+diff -Nur qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/minimal/minimal.pro
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/minimal/minimal.pro
+---
qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/minimal/minimal.pro 2017-05-19
06:22:04.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/minimal/minimal.pro 2017-06-12
20:46:13.714279273 +0200
+@@ -2,6 +2,8 @@
+
+ QT += webenginewidgets
+
++QMAKE_LFLAGS += -Wl,-rpath-link,$$OUT_PWD/../../../src/core/Release
++
+ SOURCES += main.cpp
+
+ target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/minimal
+diff -Nur
qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/simplebrowser/simplebrowser.pro
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/simplebrowser/simplebrowser.pro
+---
qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/simplebrowser/simplebrowser.pro 2017-05-19
06:22:04.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/simplebrowser/simplebrowser.pro 2017-06-12
20:47:31.059133208 +0200
+@@ -3,6 +3,8 @@
+ QT += webenginewidgets
+ CONFIG += c++11
+
++QMAKE_LFLAGS += -Wl,-rpath-link,$$OUT_PWD/../../../src/core/Release
++
+ HEADERS += \
+ browser.h \
+ browserwindow.h \
+diff -Nur
qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/spellchecker/spellchecker.pro
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/spellchecker/spellchecker.pro
+---
qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/spellchecker/spellchecker.pro 2017-05-19
06:22:04.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/spellchecker/spellchecker.pro 2017-06-12
20:47:46.165909361 +0200
+@@ -7,6 +7,8 @@
+ error("Spellcheck example can not be built when using native OS
dictionaries.")
+ }
+
++QMAKE_LFLAGS += -Wl,-rpath-link,$$OUT_PWD/../../../src/core/Release
++
+ HEADERS += \
+ webview.h
+
+diff -Nur
qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/videoplayer/videoplayer.pro
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/videoplayer/videoplayer.pro
+---
qtwebengine-opensource-src-5.9.0/examples/webenginewidgets/videoplayer/videoplayer.pro 2017-05-19
06:22:04.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/examples/webenginewidgets/videoplayer/videoplayer.pro 2017-06-12
20:47:20.160294702 +0200
+@@ -2,6 +2,8 @@
+
+ QT += webenginewidgets
+
++QMAKE_LFLAGS += -Wl,-rpath-link,$$OUT_PWD/../../../src/core/Release
++
+ HEADERS += \
+ mainwindow.h \
+ fullscreenwindow.h \
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/build/config/compiler/BUILD.gn
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/build/config/compiler/BUILD.gn
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/build/config/compiler/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/build/config/compiler/BUILD.gn 2017-06-08
23:09:28.104582812 +0200
+@@ -533,13 +533,6 @@
+ } else if (current_cpu == "x86") {
+ cflags += [ "-m32" ]
+ ldflags += [ "-m32" ]
+- if (!is_nacl) {
+- cflags += [
+- "-msse2",
+- "-mfpmath=sse",
+- "-mmmx",
+- ]
+- }
+ } else if (current_cpu == "arm") {
+ if (is_clang && !is_android && !is_nacl) {
+ cflags += [ "--target=arm-linux-gnueabihf" ]
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/build/config/v8_target_cpu.gni
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/build/config/v8_target_cpu.gni
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/build/config/v8_target_cpu.gni 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/build/config/v8_target_cpu.gni 2017-06-10
01:42:15.216049690 +0200
+@@ -59,3 +59,11 @@
+ # It should never be explicitly set by the user.
+ v8_current_cpu = v8_target_cpu
+ }
++
++if (v8_current_cpu == "x86") {
++ # If we are not building for the x86_sse2 toolchain, we actually want to build
++ # the "x87" backend instead.
++ if (current_toolchain != "//build/toolchain/linux:x86_sse2") {
++ v8_current_cpu = "x87"
++ }
++}
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/build/toolchain/gcc_toolchain.gni
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/build/toolchain/gcc_toolchain.gni
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/build/toolchain/gcc_toolchain.gni 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/build/toolchain/gcc_toolchain.gni 2017-06-10
16:24:14.175128763 +0200
+@@ -213,6 +213,10 @@
+ extra_ldflags = ""
+ }
+
++ if (defined(invoker.shlib_subdir)) {
++ shlib_subdir = invoker.shlib_subdir
++ }
++
+ # These library switches can apply to all tools below.
+ lib_switch = "-l"
+ lib_dir_switch = "-L"
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn 2017-06-10
02:09:47.874494730 +0200
+@@ -78,6 +78,26 @@
+ }
+ }
+
++gcc_toolchain("x86_sse2") {
++ cc = "gcc"
++ cxx = "g++"
++
++ readelf = "readelf"
++ nm = "nm"
++ ar = "ar"
++ ld = cxx
++
++ extra_cflags = "-msse2 -mfpmath=sse"
++ extra_cxxflags = "-msse2 -mfpmath=sse"
++ shlib_subdir = "lib/sse2"
++
++ toolchain_args = {
++ current_cpu = "x86"
++ current_os = "linux"
++ is_clang = false
++ }
++}
++
+ clang_toolchain("clang_x64") {
+ toolchain_args = {
+ current_cpu = "x64"
+diff -Nur qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/cc/BUILD.gn
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/cc/BUILD.gn
+--- qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/cc/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++ qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/cc/BUILD.gn 2017-06-08
23:12:50.719511297 +0200
+@@ -567,13 +567,6 @@
+ "trees/tree_synchronizer.h",
+ ]
+
+- if (current_cpu == "x86" || current_cpu == "x64") {
+- sources += [
+- "raster/texture_compressor_etc1_sse.cc",
+- "raster/texture_compressor_etc1_sse.h",
+- ]
+- }
+-
+ configs += [ "//build/config:precompiled_headers" ]
+
+ public_deps = [
+@@ -583,6 +576,7 @@
+ deps = [
+ "//base",
+ "//base/third_party/dynamic_annotations",
++ "//cc:cc_opts",
+ "//cc/proto",
+ "//cc/surfaces:surface_id",
+ "//gpu",
+@@ -612,6 +606,36 @@
+ }
+ }
+
++source_set("cc_opts") {
++ public_deps = [
++ "//cc:cc_opts_sse",
++ ]
++}
++
++source_set("cc_opts_sse") {
++ if (current_cpu == "x86" || current_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" ]
++ }
++}
++
+ static_library("test_support") {
+ testonly = true
+ sources = [
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/content/renderer/BUILD.gn
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/content/renderer/BUILD.gn
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/content/renderer/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/content/renderer/BUILD.gn 2017-06-12
14:19:26.095936011 +0200
+@@ -468,6 +468,13 @@
+ "//ui/surface",
+ "//v8",
+ ]
++
++ if (current_cpu == "x86") {
++ deps += [
++ "//v8(//build/toolchain/linux:x86_sse2)",
++ ]
++ }
++
+ allow_circular_includes_from = []
+
+ if (use_aura && !use_qt) {
+diff -Nur qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/BUILD.gn
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/BUILD.gn
+--- qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/BUILD.gn 2017-06-08
22:49:57.484256877 +0200
+@@ -336,13 +336,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" ]
+ }
+
+ if (is_linux || is_win) {
+@@ -539,10 +539,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.9.0/src/3rdparty/chromium/media/base/media.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/media.cc
+--- qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/media.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/media.cc 2017-06-08
22:49:57.484256877 +0200
+@@ -10,6 +10,8 @@
+ #include "base/metrics/field_trial.h"
+ #include "base/trace_event/trace_event.h"
+ #include "media/base/media_switches.h"
++#include "media/base/sinc_resampler.h"
++#include "media/base/vector_math.h"
+ #include "media/base/yuv_convert.h"
+
+ #if defined(OS_ANDROID)
+@@ -40,6 +42,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.9.0/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb.h
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb.h
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb.h 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb.h 2017-06-08
22:49:57.643254478 +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.9.0/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_mmx.asm
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_mmx.asm
+---
qtwebengine-opensource-src-5.9.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.9.0-no-sse2/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_mmx.asm 2017-06-08
22:49:57.698253649 +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.9.0/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_x86.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_x86.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_x86.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_x86.cc 2017-06-08
22:49:57.699253634 +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.9.0/src/3rdparty/chromium/media/base/simd/filter_yuv.h
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/simd/filter_yuv.h
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/simd/filter_yuv.h 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/simd/filter_yuv.h 2017-06-08
22:49:57.699253634 +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.9.0/src/3rdparty/chromium/media/base/simd/filter_yuv_mmx.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/simd/filter_yuv_mmx.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/simd/filter_yuv_mmx.cc 1970-01-01
01:00:00.000000000 +0100
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/simd/filter_yuv_mmx.cc 2017-06-08
22:49:57.699253634 +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 <intrin.h>
++#else
++#include <mmintrin.h>
++#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<uintptr_t>(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<const __m64*>(src0 + pixel);
++ const __m64* src1_64 = reinterpret_cast<const __m64*>(src1 + pixel);
++ __m64* dest64 = reinterpret_cast<__m64*>(dest + pixel);
++ __m64* end64 = reinterpret_cast<__m64*>(
++ reinterpret_cast<uintptr_t>(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.9.0/src/3rdparty/chromium/media/base/simd/sinc_resampler_sse.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/simd/sinc_resampler_sse.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/simd/sinc_resampler_sse.cc 1970-01-01
01:00:00.000000000 +0100
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/simd/sinc_resampler_sse.cc 2017-06-08
22:49:57.699253634 +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 <xmmintrin.h>
++
++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<uintptr_t>(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<float>(1.0 - kernel_interpolation_factor)));
++ m_sums2 = _mm_mul_ps(m_sums2, _mm_set_ps1(
++ static_cast<float>(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.9.0/src/3rdparty/chromium/media/base/simd/vector_math_sse.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/simd/vector_math_sse.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/simd/vector_math_sse.cc 1970-01-01
01:00:00.000000000 +0100
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/simd/vector_math_sse.cc 2017-06-08
22:49:57.700253619 +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 <algorithm>
++
++#include <xmmintrin.h> // 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<float, float> 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<float, float> 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.9.0/src/3rdparty/chromium/media/base/sinc_resampler.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/sinc_resampler.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler.cc 2017-06-08
22:49:57.700253619 +0200
+@@ -81,17 +81,12 @@
+ #include <cmath>
+ #include <limits>
+
++#include "base/cpu.h"
+ #include "base/logging.h"
+ #include "build/build_config.h"
+
+-#if defined(ARCH_CPU_X86_FAMILY)
+-#include <xmmintrin.h>
+-#define CONVOLVE_FUNC Convolve_SSE
+-#elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON)
++#if defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON)
+ #include <arm_neon.h>
+-#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)
+@@ -328,46 +354,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<uintptr_t>(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<float>(1.0 - kernel_interpolation_factor)));
+- m_sums2 = _mm_mul_ps(m_sums2, _mm_set_ps1(
+- static_cast<float>(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.9.0/src/3rdparty/chromium/media/base/sinc_resampler.h
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler.h
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/sinc_resampler.h 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler.h 2017-06-08
22:49:57.700253619 +0200
+@@ -36,6 +36,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.9.0/src/3rdparty/chromium/media/base/sinc_resampler_perftest.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler_perftest.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/sinc_resampler_perftest.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler_perftest.cc 2017-06-08
22:49:57.701253604 +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.9.0/src/3rdparty/chromium/media/base/sinc_resampler_unittest.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler_unittest.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/sinc_resampler_unittest.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/sinc_resampler_unittest.cc 2017-06-08
22:49:57.701253604 +0200
+@@ -10,6 +10,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"
+@@ -166,6 +167,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.9.0/src/3rdparty/chromium/media/base/vector_math.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/vector_math.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/vector_math.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/vector_math.cc 2017-06-08
22:49:57.701253604 +0200
+@@ -7,12 +7,17 @@
+
+ #include <algorithm>
+
++#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 <xmmintrin.h>
++#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<float, float> (*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 <arm_neon.h>
+ #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<uintptr_t>(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<float, float> 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<float, float> 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.9.0/src/3rdparty/chromium/media/base/vector_math.h
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/vector_math.h
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/vector_math.h 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/vector_math.h 2017-06-08
22:49:57.701253604 +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.9.0/src/3rdparty/chromium/media/base/vector_math_perftest.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/vector_math_perftest.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/vector_math_perftest.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/vector_math_perftest.cc 2017-06-08
22:49:57.702253589 +0200
+@@ -5,6 +5,7 @@
+ #include <memory>
+
+ #include "base/macros.h"
++#include "base/cpu.h"
+ #include "base/memory/aligned_memory.h"
+ #include "base/time/time.h"
+ #include "build/build_config.h"
+@@ -82,15 +83,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.
+@@ -99,6 +96,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);
+@@ -112,12 +112,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);
+@@ -131,6 +143,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().
+@@ -139,6 +159,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);
+@@ -156,4 +179,6 @@
+ #endif
+ }
+
++#undef EWMAAndMaxPower_FUNC
++
+ } // namespace media
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/vector_math_testing.h
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/vector_math_testing.h
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/vector_math_testing.h 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/vector_math_testing.h 2017-06-08
22:49:57.702253589 +0200
+@@ -19,7 +19,7 @@
+ MEDIA_EXPORT std::pair<float, float> 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.9.0/src/3rdparty/chromium/media/base/vector_math_unittest.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/vector_math_unittest.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/vector_math_unittest.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/vector_math_unittest.cc 2017-06-08
22:49:57.702253589 +0200
+@@ -9,6 +9,7 @@
+ #include <memory>
+
+ #include "base/macros.h"
++#include "base/cpu.h"
+ #include "base/memory/aligned_memory.h"
+ #include "base/strings/string_number_conversions.h"
+ #include "base/strings/stringize_macros.h"
+@@ -78,6 +79,7 @@
+
+ #if defined(ARCH_CPU_X86_FAMILY)
+ {
++ ASSERT_TRUE(base::CPU().has_sse());
+ SCOPED_TRACE("FMAC_SSE");
+ FillTestVectors(kInputFillValue, kOutputFillValue);
+ vector_math::FMAC_SSE(
+@@ -119,6 +121,7 @@
+
+ #if defined(ARCH_CPU_X86_FAMILY)
+ {
++ ASSERT_TRUE(base::CPU().has_sse());
+ SCOPED_TRACE("FMUL_SSE");
+ FillTestVectors(kInputFillValue, kOutputFillValue);
+ vector_math::FMUL_SSE(
+@@ -227,6 +230,7 @@
+
+ #if defined(ARCH_CPU_X86_FAMILY)
+ {
++ ASSERT_TRUE(base::CPU().has_sse());
+ SCOPED_TRACE("EWMAAndMaxPower_SSE");
+ const std::pair<float, float>& result =
vector_math::EWMAAndMaxPower_SSE(
+ initial_value_, data_.get(), data_len_, smoothing_factor_);
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/yuv_convert.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/yuv_convert.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/yuv_convert.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/yuv_convert.cc 2017-06-08
22:49:57.703253573 +0200
+@@ -32,7 +32,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 <intrin.h>
+ #else
+@@ -133,7 +133,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)();
+@@ -247,34 +247,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.9.0/src/3rdparty/chromium/media/base/yuv_convert_perftest.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/yuv_convert_perftest.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/yuv_convert_perftest.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/yuv_convert_perftest.cc 2017-06-08
22:49:57.703253573 +0200
+@@ -71,6 +71,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());
+
+@@ -161,9 +184,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());
+
+@@ -190,6 +236,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());
+
+@@ -215,7 +287,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.9.0/src/3rdparty/chromium/media/base/yuv_convert_unittest.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/yuv_convert_unittest.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/base/yuv_convert_unittest.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/base/yuv_convert_unittest.cc 2017-06-08
22:49:57.703253573 +0200
+@@ -643,6 +643,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<uint8[]> yuv_bytes(new uint8[kYUV12Size]);
++ scoped_ptr<uint8[]> rgb_bytes_reference(new uint8[kRGBSize]);
++ scoped_ptr<uint8[]> 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()) {
+@@ -674,9 +705,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<uint8[]> yuv_bytes(new uint8[kYUV12Size]);
++ scoped_ptr<uint8[]> rgb_bytes_reference(new uint8[kRGBSize]);
++ scoped_ptr<uint8[]> 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()) {
+@@ -711,6 +773,40 @@
+ kWidth * kBpp));
+ }
+
++TEST(YUVConvertTest, LinearScaleYUVToRGB32Row_MMX) {
++ base::CPU cpu;
++ if (!cpu.has_mmx()) {
++ LOG(WARNING) << "System not supported. Test skipped.";
++ return;
++ }
++
++ scoped_ptr<uint8[]> yuv_bytes(new uint8[kYUV12Size]);
++ scoped_ptr<uint8[]> rgb_bytes_reference(new uint8[kRGBSize]);
++ scoped_ptr<uint8[]> 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()) {
+@@ -744,7 +840,6 @@
+ rgb_bytes_converted.get(),
+ kWidth * kBpp));
+ }
+-#endif // defined(OS_WIN) && (ARCH_CPU_X86 || COMPONENT_BUILD)
+
+ TEST(YUVConvertTest, FilterYUVRows_C_OutOfBounds) {
+ std::unique_ptr<uint8_t[]> src(new uint8_t[16]);
+@@ -761,6 +856,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<uint8[]> src(new uint8[16]);
++ scoped_ptr<uint8[]> 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()) {
+@@ -782,6 +901,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<uint8[]> src(new uint8[kSize]);
++ scoped_ptr<uint8[]> dst_sample(new uint8[kSize]);
++ scoped_ptr<uint8[]> 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<uint8*>(
++ (reinterpret_cast<uintptr_t>(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.9.0/src/3rdparty/chromium/media/BUILD.gn
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/BUILD.gn
+--- qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/BUILD.gn 2017-06-08
22:49:57.704253558 +0200
+@@ -832,6 +832,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.9.0/src/3rdparty/chromium/media/filters/wsola_internals.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/filters/wsola_internals.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/media/filters/wsola_internals.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/media/filters/wsola_internals.cc 2017-06-12
12:30:26.903281839 +0200
+@@ -15,7 +15,7 @@
+ #include "base/logging.h"
+ #include "media/base/audio_bus.h"
+
+-#if defined(ARCH_CPU_X86_FAMILY)
++#if defined(ARCH_CPU_X86_FAMILY) && defined(__SSE2__)
+ #define USE_SIMD 1
+ #include <xmmintrin.h>
+ #elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON)
+diff -Nur qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/skia/BUILD.gn
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/skia/BUILD.gn
+--- qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/skia/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/skia/BUILD.gn 2017-06-11
12:15:56.825339699 +0200
+@@ -231,11 +231,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 += skia_core_sources
+@@ -500,6 +495,31 @@
+ }
+ }
+ if (current_cpu == "x86" || current_cpu == "x64") {
++ source_set("skia_opts_sse2") {
++ sources = skia_opts.sse2_sources +
++ [
++ # Chrome-specific.
++ "ext/convolver_SSE2.cc",
++ "ext/convolver_SSE2.h",
++ ]
++ sources -= [
++ # Detection code must not be built with -msse2
++ "//third_party/skia/src/opts/opts_check_x86.cpp",
++ ]
++ if (!is_win || is_clang) {
++ cflags = [ "-msse2" ]
++ }
++ if (is_win) {
++ defines = [ "SK_CPU_SSE_LEVEL=20" ]
++ }
++ visibility = [ ":skia_opts" ]
++ configs -= [ "//build/config/compiler:chromium_code" ]
++ configs += [
++ ":skia_config",
++ ":skia_library_config",
++ "//build/config/compiler:no_chromium_code",
++ ]
++ }
+ source_set("skia_opts_sse3") {
+ sources = skia_opts.ssse3_sources
+ if (!is_win || is_clang) {
+@@ -608,10 +628,13 @@
+ if (skia_build_no_opts) {
+ sources = skia_opts.none_sources
+ } else if (current_cpu == "x86" || current_cpu == "x64") {
+- sources = skia_opts.sse2_sources
++ sources = [
++ "//third_party/skia/src/opts/opts_check_x86.cpp",
++ ]
+ deps += [
+ ":skia_opts_avx",
+ ":skia_opts_hsw",
++ ":skia_opts_sse2",
+ ":skia_opts_sse3",
+ ":skia_opts_sse41",
+ ":skia_opts_sse42",
+@@ -644,6 +667,13 @@
+
+ if (mips_dsp_rev >= 1) {
+ sources = 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 = skia_opts.none_sources
+ }
+diff -Nur qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/skia/ext/convolver.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/skia/ext/convolver.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/skia/ext/convolver.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/skia/ext/convolver.cc 2017-06-08
22:50:00.933204857 +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.9.0/src/3rdparty/chromium/skia/ext/convolver.h
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/skia/ext/convolver.h
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/skia/ext/convolver.h 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/skia/ext/convolver.h 2017-06-08
22:50:00.998203877 +0200
+@@ -11,6 +11,7 @@
+ #include <vector>
+
+ #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.9.0/src/3rdparty/chromium/third_party/angle/BUILD.gn
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/angle/BUILD.gn
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/angle/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/angle/BUILD.gn 2017-06-11
03:28:05.966523743 +0200
+@@ -160,6 +160,26 @@
+ public_deps = [
+ ":angle_common",
+ ]
++
++ if (current_cpu == "x86") {
++ deps = [
++ ":angle_image_util_x86_sse2",
++ ]
++ }
++}
++
++source_set("angle_image_util_x86_sse2") {
++ configs -= angle_undefine_configs
++ configs += [ ":internal_config" ]
++
++ deps = [
++ ":angle_common",
++ ]
++
++ sources = [
++ "src/image_util/loadimage_SSE2.cpp",
++ ]
++ cflags = [ "-msse2", "-mfpmath=sse" ]
+ }
+
+ static_library("translator") {
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/angle/src/common/mathutil.h
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/angle/src/common/mathutil.h
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/angle/src/common/mathutil.h 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/angle/src/common/mathutil.h 2017-06-11
03:04:02.402397018 +0200
+@@ -142,9 +142,42 @@
+ }
+ }
+
+-inline bool supportsSSE2()
++#if defined(ANGLE_USE_SSE) && !defined(__x86_64__) && !defined(__SSE2__)
&& !defined(_MSC_VER)
++
++// From the base/cpu.cc in Chromium, to avoid depending on Chromium headers
++
++#if defined(__pic__) && defined(__i386__)
++
++static inline void __cpuid(int cpu_info[4], int info_type) {
++ __asm__ volatile (
++ "mov %%ebx, %%edi\n"
++ "cpuid\n"
++ "xchg %%edi, %%ebx\n"
++ : "=a"(cpu_info[0]), "=D"(cpu_info[1]),
"=c"(cpu_info[2]), "=d"(cpu_info[3])
++ : "a"(info_type)
++ );
++}
++
++#else
++
++static inline void __cpuid(int cpu_info[4], int info_type) {
++ __asm__ volatile (
++ "cpuid\n"
++ : "=a"(cpu_info[0]), "=b"(cpu_info[1]),
"=c"(cpu_info[2]), "=d"(cpu_info[3])
++ : "a"(info_type)
++ );
++}
++
++#endif
++
++#endif
++
++static inline bool supportsSSE2()
+ {
+ #if defined(ANGLE_USE_SSE)
++#if defined(__x86_64__) || defined(__SSE2__)
++ return true;
++#else
+ static bool checked = false;
+ static bool supports = false;
+
+@@ -153,7 +186,6 @@
+ return supports;
+ }
+
+-#if defined(ANGLE_PLATFORM_WINDOWS) && !defined(_M_ARM)
+ {
+ int info[4];
+ __cpuid(info, 0);
+@@ -165,9 +197,9 @@
+ supports = (info[3] >> 26) & 1;
+ }
+ }
+-#endif // defined(ANGLE_PLATFORM_WINDOWS) && !defined(_M_ARM)
+ checked = true;
+ return supports;
++#endif // defined(x86_64) || defined(__SSE2__)
+ #else // defined(ANGLE_USE_SSE)
+ return false;
+ #endif
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/angle/src/common/platform.h
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/angle/src/common/platform.h
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/angle/src/common/platform.h 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/angle/src/common/platform.h 2017-06-11
00:43:54.961552623 +0200
+@@ -81,7 +81,9 @@
+ #include <intrin.h>
+ #define ANGLE_USE_SSE
+ #elif defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))
++#if defined(__x86_64__) || defined(__SSE2__)
+ #include <x86intrin.h>
++#endif
+ #define ANGLE_USE_SSE
+ #endif
+
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/angle/src/image_util/loadimage.cpp
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/angle/src/image_util/loadimage.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/angle/src/image_util/loadimage.cpp 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/angle/src/image_util/loadimage.cpp 2017-06-11
00:58:53.706120530 +0200
+@@ -12,9 +12,17 @@
+ #include "common/platform.h"
+ #include "image_util/imageformats.h"
+
++#if defined(BUILD_ONLY_THE_SSE2_PARTS) && !defined(__SSE2__)
++#error SSE2 parts must be built with -msse2
++#endif
++
+ namespace angle
+ {
+
++#ifdef BUILD_ONLY_THE_SSE2_PARTS
++namespace SSE2 {
++#endif
++
+ void LoadA8ToRGBA8(size_t width,
+ size_t height,
+ size_t depth,
+@@ -28,6 +36,11 @@
+ #if defined(ANGLE_USE_SSE)
+ if (gl::supportsSSE2())
+ {
++#if !defined(__x86_64__) && !defined(__SSE2__)
++ angle::SSE2::LoadA8ToRGBA8(width, height, depth, input, inputRowPitch,
++ inputDepthPitch, output, outputRowPitch,
++ outputDepthPitch);
++#else
+ __m128i zeroWide = _mm_setzero_si128();
+
+ for (size_t z = 0; z < depth; z++)
+@@ -68,6 +81,7 @@
+ }
+ }
+ }
++#endif
+
+ return;
+ }
+@@ -89,6 +103,8 @@
+ }
+ }
+
++#ifndef BUILD_ONLY_THE_SSE2_PARTS
++
+ void LoadA8ToBGRA8(size_t width,
+ size_t height,
+ size_t depth,
+@@ -584,6 +600,8 @@
+ }
+ }
+
++#endif
++
+ void LoadRGBA8ToBGRA8(size_t width,
+ size_t height,
+ size_t depth,
+@@ -597,6 +615,11 @@
+ #if defined(ANGLE_USE_SSE)
+ if (gl::supportsSSE2())
+ {
++#if !defined(__x86_64__) && !defined(__SSE2__)
++ angle::SSE2::LoadRGBA8ToBGRA8(width, height, depth, input,
++ inputRowPitch, inputDepthPitch, output,
++ outputRowPitch, outputDepthPitch);
++#else
+ __m128i brMask = _mm_set1_epi32(0x00ff00ff);
+
+ for (size_t z = 0; z < depth; z++)
+@@ -641,6 +664,7 @@
+ }
+ }
+ }
++#endif
+
+ return;
+ }
+@@ -663,6 +687,8 @@
+ }
+ }
+
++#ifndef BUILD_ONLY_THE_SSE2_PARTS
++
+ void LoadRGBA8ToBGRA4(size_t width,
+ size_t height,
+ size_t depth,
+@@ -1320,4 +1346,10 @@
+ }
+ }
+
++#endif
++
++#ifdef BUILD_ONLY_THE_SSE2_PARTS
++} // namespace SSE2
++#endif
++
+ } // namespace angle
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/angle/src/image_util/loadimage.h
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/angle/src/image_util/loadimage.h
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/angle/src/image_util/loadimage.h 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/angle/src/image_util/loadimage.h 2017-06-11
00:52:18.251030762 +0200
+@@ -611,6 +611,32 @@
+ size_t outputRowPitch,
+ size_t outputDepthPitch);
+
++#if defined(__i386__)
++namespace SSE2 {
++
++void LoadA8ToRGBA8(size_t width,
++ size_t height,
++ size_t depth,
++ const uint8_t *input,
++ size_t inputRowPitch,
++ size_t inputDepthPitch,
++ uint8_t *output,
++ size_t outputRowPitch,
++ size_t outputDepthPitch);
++
++void LoadRGBA8ToBGRA8(size_t width,
++ size_t height,
++ size_t depth,
++ const uint8_t *input,
++ size_t inputRowPitch,
++ size_t inputDepthPitch,
++ uint8_t *output,
++ size_t outputRowPitch,
++ size_t outputDepthPitch);
++
++}
++#endif // defined(__i386__)
++
+ } // namespace angle
+
+ #include "loadimage.inl"
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/angle/src/image_util/loadimage_SSE2.cpp
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/angle/src/image_util/loadimage_SSE2.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/angle/src/image_util/loadimage_SSE2.cpp 1970-01-01
01:00:00.000000000 +0100
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/angle/src/image_util/loadimage_SSE2.cpp 2017-06-11
00:59:45.318349164 +0200
+@@ -0,0 +1,2 @@
++#define BUILD_ONLY_THE_SSE2_PARTS
++#include "loadimage.cpp"
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/qcms/BUILD.gn
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/qcms/BUILD.gn
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/qcms/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/qcms/BUILD.gn 2017-06-10
21:27:01.666198494 +0200
+@@ -30,8 +30,8 @@
+ ]
+
+ if (current_cpu == "x86" || current_cpu == "x64") {
+- defines = [ "SSE2_ENABLE" ]
+- sources += [ "src/transform-sse2.c" ]
++ defines = [ "SSE2_ENABLE" ] # runtime detection
++ deps = [ ":qcms_sse2" ]
+ }
+ }
+
+@@ -74,3 +74,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.9.0/src/3rdparty/chromium/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp 2017-06-08
23:59:48.897938821 +0200
+@@ -31,7 +31,7 @@
+ #include "wtf/MathExtras.h"
+ #include <algorithm>
+
+-#if CPU(X86) || CPU(X86_64)
++#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
+ #include <emmintrin.h>
+ #endif
+
+@@ -662,7 +662,7 @@
+ // the next event.
+ if (nextEventType == ParamEvent::LinearRampToValue) {
+ const float valueDelta = value2 - value1;
+-#if CPU(X86) || CPU(X86_64)
++#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
+ if (fillToFrame > writeIndex) {
+ // Minimize in-loop operations. Calculate starting value and increment.
+ // Next step: value += inc.
+@@ -841,7 +841,7 @@
+ for (; writeIndex < fillToFrame; ++writeIndex)
+ values[writeIndex] = target;
+ } else {
+-#if CPU(X86) || CPU(X86_64)
++#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
+ if (fillToFrame > writeIndex) {
+ // Resolve recursion by expanding constants to achieve a 4-step
+ // loop unrolling.
+@@ -959,7 +959,7 @@
+ // Oversampled curve data can be provided if sharp discontinuities are
+ // desired.
+ unsigned k = 0;
+-#if CPU(X86) || CPU(X86_64)
++#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
+ if (fillToFrame > writeIndex) {
+ const __m128 vCurveVirtualIndex = _mm_set_ps1(curveVirtualIndex);
+ const __m128 vCurvePointsPerFrame =
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp 2017-06-09
00:10:04.104673129 +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,21 +38,47 @@
+ #include "platform/audio/VectorMath.h"
+ #include "wtf/CPU.h"
+
+-#if (CPU(X86) || CPU(X86_64)) && !OS(MACOSX)
++#if ((CPU(X86) && defined(__SSE2__)) || CPU(X86_64)) && !OS(MACOSX)
+ #include <emmintrin.h>
+ #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), m_buffer(inputBlockSize * 2) {}
++ : m_inputBlockSize(inputBlockSize), 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;
+@@ -83,7 +112,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.
+@@ -397,7 +426,7 @@
+ }
+ destP[i++] = sum;
+ }
+-#if CPU(X86) || CPU(X86_64)
++#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
+ }
+ #endif
+ #endif // OS(MACOSX)
+@@ -406,8 +435,12 @@
+ memcpy(m_buffer.data(), inputP, sizeof(float) * framesToProcess);
+ }
+
++#ifndef BUILD_ONLY_THE_SSE2_PARTS
++
+ void DirectConvolver::reset() {
+ m_buffer.zero();
+ }
+
++#endif
++
+ } // namespace blink
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.h
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.h
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.h 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.h 2017-06-09
00:07:03.143398606 +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"
+
+ namespace blink {
+@@ -54,6 +55,14 @@
+ size_t m_inputBlockSize;
+
+ 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.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolverSSE2.cpp
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolverSSE2.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolverSSE2.cpp 1970-01-01
01:00:00.000000000 +0100
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolverSSE2.cpp 2017-06-08
22:50:07.966098783 +0200
+@@ -0,0 +1,2 @@
++#define BUILD_ONLY_THE_SSE2_PARTS
++#include "DirectConvolver.cpp"
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.cpp
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.cpp 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.cpp 2017-06-09
00:12:04.250863595 +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 <emmintrin.h>
+ #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):
+ //
+ // |----------------|-----------------------------------------|----------------|
+@@ -66,6 +73,8 @@
+
+ namespace blink {
+
++#ifndef BUILD_ONLY_THE_SSE2_PARTS
++
+ SincResampler::SincResampler(double scaleFactor,
+ unsigned kernelSize,
+ unsigned numberOfKernelOffsets)
+@@ -81,6 +90,10 @@
+ m_sourceFramesAvailable(0),
+ m_sourceProvider(nullptr),
+ m_isBufferPrimed(false) {
++#if CPU(X86)
++ base::CPU cpu;
++ m_haveSSE2 = cpu.has_sse2();
++#endif
+ initializeKernel();
+ }
+
+@@ -201,9 +214,23 @@
+ }
+ }
+
++#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);
+@@ -269,7 +296,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<uintptr_t>(inputP) & 0x0F) && n) {
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.h
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.h
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.h 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.h 2017-06-09
00:12:54.187111500 +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 {
+@@ -96,6 +97,13 @@
+
+ // 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.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResamplerSSE2.cpp
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResamplerSSE2.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResamplerSSE2.cpp 1970-01-01
01:00:00.000000000 +0100
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResamplerSSE2.cpp 2017-06-08
22:50:07.967098767 +0200
+@@ -0,0 +1,2 @@
++#define BUILD_ONLY_THE_SSE2_PARTS
++#include "SincResampler.cpp"
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.cpp
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.cpp 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.cpp 2017-06-09
00:26:26.048970670 +0200
+@@ -23,6 +23,9 @@
+ * 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"
+@@ -33,10 +36,14 @@
+ #include <Accelerate/Accelerate.h>
+ #endif
+
+-#if CPU(X86) || CPU(X86_64)
++#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
+ #include <emmintrin.h>
+ #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 <arm_neon.h>
+ #endif
+@@ -165,15 +172,30 @@
+ }
+ #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;
+
+@@ -269,9 +291,16 @@
+ 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;
+
+@@ -360,7 +389,7 @@
+ sourceP += sourceStride;
+ destP += destStride;
+ }
+-#if CPU(X86) || CPU(X86_64)
++#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
+ }
+ #endif
+ }
+@@ -372,9 +401,17 @@
+ 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.
+@@ -501,7 +538,7 @@
+ source2P += sourceStride2;
+ destP += destStride;
+ }
+-#if CPU(X86) || CPU(X86_64)
++#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
+ }
+ #endif
+ }
+@@ -513,9 +550,17 @@
+ 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.
+@@ -614,8 +659,15 @@
+ 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<uintptr_t>(real1P) & 0x0F) &&
+@@ -671,10 +723,17 @@
+ 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.
+@@ -740,10 +799,17 @@
+ 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.
+@@ -832,6 +898,8 @@
+ *maxP = max;
+ }
+
++#ifndef BUILD_ONLY_THE_SSE2_PARTS
++
+ void vclip(const float* sourceP,
+ int sourceStride,
+ const float* lowThresholdP,
+@@ -889,6 +957,12 @@
+ }
+ }
+
++#endif
++
++#ifdef BUILD_ONLY_THE_SSE2_PARTS
++} // namespace SSE2
++#endif
++
+ #endif // OS(MACOSX)
+
+ } // namespace VectorMath
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.h
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.h
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.h 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.h 2017-06-09
00:27:58.975582370 +0200
+@@ -27,6 +27,7 @@
+ #define VectorMath_h
+
+ #include "platform/PlatformExport.h"
++#include "wtf/CPU.h"
+ #include "wtf/build_config.h"
+ #include <cstddef>
+
+@@ -97,6 +98,62 @@
+ 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.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMathSSE2.cpp
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMathSSE2.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMathSSE2.cpp 1970-01-01
01:00:00.000000000 +0100
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMathSSE2.cpp 2017-06-08
22:50:07.969098737 +0200
+@@ -0,0 +1,2 @@
++#define BUILD_ONLY_THE_SSE2_PARTS
++#include "VectorMath.cpp"
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/BUILD.gn
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/BUILD.gn
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/BUILD.gn 2017-06-12
00:21:47.738315411 +0200
+@@ -1529,6 +1529,10 @@
+ deps += [ ":blink_x86_sse" ]
+ }
+
++ if (current_cpu == "x86") {
++ deps += [ ":blink_x86_sse2" ]
++ }
++
+ if (use_webaudio_ffmpeg) {
+ include_dirs += [ "//third_party/ffmpeg" ]
+ deps += [ "//third_party/ffmpeg" ]
+@@ -1914,6 +1918,26 @@
+ ]
+ }
+ }
++
++if (current_cpu == "x86") {
++ source_set("blink_x86_sse2") {
++ sources = [
++ "audio/DirectConvolverSSE2.cpp",
++ "audio/SincResamplerSSE2.cpp",
++ "audio/VectorMathSSE2.cpp",
++ ]
++ cflags = [ "-msse2", "-mfpmath=sse" ]
++ deps = [
++ ":blink_common",
++ ]
++ configs += [
++ # TODO(jschuh):
crbug.com/167187 fix size_t to int truncations.
++ "//build/config/compiler:no_size_t_to_int_warning",
++ "//third_party/WebKit/Source:config",
++ "//third_party/WebKit/Source:non_test_config",
++ ]
++ }
++}
+
+ # This source set is used for fuzzers that need an environment similar to unit
+ # tests.
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h 2017-06-08
22:50:09.251079402 +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 <emmintrin.h>
+
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp 2017-06-09
00:33:14.375866479 +0200
+@@ -441,7 +441,7 @@
+ const uint32_t* source32 = reinterpret_cast_ptr<const uint32_t*>(source);
+ uint32_t* destination32 = reinterpret_cast_ptr<uint32_t*>(destination);
+
+-#if CPU(X86) || CPU(X86_64)
++#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
+ SIMD::unpackOneRowOfBGRA8LittleToRGBA8(source32, destination32, pixelsPerRow);
+ #endif
+ #if HAVE(MIPS_MSA_INTRINSICS)
+@@ -467,7 +467,7 @@
+ const uint16_t* source,
+ uint8_t* destination,
+ unsigned pixelsPerRow) {
+-#if CPU(X86) || CPU(X86_64)
++#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
+ SIMD::unpackOneRowOfRGBA5551LittleToRGBA8(source, destination, pixelsPerRow);
+ #endif
+ #if HAVE(ARM_NEON_INTRINSICS)
+@@ -496,7 +496,7 @@
+ const uint16_t* source,
+ uint8_t* destination,
+ unsigned pixelsPerRow) {
+-#if CPU(X86) || CPU(X86_64)
++#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
+ SIMD::unpackOneRowOfRGBA4444LittleToRGBA8(source, destination, pixelsPerRow);
+ #endif
+ #if HAVE(ARM_NEON_INTRINSICS)
+@@ -711,7 +711,7 @@
+ uint8_t>(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
+ #if HAVE(MIPS_MSA_INTRINSICS)
+@@ -768,7 +768,7 @@
+ uint8_t>(const uint8_t* source,
+ uint8_t* destination,
+ unsigned pixelsPerRow) {
+-#if CPU(X86) || CPU(X86_64)
++#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
+ SIMD::packOneRowOfRGBA8LittleToRA8(source, destination, pixelsPerRow);
+ #endif
+ #if HAVE(MIPS_MSA_INTRINSICS)
+@@ -880,7 +880,7 @@
+ uint8_t>(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);
+ #endif
+ #if HAVE(MIPS_MSA_INTRINSICS)
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/webrtc/common_audio/real_fourier.cc
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/webrtc/common_audio/real_fourier.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/webrtc/common_audio/real_fourier.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/third_party/webrtc/common_audio/real_fourier.cc 2017-06-08
22:50:09.434076641 +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/signal_processing_library.h"
++#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
+
+ namespace webrtc {
+
+@@ -23,7 +24,15 @@
+
+ std::unique_ptr<RealFourier> 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 std::unique_ptr<RealFourier>(new RealFourierOpenmax(fft_order));
++ else
++ return std::unique_ptr<RealFourier>(new RealFourierOoura(fft_order));
++#else
+ return std::unique_ptr<RealFourier>(new RealFourierOpenmax(fft_order));
++#endif
+ #else
+ return std::unique_ptr<RealFourier>(new RealFourierOoura(fft_order));
+ #endif
+diff -Nur qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/v8/BUILD.gn
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/v8/BUILD.gn
+--- qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/v8/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++ qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/v8/BUILD.gn 2017-06-12
14:15:23.270523710 +0200
+@@ -117,7 +117,7 @@
+
+ include_dirs = [ "." ]
+
+- if (is_component_build) {
++ if (is_component_build || v8_build_shared) {
+ defines = [ "BUILDING_V8_SHARED" ]
+ }
+ }
+@@ -131,14 +131,14 @@
+ # This config should be applied to code using the libplatform.
+ config("libplatform_config") {
+ include_dirs = [ "include" ]
+- if (is_component_build) {
++ if (is_component_build || v8_build_shared) {
+ defines = [ "USING_V8_PLATFORM_SHARED" ]
+ }
+ }
+
+ # This config should be applied to code using the libbase.
+ config("libbase_config") {
+- if (is_component_build) {
++ if (is_component_build || v8_build_shared) {
+ defines = [ "USING_V8_BASE_SHARED" ]
+ }
+ libs = []
+@@ -155,7 +155,7 @@
+ # This config should only be applied to code using V8 and not any V8 code
+ # itself.
+ config("external_config") {
+- if (is_component_build) {
++ if (is_component_build || v8_build_shared) {
+ defines = [ "USING_V8_SHARED" ]
+ }
+ include_dirs = [ "include" ]
+@@ -331,6 +331,9 @@
+ cflags += [ "/arch:SSE2" ]
+ }
+ }
++ if (v8_current_cpu == "x87") {
++ defines += [ "V8_TARGET_ARCH_X87" ]
++ }
+ if (v8_current_cpu == "x64") {
+ defines += [ "V8_TARGET_ARCH_X64" ]
+ if (is_win) {
+@@ -2274,7 +2277,7 @@
+
+ defines = []
+
+- if (is_component_build) {
++ if (is_component_build || v8_build_shared) {
+ defines = [ "BUILDING_V8_BASE_SHARED" ]
+ }
+
+@@ -2364,7 +2367,7 @@
+
+ configs = [ ":internal_config_base" ]
+
+- if (is_component_build) {
++ if (is_component_build || v8_build_shared) {
+ defines = [ "BUILDING_V8_PLATFORM_SHARED" ]
+ }
+
+@@ -2507,7 +2510,26 @@
+ }
+ }
+
+-if (is_component_build) {
++if (v8_build_shared) {
++ shared_library("v8") {
++ sources = [
++ "src/v8dll-main.cc",
++ ]
++
++ deps = [
++ ":v8_dump_build_config",
++ ]
++
++ public_deps = [
++ ":v8_base",
++ ":v8_maybe_snapshot",
++ ]
++
++ configs += [ ":internal_config" ]
++
++ public_configs = [ ":external_config" ]
++ }
++} else if (is_component_build) {
+ v8_component("v8") {
+ sources = [
+ "src/v8dll-main.cc",
+diff -Nur qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/v8/gni/v8.gni
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/v8/gni/v8.gni
+--- qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/v8/gni/v8.gni 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/v8/gni/v8.gni 2017-06-12
14:15:47.965158851 +0200
+@@ -30,6 +30,9 @@
+ # Enable ECMAScript Internationalization API. Enabling this feature will
+ # add a dependency on the ICU library.
+ v8_enable_i18n_support = true
++
++ # Whether to build V8 as a shared library
++ v8_build_shared = false
+ }
+
+ if (v8_use_external_startup_data == "") {
+@@ -42,6 +45,11 @@
+ v8_enable_backtrace = is_debug && !v8_optimized_debug
+ }
+
++if (v8_current_cpu == "x86" || v8_current_cpu == "x87") {
++ # build V8 shared on x86 so we can swap x87 vs. SSE2 builds
++ v8_build_shared = true
++}
++
+ # Points to // in v8 stand-alone or to //v8/ in chromium. We need absolute
+ # paths for all configs in templates as they are shared in different
+ # subdirectories.
+diff -Nur qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/v8/make-v8-sse2-gyp.sh
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/v8/make-v8-sse2-gyp.sh
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/v8/make-v8-sse2-gyp.sh 1970-01-01
01:00:00.000000000 +0100
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/v8/make-v8-sse2-gyp.sh 2017-06-08
22:50:09.496075706 +0200
+@@ -0,0 +1,56 @@
++#!/bin/sh
++# This script renames the v8 targets to _sse2 names so that they do not conflict
++# with the non-SSE2 versions.
++
++# Copyright 2016 Kevin Kofler. 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.
++
++# add comment noting that the file is generated
++echo "# Generated from v8.gyp by make-v8-sse2-gyp.sh" >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.9.0/src/3rdparty/chromium/v8/src/inspector/BUILD.gn
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/v8/src/inspector/BUILD.gn
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/v8/src/inspector/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/v8/src/inspector/BUILD.gn 2017-06-12
14:16:16.955730521 +0200
+@@ -106,7 +106,7 @@
+ "/wd4996", # Deprecated function call.
+ ]
+ }
+- if (is_component_build) {
++ if (is_component_build || v8_build_shared) {
+ defines = [ "BUILDING_V8_SHARED" ]
+ }
+ }
+diff -Nur qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/v8/test/cctest/BUILD.gn
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/v8/test/cctest/BUILD.gn
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/v8/test/cctest/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-no-sse2/src/3rdparty/chromium/v8/test/cctest/BUILD.gn 2017-06-12
14:16:45.945302206 +0200
+@@ -335,7 +335,7 @@
+
+ defines = []
+
+- if (is_component_build) {
++ if (is_component_build || v8_build_shared) {
+ # cctest can't be built against a shared library, so we
+ # need to depend on the underlying static target in that case.
+ deps += [ "../..:v8_maybe_snapshot" ]
+diff -Nur qtwebengine-opensource-src-5.9.0/src/core/core_module.pro
qtwebengine-opensource-src-5.9.0-no-sse2/src/core/core_module.pro
+--- qtwebengine-opensource-src-5.9.0/src/core/core_module.pro 2017-05-19
06:22:04.000000000 +0200
++++ qtwebengine-opensource-src-5.9.0-no-sse2/src/core/core_module.pro 2017-06-12
00:25:07.241337485 +0200
+@@ -41,6 +41,31 @@
+ else: QMAKE_LFLAGS += $$NINJA_LFLAGS
+ POST_TARGETDEPS += $$NINJA_TARGETDEPS
+
++# go through the shared libraries that GN wants to link to
++# ignore the dummy convert_dict shared library used only to get a .pri file
++# add the ones NOT in lib/sse2 to LIBS_PRIVATE
++# don't add those in lib/sse2 that are only replacements for the normal ones
++# collect all shared libraries, non-SSE2 and SSE2, so they can be installed
++for(shlib, NINJA_SOLIBS) {
++ !contains(shlib, .*convert_dict.*) {
++ contains(shlib, .*/lib/sse2/.*) {
++ shlibs_sse2 += $$shlib
++ } else {
++ LIBS_PRIVATE += $$shlib
++ shlibs += $$shlib
++ }
++ }
++}
++
++# set the shared libraries to be installed
++# add an rpath to their installation location
++shlib_install_path = $$[QT_INSTALL_LIBS]/qtwebengine
++!isEmpty(shlibs) {
++ shlibs.files += $$shlibs
++ shlibs_sse2.files += $$shlibs_sse2
++ LIBS_PRIVATE += -Wl,--rpath,$$shlib_install_path
++}
++
+
+ LIBS_PRIVATE += -L$$api_library_path
+ CONFIG *= no_smart_library_merge
+@@ -100,7 +125,12 @@
+ locales.path = $$[QT_INSTALL_TRANSLATIONS]/qtwebengine_locales
+ resources.CONFIG += no_check_exist
+ resources.path = $$[QT_INSTALL_DATA]/resources
+- INSTALLS += locales resources
++ # install the shared libraries
++ shlibs.CONFIG += no_check_exist
++ shlibs.path = $$shlib_install_path
++ shlibs_sse2.CONFIG += no_check_exist
++ shlibs_sse2.path = $$shlib_install_path/sse2
++ INSTALLS += locales resources shlibs shlibs_sse2
+
+ !use?(system_icu) {
+ icu.CONFIG += no_check_exist
+diff -Nur qtwebengine-opensource-src-5.9.0/src/process/process.pro
qtwebengine-opensource-src-5.9.0-no-sse2/src/process/process.pro
+--- qtwebengine-opensource-src-5.9.0/src/process/process.pro 2017-05-19
06:22:04.000000000 +0200
++++ qtwebengine-opensource-src-5.9.0-no-sse2/src/process/process.pro 2017-06-12
16:36:03.823777310 +0200
+@@ -9,6 +9,8 @@
+
+ SOURCES = main.cpp
+
++QMAKE_LFLAGS += -Wl,-rpath-link,$$OUT_PWD/../core/Release
++
+ win32 {
+ SOURCES += \
+ support_win.cpp
diff --git a/qtwebengine-opensource-src-5.7.1-openmax-dl-neon.patch
b/qtwebengine-opensource-src-5.9.0-openmax-dl-neon.patch
similarity index 62%
rename from qtwebengine-opensource-src-5.7.1-openmax-dl-neon.patch
rename to qtwebengine-opensource-src-5.9.0-openmax-dl-neon.patch
index 08ff6e5..fd11fae 100644
--- a/qtwebengine-opensource-src-5.7.1-openmax-dl-neon.patch
+++ b/qtwebengine-opensource-src-5.9.0-openmax-dl-neon.patch
@@ -1,25 +1,19 @@
-diff -ur
qtwebengine-opensource-src-5.7.1/src/3rdparty/chromium/third_party/openmax_dl/dl/dl.gyp
qtwebengine-opensource-src-5.7.1-openmax-dl-neon/src/3rdparty/chromium/third_party/openmax_dl/dl/dl.gyp
----
qtwebengine-opensource-src-5.7.1/src/3rdparty/chromium/third_party/openmax_dl/dl/dl.gyp 2016-11-07
15:46:18.000000000 +0100
-+++
qtwebengine-opensource-src-5.7.1-openmax-dl-neon/src/3rdparty/chromium/third_party/openmax_dl/dl/dl.gyp 2016-12-03
22:50:19.369158276 +0100
-@@ -219,15 +219,6 @@
- 'conditions': [
- ['arm_neon_optional==1', {
- # Run-time NEON detection.
-- 'dependencies': [
-- '../../../build/android/ndk.gyp:cpu_features',
-- ],
-- 'link_settings' : {
-- 'libraries': [
-- # To get the __android_log_print routine
-- '-llog',
-- ],
-- },
- 'sources': [
- # Detection routine
- 'sp/src/arm/detect.c',
-diff -ur
qtwebengine-opensource-src-5.7.1/src/3rdparty/chromium/third_party/openmax_dl/dl/sp/src/arm/detect.c
qtwebengine-opensource-src-5.7.1-openmax-dl-neon/src/3rdparty/chromium/third_party/openmax_dl/dl/sp/src/arm/detect.c
----
qtwebengine-opensource-src-5.7.1/src/3rdparty/chromium/third_party/openmax_dl/dl/sp/src/arm/detect.c 2016-11-07
15:46:18.000000000 +0100
-+++
qtwebengine-opensource-src-5.7.1-openmax-dl-neon/src/3rdparty/chromium/third_party/openmax_dl/dl/sp/src/arm/detect.c 2016-12-03
22:48:13.745095083 +0100
+diff -ur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/openmax_dl/dl/BUILD.gn
qtwebengine-opensource-src-5.9.0-openmax-dl-neon/src/3rdparty/chromium/third_party/openmax_dl/dl/BUILD.gn
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/openmax_dl/dl/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-openmax-dl-neon/src/3rdparty/chromium/third_party/openmax_dl/dl/BUILD.gn 2017-06-10
02:41:10.317340598 +0200
+@@ -196,9 +196,6 @@
+ ]
+ if (arm_optionally_use_neon) {
+ # Run-time NEON detection.
+- deps = [ "//third_party/android_tools:cpu_features" ]
+- # To get the __android_log_print routine
+- libs = [ "log" ]
+ # Detection routine
+ sources += [ "sp/src/arm/detect.c" ]
+ }
+diff -ur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/openmax_dl/dl/sp/src/arm/detect.c
qtwebengine-opensource-src-5.9.0-openmax-dl-neon/src/3rdparty/chromium/third_party/openmax_dl/dl/sp/src/arm/detect.c
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/openmax_dl/dl/sp/src/arm/detect.c 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-openmax-dl-neon/src/3rdparty/chromium/third_party/openmax_dl/dl/sp/src/arm/detect.c 2017-06-10
02:38:30.593809570 +0200
@@ -9,13 +9,57 @@
*
*/
diff --git a/qtwebengine-opensource-src-5.9.0-skia-neon.patch
b/qtwebengine-opensource-src-5.9.0-skia-neon.patch
new file mode 100644
index 0000000..3506533
--- /dev/null
+++ b/qtwebengine-opensource-src-5.9.0-skia-neon.patch
@@ -0,0 +1,436 @@
+diff -Nur qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/skia/BUILD.gn
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/skia/BUILD.gn
+--- qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/skia/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/skia/BUILD.gn 2017-06-12
12:59:26.707922417 +0200
+@@ -486,6 +486,24 @@
+
+ # Separated out so it can be compiled with different flags for SSE.
+ if (!skia_build_no_opts) {
++ if (current_cpu == "arm" && (arm_use_neon ||
arm_optionally_use_neon)) {
++ source_set("skia_opts_neon") {
++ sources = skia_opts.neon_sources
++ # Root build config sets -mfpu=$arm_fpu, which we expect to be neon
++ # when running this.
++ if (!arm_use_neon) {
++ configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
++ cflags = [ "-mfpu=neon" ]
++ }
++ visibility = [ ":skia_opts" ]
++ configs -= [ "//build/config/compiler:chromium_code" ]
++ configs += [
++ ":skia_config",
++ ":skia_library_config",
++ "//build/config/compiler:no_chromium_code",
++ ]
++ }
++ }
+ if (current_cpu == "arm64") {
+ source_set("skia_opts_crc32") {
+ sources = skia_opts.crc32_sources
+@@ -624,14 +642,7 @@
+ if (arm_version >= 7) {
+ sources = skia_opts.armv7_sources
+ if (arm_use_neon || arm_optionally_use_neon) {
+- sources += skia_opts.neon_sources
+-
+- # Root build config sets -mfpu=$arm_fpu, which we expect to be neon
+- # when running this.
+- if (!arm_use_neon) {
+- configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
+- cflags += [ "-mfpu=neon" ]
+- }
++ deps += [ ":skia_opts_neon" ]
+ }
+ } else {
+ sources = skia_opts.none_sources
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/gn/opts.gni
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/gn/opts.gni
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/gn/opts.gni 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/gn/opts.gni 2017-06-12
12:20:30.277109309 +0200
+@@ -23,6 +23,7 @@
+ "$_src/opts/SkBitmapProcState_matrixProcs_neon.cpp",
+ "$_src/opts/SkBlitMask_opts_arm_neon.cpp",
+ "$_src/opts/SkBlitRow_opts_arm_neon.cpp",
++ "$_src/opts/SkOpts_neon.cpp",
+ ]
+
+ arm64 = [
+@@ -33,6 +34,7 @@
+ "$_src/opts/SkBlitMask_opts_arm_neon.cpp",
+ "$_src/opts/SkBlitRow_opts_arm.cpp",
+ "$_src/opts/SkBlitRow_opts_arm_neon.cpp",
++ "$_src/opts/SkOpts_neon.cpp",
+ ]
+
+ crc32 = [ "$_src/opts/SkOpts_crc32.cpp" ]
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/src/core/SkBitmapProcState.cpp
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/src/core/SkBitmapProcState.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/src/core/SkBitmapProcState.cpp 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/src/core/SkBitmapProcState.cpp 2017-06-12
12:20:30.382107811 +0200
+@@ -19,7 +19,7 @@
+ #include "SkImageEncoder.h"
+ #include "SkResourceCache.h"
+
+-#if defined(SK_ARM_HAS_NEON)
++#if !SK_ARM_NEON_IS_NONE
+ // These are defined in src/opts/SkBitmapProcState_arm_neon.cpp
+ extern const SkBitmapProcState::SampleProc32 gSkBitmapProcStateSample32_neon[];
+ extern void S16_D16_filter_DX_neon(const SkBitmapProcState&, const uint32_t*, int,
uint16_t*);
+@@ -280,7 +280,7 @@
+ return false;
+ }
+
+-#if !defined(SK_ARM_HAS_NEON)
++#if !SK_ARM_NEON_IS_ALWAYS
+ static const SampleProc32 gSkBitmapProcStateSample32[] = {
+ S32_opaque_D32_nofilter_DXDY,
+ S32_alpha_D32_nofilter_DXDY,
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp 2017-06-12
12:20:30.448106869 +0200
+@@ -47,16 +47,16 @@
+ ///////////////////////////////////////////////////////////////////////////////
+
+ // Compile neon code paths if needed
+-#if defined(SK_ARM_HAS_NEON)
++#if !SK_ARM_NEON_IS_NONE
+
+ // These are defined in src/opts/SkBitmapProcState_matrixProcs_neon.cpp
+ extern const SkBitmapProcState::MatrixProc ClampX_ClampY_Procs_neon[];
+ extern const SkBitmapProcState::MatrixProc RepeatX_RepeatY_Procs_neon[];
+
+-#endif // defined(SK_ARM_HAS_NEON)
++#endif // !SK_ARM_NEON_IS_NONE
+
+ // Compile non-neon code path if needed
+-#if !defined(SK_ARM_HAS_NEON)
++#if !SK_ARM_NEON_IS_ALWAYS
+ #define MAKENAME(suffix) ClampX_ClampY ## suffix
+ #define TILEX_PROCF(fx, max) SkClampMax((fx) >> 16, max)
+ #define TILEY_PROCF(fy, max) SkClampMax((fy) >> 16, max)
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/src/core/SkBlitter_RGB16.cpp
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/src/core/SkBlitter_RGB16.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/src/core/SkBlitter_RGB16.cpp 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/src/core/SkBlitter_RGB16.cpp 2017-06-12
12:20:30.449106855 +0200
+@@ -20,7 +20,7 @@
+ uint32_t expanded32, unsigned maskRB);
+ #endif
+
+-#if defined(SK_ARM_HAS_NEON) && defined(SK_CPU_LENDIAN)
++#if SK_ARM_NEON_IS_ALWAYS && defined(SK_CPU_LENDIAN)
+ #include <arm_neon.h>
+ extern void SkRGB16BlitterBlitV_neon(uint16_t* device,
+ int height,
+@@ -381,7 +381,7 @@
+ unsigned maskRB = mask.fRowBytes - width;
+ uint32_t expanded32 = fExpandedRaw16;
+
+-#if defined(SK_ARM_HAS_NEON) && defined(SK_CPU_LENDIAN)
++#if SK_ARM_NEON_IS_ALWAYS && defined(SK_CPU_LENDIAN)
+ #define UNROLL 8
+ do {
+ int w = width;
+@@ -475,7 +475,7 @@
+ unsigned scale5 = SkAlpha255To256(alpha) >> 3;
+ uint32_t src32 = fExpandedRaw16 * scale5;
+ scale5 = 32 - scale5;
+-#if defined(SK_ARM_HAS_NEON) && defined(SK_CPU_LENDIAN)
++#if SK_ARM_NEON_IS_ALWAYS && defined(SK_CPU_LENDIAN)
+ SkRGB16BlitterBlitV_neon(device, height, deviceRB, scale5, src32);
+ #else
+ do {
+@@ -654,7 +654,7 @@
+ unsigned scale5 = SkAlpha255To256(alpha) * fScale >> (8 + 3);
+ uint32_t src32 = fExpandedRaw16 * scale5;
+ scale5 = 32 - scale5;
+-#if defined(SK_ARM_HAS_NEON) && defined(SK_CPU_LENDIAN)
++#if SK_ARM_NEON_IS_ALWAYS && defined(SK_CPU_LENDIAN)
+ SkRGB16BlitterBlitV_neon(device, height, deviceRB, scale5, src32);
+ #else
+ do {
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/src/core/SkCpu.cpp
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/src/core/SkCpu.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/src/core/SkCpu.cpp 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/src/core/SkCpu.cpp 2017-06-12
12:20:30.449106855 +0200
+@@ -73,6 +73,124 @@
+ return features;
+ }
+
++#elif defined(SK_CPU_ARM32) && \
++ !defined(SK_BUILD_FOR_ANDROID)
++#include <unistd.h>
++#include <fcntl.h>
++#include <errno.h>
++#include <string.h>
++#include <pthread.h>
++
++ static uint32_t read_cpu_features() {
++ uint32_t features = 0;
++
++ // If we fail any of the following, assume we don't have NEON/VFPv4
instructions
++ // This allows us to return immediately in case of error.
++ bool have_neon = false;
++ bool have_vfpv4 = false;
++
++ // There is no user-accessible CPUID instruction on ARM that we can use.
++ // Instead, we must parse /proc/cpuinfo and look for the 'neon'
feature.
++ // For example, here's a typical output (Nexus S running ICS 4.0.3):
++ /*
++ Processor : ARMv7 Processor rev 2 (v7l)
++ BogoMIPS : 994.65
++ Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3
++ CPU implementer : 0x41
++ CPU architecture: 7
++ CPU variant : 0x2
++ CPU part : 0xc08
++ CPU revision : 2
++
++ Hardware : herring
++ Revision : 000b
++ Serial : 3833c77d6dc000ec
++ */
++ char buffer[4096];
++
++ do {
++ // open /proc/cpuinfo
++ int fd = TEMP_FAILURE_RETRY(open("/proc/cpuinfo", O_RDONLY));
++ if (fd < 0) {
++ SkDebugf("Could not open /proc/cpuinfo: %s\n",
strerror(errno));
++ break;
++ }
++
++ // Read the file. To simplify our search, we're going to place two
++ // sentinel '\n' characters: one at the start of the buffer, and one
at
++ // the end. This means we reserve the first and last buffer bytes.
++ buffer[0] = '\n';
++ int size = TEMP_FAILURE_RETRY(read(fd, buffer+1, sizeof(buffer)-2));
++ close(fd);
++
++ if (size < 0) { // should not happen
++ SkDebugf("Could not read /proc/cpuinfo: %s\n",
strerror(errno));
++ break;
++ }
++
++ SkDebugf("START /proc/cpuinfo:\n%.*s\nEND /proc/cpuinfo\n",
++ size, buffer+1);
++
++ // Compute buffer limit, and place final sentinel
++ char* buffer_end = buffer + 1 + size;
++ buffer_end[0] = '\n';
++
++ // Now, find a line that starts with "Features", i.e. look for
++ // '\nFeatures ' in our buffer.
++ const char features[] = "\nFeatures\t";
++ const size_t features_len = sizeof(features)-1;
++
++ char* line = (char*) memmem(buffer, buffer_end - buffer,
++ features, features_len);
++ if (line == nullptr) { // Weird, no Features line, bad kernel?
++ SkDebugf("Could not find a line starting with
'Features'"
++ "in /proc/cpuinfo ?\n");
++ break;
++ }
++
++ line += features_len; // Skip the "\nFeatures\t" prefix
++
++ // Find the end of the current line
++ char* line_end = (char*) memchr(line, '\n', buffer_end - line);
++ if (line_end == nullptr)
++ line_end = buffer_end;
++
++ // Now find an instance of 'neon' in the flags list. We want to
++ // ensure it's only 'neon' and not something fancy like
'noneon'
++ // so check that it follows a space.
++ const char neon[] = " neon";
++ const size_t neon_len = sizeof(neon)-1;
++ const char* flag = (const char*) memmem(line, line_end - line,
++ neon, neon_len);
++ // Ensure it is followed by a space or a newline.
++ if (flag != nullptr
++ && (flag[neon_len] == ' ' || flag[neon_len] ==
'\n')) {
++ // Fine, we support Arm NEON !
++ have_neon = true;
++ }
++
++ // Now find an instance of 'vfpv4' in the flags list. We want to
++ // ensure it's only 'vfpv4' and not something fancy like
'novfpv4'
++ // so check that it follows a space.
++ const char vfpv4[] = " vfpv4";
++ const size_t vfpv4_len = sizeof(vfpv4)-1;
++ const char* vflag = (const char*) memmem(line, line_end - line,
++ vfpv4, vfpv4_len);
++ // Ensure it is followed by a space or a newline.
++ if (vflag != nullptr
++ && (vflag[vfpv4_len] == ' ' || vflag[vfpv4_len] ==
'\n')) {
++ // Fine, we support Arm VFPv4 !
++ have_vfpv4 = true;
++ }
++
++ } while (0);
++
++ if (have_neon) { features |= SkCpu::NEON ; }
++ if (have_neon && have_vfpv4) { features |= SkCpu::NEON_FMA; }
++ if (have_vfpv4) { features |= SkCpu::VFP_FP16; }
++ return features;
++ }
++
+ #elif defined(SK_CPU_ARM64) && \
+ defined(SK_BUILD_FOR_ANDROID) && \
+ !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK)
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/src/core/SkOpts.cpp
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/src/core/SkOpts.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/src/core/SkOpts.cpp 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/src/core/SkOpts.cpp 2017-06-12
12:20:30.449106855 +0200
+@@ -99,6 +99,7 @@
+ void Init_avx();
+ void Init_hsw();
+ void Init_crc32();
++ void Init_neon();
+
+ static void init() {
+ #if !defined(SK_BUILD_NO_OPTS)
+@@ -109,6 +110,9 @@
+ if (SkCpu::Supports(SkCpu::AVX )) { Init_avx(); }
+ if (SkCpu::Supports(SkCpu::HSW )) { Init_hsw(); }
+
++ #elif defined(SK_CPU_ARM32)
++ if (SkCpu::Supports(SkCpu::NEON)) { Init_neon(); }
++
+ #elif defined(SK_CPU_ARM64)
+ if (SkCpu::Supports(SkCpu::CRC32)) { Init_crc32(); }
+
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/src/core/SkUtilsArm.h
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/src/core/SkUtilsArm.h
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/src/core/SkUtilsArm.h 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/src/core/SkUtilsArm.h 2017-06-12
12:20:30.450106841 +0200
+@@ -8,12 +8,75 @@
+ #ifndef SkUtilsArm_DEFINED
+ #define SkUtilsArm_DEFINED
+
+-#include "SkTypes.h"
++#include "SkCpu.h"
++#include "SkUtils.h"
+
+-#if defined(SK_ARM_HAS_NEON)
+- #define SK_ARM_NEON_WRAP(x) (x ## _neon)
++// Define SK_ARM_NEON_MODE to one of the following values
++// corresponding respectively to:
++// - No ARM Neon support at all (not targetting ARMv7-A, or don't have NEON)
++// - Full ARM Neon support (i.e. assume the CPU always supports it)
++// - Optional ARM Neon support (i.e. probe CPU at runtime)
++//
++#define SK_ARM_NEON_MODE_NONE 0
++#define SK_ARM_NEON_MODE_ALWAYS 1
++#define SK_ARM_NEON_MODE_DYNAMIC 2
++
++#if defined(SK_ARM_HAS_OPTIONAL_NEON)
++# define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_DYNAMIC
++#elif defined(SK_ARM_HAS_NEON)
++# define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_ALWAYS
++#else
++# define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_NONE
++#endif
++
++// Convenience test macros, always defined as 0 or 1
++#define SK_ARM_NEON_IS_NONE (SK_ARM_NEON_MODE == SK_ARM_NEON_MODE_NONE)
++#define SK_ARM_NEON_IS_ALWAYS (SK_ARM_NEON_MODE == SK_ARM_NEON_MODE_ALWAYS)
++#define SK_ARM_NEON_IS_DYNAMIC (SK_ARM_NEON_MODE == SK_ARM_NEON_MODE_DYNAMIC)
++
++// The sk_cpu_arm_has_neon() function returns true iff the target device
++// is ARMv7-A and supports Neon instructions. In DYNAMIC mode, this actually
++// probes the CPU at runtime (and caches the result).
++
++static inline bool sk_cpu_arm_has_neon(void) {
++#if SK_ARM_NEON_IS_NONE
++ return false;
+ #else
+- #define SK_ARM_NEON_WRAP(x) (x)
++ return SkCpu::Supports(SkCpu::NEON);
++#endif
++}
++
++// Use SK_ARM_NEON_WRAP(symbol) to map 'symbol' to a NEON-specific symbol
++// when applicable. This will transform 'symbol' differently depending on
++// the current NEON configuration, i.e.:
++//
++// NONE -> 'symbol'
++// ALWAYS -> 'symbol_neon'
++// DYNAMIC -> 'symbol' or 'symbol_neon' depending on
runtime check.
++//
++// The goal is to simplify user code, for example:
++//
++// return SK_ARM_NEON_WRAP(do_something)(params);
++//
++// Replaces the equivalent:
++//
++// #if SK_ARM_NEON_IS_NONE
++// return do_something(params);
++// #elif SK_ARM_NEON_IS_ALWAYS
++// return do_something_neon(params);
++// #elif SK_ARM_NEON_IS_DYNAMIC
++// if (sk_cpu_arm_has_neon())
++// return do_something_neon(params);
++// else
++// return do_something(params);
++// #endif
++//
++#if SK_ARM_NEON_IS_NONE
++# define SK_ARM_NEON_WRAP(x) (x)
++#elif SK_ARM_NEON_IS_ALWAYS
++# define SK_ARM_NEON_WRAP(x) (x ## _neon)
++#elif SK_ARM_NEON_IS_DYNAMIC
++# define SK_ARM_NEON_WRAP(x) (sk_cpu_arm_has_neon() ? x ## _neon : x)
+ #endif
+
+ #endif // SkUtilsArm_DEFINED
+diff -Nur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/src/opts/SkOpts_neon.cpp
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/src/opts/SkOpts_neon.cpp
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/skia/src/opts/SkOpts_neon.cpp 1970-01-01
01:00:00.000000000 +0100
++++
qtwebengine-opensource-src-5.9.0-skia-neon/src/3rdparty/chromium/third_party/skia/src/opts/SkOpts_neon.cpp 2017-06-12
12:20:30.450106841 +0200
+@@ -0,0 +1,54 @@
++/*
++ * Copyright 2015 Google Inc.
++ *
++ * Use of this source code is governed by a BSD-style license that can be
++ * found in the LICENSE file.
++ */
++
++#include "SkOpts.h"
++
++#define SK_OPTS_NS sk_neon
++#include "SkBlitMask_opts.h"
++#include "SkBlitRow_opts.h"
++#include "SkBlurImageFilter_opts.h"
++#include "SkColorCubeFilter_opts.h"
++#include "SkMorphologyImageFilter_opts.h"
++#include "SkSwizzler_opts.h"
++#include "SkTextureCompressor_opts.h"
++#include "SkXfermode_opts.h"
++
++namespace SkOpts {
++ void Init_neon() {
++ create_xfermode = sk_neon::create_xfermode;
++
++ box_blur_xx = sk_neon::box_blur_xx;
++ box_blur_xy = sk_neon::box_blur_xy;
++ box_blur_yx = sk_neon::box_blur_yx;
++
++ dilate_x = sk_neon::dilate_x;
++ dilate_y = sk_neon::dilate_y;
++ erode_x = sk_neon::erode_x;
++ erode_y = sk_neon::erode_y;
++
++ texture_compressor = sk_neon::texture_compressor;
++ fill_block_dimensions = sk_neon::fill_block_dimensions;
++
++ blit_mask_d32_a8 = sk_neon::blit_mask_d32_a8;
++
++ blit_row_color32 = sk_neon::blit_row_color32;
++ blit_row_s32a_opaque = sk_neon::blit_row_s32a_opaque;
++
++ color_cube_filter_span = sk_neon::color_cube_filter_span;
++
++ RGBA_to_BGRA = sk_neon::RGBA_to_BGRA;
++ RGBA_to_rgbA = sk_neon::RGBA_to_rgbA;
++ RGBA_to_bgrA = sk_neon::RGBA_to_bgrA;
++ RGB_to_RGB1 = sk_neon::RGB_to_RGB1;
++ RGB_to_BGR1 = sk_neon::RGB_to_BGR1;
++ gray_to_RGB1 = sk_neon::gray_to_RGB1;
++ grayA_to_RGBA = sk_neon::grayA_to_RGBA;
++ grayA_to_rgbA = sk_neon::grayA_to_rgbA;
++ inverted_CMYK_to_RGB1 = sk_neon::inverted_CMYK_to_RGB1;
++ inverted_CMYK_to_BGR1 = sk_neon::inverted_CMYK_to_BGR1;
++ }
++}
diff --git a/qtwebengine-opensource-src-5.8.0-system-icu-utf.patch
b/qtwebengine-opensource-src-5.9.0-system-icu-utf.patch
similarity index 66%
rename from qtwebengine-opensource-src-5.8.0-system-icu-utf.patch
rename to qtwebengine-opensource-src-5.9.0-system-icu-utf.patch
index dff88b5..1c905e4 100644
--- a/qtwebengine-opensource-src-5.8.0-system-icu-utf.patch
+++ b/qtwebengine-opensource-src-5.9.0-system-icu-utf.patch
@@ -1,19 +1,7 @@
-diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/base.gypi
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/base.gypi
----
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/base.gypi 2017-03-05
16:48:14.206027229 +0100
-+++
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/base.gypi 2017-03-05
16:50:49.266714740 +0100
-@@ -674,8 +674,6 @@
- 'third_party/dmg_fp/dmg_fp.h',
- 'third_party/dmg_fp/dtoa_wrapper.cc',
- 'third_party/dmg_fp/g_fmt.cc',
-- 'third_party/icu/icu_utf.cc',
-- 'third_party/icu/icu_utf.h',
- 'third_party/superfasthash/superfasthash.c',
- 'third_party/xdg_mime/xdgmime.h',
- 'threading/non_thread_safe.h',
-diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/BUILD.gn
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/BUILD.gn
----
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/BUILD.gn 2017-03-05
16:48:14.207027214 +0100
-+++
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/BUILD.gn 2017-03-05
16:50:49.267714725 +0100
-@@ -801,8 +801,6 @@
+diff -ur
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/BUILD.gn
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/BUILD.gn
+---
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/BUILD.gn 2017-06-08
10:52:51.565409865 +0200
++++
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/BUILD.gn 2017-06-08
11:13:47.297983554 +0200
+@@ -834,8 +834,6 @@
"third_party/dmg_fp/dmg_fp.h",
"third_party/dmg_fp/dtoa_wrapper.cc",
"third_party/dmg_fp/g_fmt.cc",
@@ -22,9 +10,9 @@ diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromi
"third_party/superfasthash/superfasthash.c",
"threading/non_thread_safe.h",
"threading/non_thread_safe_impl.cc",
-diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/files/file_path.cc
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/files/file_path.cc
----
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/files/file_path.cc 2017-01-03
10:28:53.000000000 +0100
-+++
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/files/file_path.cc 2017-03-05
16:50:49.267714725 +0100
+diff -ur
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/files/file_path.cc
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/files/file_path.cc
+---
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/files/file_path.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/files/file_path.cc 2017-06-08
11:02:19.933803953 +0200
@@ -18,7 +18,7 @@
#if defined(OS_MACOSX)
@@ -34,7 +22,7 @@ diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromi
#endif
#if defined(OS_WIN)
-@@ -1150,9 +1150,9 @@
+@@ -1156,9 +1156,9 @@
int* index) {
int codepoint = 0;
while (*index < length && codepoint == 0) {
@@ -46,9 +34,9 @@ diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromi
DCHECK_GT(codepoint, 0);
if (codepoint > 0) {
// Check if there is a subtable for this upper byte.
-diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/json/json_parser.cc
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/json/json_parser.cc
----
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/json/json_parser.cc 2017-01-03
10:28:53.000000000 +0100
-+++
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/json/json_parser.cc 2017-03-05
16:50:49.268714710 +0100
+diff -ur
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/json/json_parser.cc
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/json/json_parser.cc
+---
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/json/json_parser.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/json/json_parser.cc 2017-06-08
11:05:52.045814002 +0200
@@ -16,7 +16,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversion_utils.h"
@@ -58,27 +46,33 @@ diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromi
#include "base/values.h"
namespace base {
-@@ -631,8 +631,8 @@
- int32_t next_char = 0;
+@@ -630,21 +630,21 @@
while (CanConsume(1)) {
+ int start_index = index_;
- pos_ = start_pos_ + index_; // CBU8_NEXT is postcrement.
- CBU8_NEXT(start_pos_, index_, length, next_char);
+ pos_ = start_pos_ + index_; // U8_NEXT is postcrement.
+ U8_NEXT(start_pos_, index_, length, next_char);
if (next_char < 0 || !IsValidCharacter(next_char)) {
- ReportError(JSONReader::JSON_UNSUPPORTED_ENCODING, 1);
- return false;
-@@ -725,7 +725,7 @@
- return false;
+ if ((options_ & JSON_REPLACE_INVALID_CHARACTERS) == 0) {
+ ReportError(JSONReader::JSON_UNSUPPORTED_ENCODING, 1);
+ return false;
}
- } else if (next_char == '"') {
+- CBU8_NEXT(start_pos_, start_index, length, next_char);
++ U8_NEXT(start_pos_, start_index, length, next_char);
+ string.Convert();
+ string.AppendString(kUnicodeReplacementString);
+ continue;
+ }
+
+ if (next_char == '"') {
- --index_; // Rewind by one because of CBU8_NEXT.
+ --index_; // Rewind by one because of U8_NEXT.
out->Swap(&string);
return true;
- } else {
-@@ -765,10 +765,10 @@
+ }
+@@ -774,10 +774,10 @@
// If this is a high surrogate, consume the next code unit to get the
// low surrogate.
@@ -91,7 +85,7 @@ diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromi
return false;
// Make sure that the token has more characters to consume the
-@@ -785,24 +785,24 @@
+@@ -794,24 +794,24 @@
NextNChars(3);
@@ -121,7 +115,7 @@ diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromi
}
dest_string->append(code_unit8);
-@@ -819,9 +819,9 @@
+@@ -828,9 +828,9 @@
} else {
char utf8_units[4] = { 0 };
int offset = 0;
@@ -133,9 +127,9 @@ diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromi
// zero terminated at this point. |offset| contains the correct length.
dest->AppendString(std::string(utf8_units, offset));
}
-diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/json/string_escape.cc
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/json/string_escape.cc
----
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/json/string_escape.cc 2017-01-03
10:28:53.000000000 +0100
-+++
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/json/string_escape.cc 2017-03-05
16:50:49.268714710 +0100
+diff -ur
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/json/string_escape.cc
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/json/string_escape.cc
+---
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/json/string_escape.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/json/string_escape.cc 2017-06-08
11:02:19.934803939 +0200
@@ -14,7 +14,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversion_utils.h"
@@ -145,9 +139,9 @@ diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromi
namespace base {
-diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/pattern.cc
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/strings/pattern.cc
----
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/pattern.cc 2017-01-03
10:28:53.000000000 +0100
-+++
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/strings/pattern.cc 2017-03-05
16:50:49.404712681 +0100
+diff -ur
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/pattern.cc
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/strings/pattern.cc
+---
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/pattern.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/strings/pattern.cc 2017-06-08
11:02:21.774778002 +0200
@@ -4,13 +4,13 @@
#include "base/strings/pattern.h"
@@ -203,9 +197,9 @@ diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromi
*p += offset;
return c;
}
-diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/string_split.cc
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/strings/string_split.cc
----
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/string_split.cc 2017-01-03
10:28:53.000000000 +0100
-+++
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/strings/string_split.cc 2017-03-05
16:50:49.404712681 +0100
+diff -ur
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/string_split.cc
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/strings/string_split.cc
+---
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/string_split.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/strings/string_split.cc 2017-06-08
11:02:21.774778002 +0200
@@ -8,7 +8,7 @@
#include "base/logging.h"
@@ -215,9 +209,9 @@ diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromi
namespace base {
-diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/string_util.cc
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/strings/string_util.cc
----
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/string_util.cc 2017-01-03
10:28:53.000000000 +0100
-+++
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/strings/string_util.cc 2017-03-05
16:50:49.404712681 +0100
+diff -ur
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/string_util.cc
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/strings/string_util.cc
+---
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/string_util.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/strings/string_util.cc 2017-06-08
11:02:21.775777988 +0200
@@ -25,7 +25,7 @@
#include "base/memory/singleton.h"
#include "base/strings/utf_string_conversion_utils.h"
@@ -260,9 +254,9 @@ diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromi
if (!IsValidCharacter(code_point))
return false;
}
-diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/utf_string_conversion_utils.cc
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/strings/utf_string_conversion_utils.cc
----
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/utf_string_conversion_utils.cc 2017-01-03
10:28:53.000000000 +0100
-+++
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/base/strings/utf_string_conversion_utils.cc 2017-03-05
16:50:49.404712681 +0100
+diff -ur
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/utf_string_conversion_utils.cc
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/strings/utf_string_conversion_utils.cc
+---
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/strings/utf_string_conversion_utils.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/base/strings/utf_string_conversion_utils.cc 2017-06-08
11:02:21.775777988 +0200
@@ -4,7 +4,7 @@
#include "base/strings/utf_string_conversion_utils.h"
@@ -341,9 +335,40 @@ diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromi
}
// Generalized Unicode converter -----------------------------------------------
-diff -ur
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/ui/gfx/utf16_indexing.cc
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/ui/gfx/utf16_indexing.cc
----
qtwebengine-opensource-src-5.8.0-system-nspr-prtime/src/3rdparty/chromium/ui/gfx/utf16_indexing.cc 2017-01-03
10:28:53.000000000 +0100
-+++
qtwebengine-opensource-src-5.8.0-system-icu-utf/src/3rdparty/chromium/ui/gfx/utf16_indexing.cc 2017-03-05
16:50:49.405712666 +0100
+diff -ur
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py
+---
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py 2017-06-08
10:55:05.945934291 +0200
++++
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py 2017-06-08
11:14:16.956570568 +0200
+@@ -472,7 +472,6 @@
+ 'base/task_scheduler/task_traits.cc',
+ 'base/third_party/dmg_fp/dtoa_wrapper.cc',
+ 'base/third_party/dmg_fp/g_fmt.cc',
+- 'base/third_party/icu/icu_utf.cc',
+ 'base/threading/non_thread_safe_impl.cc',
+ 'base/threading/post_task_and_reply_impl.cc',
+ 'base/threading/sequenced_task_runner_handle.cc',
+@@ -574,7 +573,7 @@
+ }
+
+ if is_linux:
+- libs.extend(['-lrt', '-lnspr4'])
++ libs.extend(['-lrt', '-lnspr4', '-licuuc'])
+ ldflags.extend(['-pthread'])
+
+ static_libraries['xdg_user_dirs'] = {
+diff -ur
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/tools/gn/BUILD.gn
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/tools/gn/BUILD.gn
+---
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/tools/gn/BUILD.gn 2017-06-10
22:18:26.863178931 +0200
++++
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/tools/gn/BUILD.gn 2017-06-10
22:18:30.168114045 +0200
+@@ -277,6 +277,7 @@
+
+ libs = [
+ "nspr4",
++ "icuuc",
+ ]
+ }
+
+diff -ur
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/ui/gfx/utf16_indexing.cc
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/ui/gfx/utf16_indexing.cc
+---
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/ui/gfx/utf16_indexing.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-system-icu-utf/src/3rdparty/chromium/ui/gfx/utf16_indexing.cc 2017-06-08
11:02:21.776777974 +0200
@@ -5,13 +5,13 @@
#include "ui/gfx/utf16_indexing.h"
diff --git a/qtwebengine-opensource-src-5.9.0-system-nspr-prtime.patch
b/qtwebengine-opensource-src-5.9.0-system-nspr-prtime.patch
new file mode 100644
index 0000000..ab14cb9
--- /dev/null
+++ b/qtwebengine-opensource-src-5.9.0-system-nspr-prtime.patch
@@ -0,0 +1,80 @@
+diff -ur qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/base/BUILD.gn
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/BUILD.gn
+--- qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/base/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/BUILD.gn 2017-06-08
10:52:51.565409865 +0200
+@@ -49,6 +49,9 @@
+ "-Wno-char-subscripts",
+ ]
+ }
++ ldflags = [
++ "-lnspr4",
++ ]
+ }
+
+ config("base_implementation") {
+@@ -833,8 +836,6 @@
+ "third_party/dmg_fp/g_fmt.cc",
+ "third_party/icu/icu_utf.cc",
+ "third_party/icu/icu_utf.h",
+- "third_party/nspr/prtime.cc",
+- "third_party/nspr/prtime.h",
+ "third_party/superfasthash/superfasthash.c",
+ "threading/non_thread_safe.h",
+ "threading/non_thread_safe_impl.cc",
+diff -ur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/base/time/pr_time_unittest.cc
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/time/pr_time_unittest.cc
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/base/time/pr_time_unittest.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/time/pr_time_unittest.cc 2017-06-08
10:58:06.743413247 +0200
+@@ -7,7 +7,7 @@
+
+ #include "base/compiler_specific.h"
+ #include "base/macros.h"
+-#include "base/third_party/nspr/prtime.h"
++#include <nspr4/prtime.h>
+ #include "base/time/time.h"
+ #include "build/build_config.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+diff -ur qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/base/time/time.cc
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/time/time.cc
+--- qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/base/time/time.cc 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/base/time/time.cc 2017-06-08
10:58:09.557373071 +0200
+@@ -14,7 +14,7 @@
+ #include "base/logging.h"
+ #include "base/macros.h"
+ #include "base/strings/stringprintf.h"
+-#include "base/third_party/nspr/prtime.h"
++#include <nspr4/prtime.h>
+ #include "build/build_config.h"
+
+ namespace base {
+diff -ur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py 2017-06-08
10:55:05.945934291 +0200
+@@ -473,7 +473,6 @@
+ 'base/third_party/dmg_fp/dtoa_wrapper.cc',
+ 'base/third_party/dmg_fp/g_fmt.cc',
+ 'base/third_party/icu/icu_utf.cc',
+- 'base/third_party/nspr/prtime.cc',
+ 'base/threading/non_thread_safe_impl.cc',
+ 'base/threading/post_task_and_reply_impl.cc',
+ 'base/threading/sequenced_task_runner_handle.cc',
+@@ -575,7 +574,7 @@
+ }
+
+ if is_linux:
+- libs.extend(['-lrt'])
++ libs.extend(['-lrt', '-lnspr4'])
+ ldflags.extend(['-pthread'])
+
+ static_libraries['xdg_user_dirs'] = {
+diff -ur qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/tools/gn/BUILD.gn
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/tools/gn/BUILD.gn
+--- qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/tools/gn/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-system-nspr-prtime/src/3rdparty/chromium/tools/gn/BUILD.gn 2017-06-10
22:18:26.863178931 +0200
+@@ -274,6 +274,10 @@
+ "//build/config/sanitizers:deps",
+ "//build/win:default_exe_manifest",
+ ]
++
++ libs = [
++ "nspr4",
++ ]
+ }
+
+ test("gn_unittests") {
diff --git a/qtwebengine-opensource-src-5.9.0-system-re2.patch
b/qtwebengine-opensource-src-5.9.0-system-re2.patch
new file mode 100644
index 0000000..ac7bf5d
--- /dev/null
+++ b/qtwebengine-opensource-src-5.9.0-system-re2.patch
@@ -0,0 +1,24 @@
+diff -ur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/build/linux/unbundle/re2.gn
qtwebengine-opensource-src-5.9.0-system-re2/src/3rdparty/chromium/build/linux/unbundle/re2.gn
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/build/linux/unbundle/re2.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-system-re2/src/3rdparty/chromium/build/linux/unbundle/re2.gn 2017-06-10
23:22:13.065385884 +0200
+@@ -5,13 +5,14 @@
+ import("//build/shim_headers.gni")
+
+ shim_headers("re2_shim") {
+- root_path = "src"
++ root_path = "src/re2"
++ prefix = "re2/"
+ headers = [
+- "re2/filtered_re2.h",
+- "re2/re2.h",
+- "re2/set.h",
+- "re2/stringpiece.h",
+- "re2/variadic_function.h",
++ "filtered_re2.h",
++ "re2.h",
++ "set.h",
++ "stringpiece.h",
++ "variadic_function.h",
+ ]
+ }
+
diff --git a/qtwebengine-opensource-src-5.9.0-webrtc-neon-detect.patch
b/qtwebengine-opensource-src-5.9.0-webrtc-neon-detect.patch
new file mode 100644
index 0000000..a21802a
--- /dev/null
+++ b/qtwebengine-opensource-src-5.9.0-webrtc-neon-detect.patch
@@ -0,0 +1,14 @@
+diff -ur
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/webrtc/system_wrappers/BUILD.gn
qtwebengine-opensource-src-5.9.0-webrtc-neon-detect/src/3rdparty/chromium/third_party/webrtc/system_wrappers/BUILD.gn
+---
qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/third_party/webrtc/system_wrappers/BUILD.gn 2017-05-18
16:51:44.000000000 +0200
++++
qtwebengine-opensource-src-5.9.0-webrtc-neon-detect/src/3rdparty/chromium/third_party/webrtc/system_wrappers/BUILD.gn 2017-06-10
13:20:14.959007488 +0200
+@@ -93,9 +93,7 @@
+ if (is_linux) {
+ defines += [ "WEBRTC_THREAD_RR" ]
+
+- if (!build_with_chromium) {
+- deps += [ ":cpu_features_linux" ]
+- }
++ deps += [ ":cpu_features_linux" ]
+
+ libs += [ "rt" ]
+ }
diff --git a/sources b/sources
index d53cc80..6b8fdaf 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-6e7fb2be161c6db4d988a4f5b329672f qtwebengine-opensource-src-5.8.0.tar.xz
+d7ca5049baf5ff69d69ee58d5da392d4 qtwebengine-opensource-src-5.9.0.tar.xz