Bug 1460357 - Do not use optimized AVX for Skia convolve_vertically in MinGW. r=lsalzman, a=jcristau
authorTom Ritter <tom@mozilla.com>
Wed, 25 Apr 2018 22:57:58 -0500
changeset 802208 8d568f13019209d727e5ef0f777fe7d7ed27964b
parent 802207 9af1d77b0ec5d46be83c4afd4f30780a3f05f571
child 802209 ccf77791ff9327b69643ece08e810f7162110180
push id111850
push userbmo:tom@mozilla.com
push dateThu, 31 May 2018 16:41:37 +0000
reviewerslsalzman, jcristau
bugs1460357
milestone60.0.2
Bug 1460357 - Do not use optimized AVX for Skia convolve_vertically in MinGW. r=lsalzman, a=jcristau MozReview-Commit-ID: 8ROpiDD4xYH
gfx/skia/skia/src/opts/SkOpts_hsw.cpp
old mode 100644
new mode 100755
--- a/gfx/skia/skia/src/opts/SkOpts_hsw.cpp
+++ b/gfx/skia/skia/src/opts/SkOpts_hsw.cpp
@@ -7,17 +7,19 @@
 
 // It is not safe to #include any header file here unless it has been vetted for ODR safety:
 // all symbols used must be file-scoped static or in an anonymous namespace.  This applies
 // to _all_ header files:  C standard library, C++ standard library, Skia... everything.
 
 #include <immintrin.h>   // ODR safe
 #include <stdint.h>      // ODR safe
 
-#if defined(__AVX2__)
+// As described in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85525, MinGW will produce
+// unaligned instructions for this code, resulting in a crash.
+#if defined(__AVX2__) && !defined(__MINGW32__)
 
 namespace hsw {
 
     void convolve_vertically(const int16_t* filter, int filterLen,
                              uint8_t* const* srcRows, int width,
                              uint8_t* out, bool hasAlpha) {
         // It's simpler to work with the output array in terms of 4-byte pixels.
         auto dst = (int*)out;