Bug 1481512 - limit libvorbis x86-64 assembly to x86-64 windows; r=padenot
authorNathan Froyd <froydnj@mozilla.com>
Thu, 30 Aug 2018 13:00:36 -0400
changeset 482422 eb7f2727ad4fea4fa2e9e5a854f6e25672faec69
parent 482395 8a2005a771b3683c6457df492cde2f90d2ed82c8
child 482423 baccdb95340e7e84b741836cc83a155ca2c8a310
push id232
push userfmarier@mozilla.com
push dateWed, 05 Sep 2018 20:45:54 +0000
reviewerspadenot
bugs1481512
milestone63.0a1
Bug 1481512 - limit libvorbis x86-64 assembly to x86-64 windows; r=padenot ...rather than all 64-bit Windows implementations.
media/libvorbis/aarch64-win.patch
media/libvorbis/lib/os.h
media/libvorbis/update.sh
new file mode 100644
--- /dev/null
+++ b/media/libvorbis/aarch64-win.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/os.h b/lib/os.h
+index 416a401..44d54fe 100644
+--- a/lib/os.h
++++ b/lib/os.h
+@@ -147,7 +147,7 @@ static __inline void vorbis_fpu_restore(vorbis_fpu_control fpu){
+ 
+ /* Optimized code path for x86_64 builds. Uses SSE2 intrinsics. This can be
+    done safely because all x86_64 CPUs supports SSE2. */
+-#if (defined(_MSC_VER) && defined(_WIN64)) || (defined(__GNUC__) && defined (__x86_64__))
++#if (defined(_MSC_VER) && defined(_M_X64)) || (defined(__GNUC__) && defined (__x86_64__))
+ #  define VORBIS_FPU_CONTROL
+ 
+ typedef ogg_int16_t vorbis_fpu_control;
--- a/media/libvorbis/lib/os.h
+++ b/media/libvorbis/lib/os.h
@@ -142,17 +142,17 @@ static __inline void vorbis_fpu_restore(
   (void)fpu;
 }
 
 #endif /* Special MSVC 32 bit implementation */
 
 
 /* Optimized code path for x86_64 builds. Uses SSE2 intrinsics. This can be
    done safely because all x86_64 CPUs supports SSE2. */
-#if (defined(_MSC_VER) && defined(_WIN64)) || (defined(__GNUC__) && defined (__x86_64__))
+#if (defined(_MSC_VER) && defined(_M_X64)) || (defined(__GNUC__) && defined (__x86_64__))
 #  define VORBIS_FPU_CONTROL
 
 typedef ogg_int16_t vorbis_fpu_control;
 
 #include <emmintrin.h>
 static __inline int vorbis_ftoi(double f){
         return _mm_cvtsd_si32(_mm_load_sd(&f));
 }
--- a/media/libvorbis/update.sh
+++ b/media/libvorbis/update.sh
@@ -79,9 +79,9 @@ mkdir -p ./lib/books/coupled
 mkdir -p ./lib/books/floor
 mkdir -p ./lib/books/uncoupled
 cp $1/lib/books/coupled/res_books_stereo.h ./lib/books/coupled/
 cp $1/lib/books/coupled/res_books_51.h ./lib/books/coupled/
 cp $1/lib/books/floor/floor_books.h ./lib/books/floor/
 cp $1/lib/books/uncoupled/res_books_uncoupled.h ./lib/books/uncoupled/
 
 # Add any patches against upstream here.
-# ...nothing to apply...
+patch -p1 < ./aarch64-win.patch