]> granicus.if.org Git - libvpx/commitdiff
Restore emms usage on x86_64 after 726b021a12c1b
authorMartin Storsjo <martin@martin.st>
Fri, 23 Mar 2018 10:48:42 +0000 (12:48 +0200)
committerMartin Storsjö <martin@martin.st>
Fri, 23 Mar 2018 19:57:46 +0000 (19:57 +0000)
Even on x86_64, emms has to be called if the x87 state has
been clobbered - the calling code (either within libvpx or
in a caller outside of libvpx) may be using the x87 instructions,
even though use of them isn't all that common on x86_64.

This fixes builds with clang for mingw/x86_64.

Change-Id: I1f6072835590b862bad156f17331ba65c813ddd9

test/register_state_check.h
vpx_ports/emms_mmx.asm [new file with mode: 0644]
vpx_ports/system_state.h
vpx_ports/vpx_ports.mk

index b1cb98335ce1a9132c4e5ed3403a804e544b0470..a779e5c06a5d5a5a95d46f0cd67570872dcb05da 100644 (file)
@@ -140,7 +140,7 @@ class RegisterStateCheck {};
 
 #endif  // _WIN64
 
-#if ARCH_X86
+#if ARCH_X86 || ARCH_X86_64
 #if defined(__GNUC__)
 
 namespace libvpx_test {
@@ -178,7 +178,7 @@ class RegisterStateCheckMMX {
 }  // namespace libvpx_test
 
 #endif  // __GNUC__
-#endif  // ARCH_X86
+#endif  // ARCH_X86 || ARCH_X86_64
 
 #ifndef API_REGISTER_STATE_CHECK
 #define API_REGISTER_STATE_CHECK ASM_REGISTER_STATE_CHECK
diff --git a/vpx_ports/emms_mmx.asm b/vpx_ports/emms_mmx.asm
new file mode 100644 (file)
index 0000000..9f33590
--- /dev/null
@@ -0,0 +1,18 @@
+;
+;  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+;
+;  Use of this source code is governed by a BSD-style license
+;  that can be found in the LICENSE file in the root of the source
+;  tree. An additional intellectual property rights grant can be found
+;  in the file PATENTS.  All contributing project authors may
+;  be found in the AUTHORS file in the root of the source tree.
+;
+
+
+%include "vpx_ports/x86_abi_support.asm"
+
+section .text
+global sym(vpx_clear_system_state) PRIVATE
+sym(vpx_clear_system_state):
+    emms
+    ret
index 0a19c3cfca165eaba2cc7ae59d53e301cf824fc9..72993782af4f6940b01306a35d58b09f5f5385c4 100644 (file)
 extern "C" {
 #endif
 
-#if ARCH_X86 && HAVE_MMX
+#if (ARCH_X86 || ARCH_X86_64) && HAVE_MMX
 extern void vpx_clear_system_state();
 #else
 #define vpx_clear_system_state()
-#endif  // ARCH_X86 && HAVE_MMX
+#endif  // (ARCH_X86 || ARCH_X86_64) && HAVE_MMX
 
 #ifdef __cplusplus
 }  // extern "C"
index 9299fa0ca2d84eb59e68ab0a5f965ec2183d0716..aa9faf15ecf279c30cd61d8c882fc83ed1010f53 100644 (file)
@@ -20,6 +20,10 @@ PORTS_SRCS-yes += vpx_timer.h
 ifeq ($(ARCH_X86),yes)
 PORTS_SRCS-$(HAVE_MMX) += emms_mmx.c
 endif
+ifeq ($(ARCH_X86_64),yes)
+# Visual Studio x64 does not support the _mm_empty() intrinsic.
+PORTS_SRCS-$(HAVE_MMX) += emms_mmx.asm
+endif
 
 ifeq ($(ARCH_X86_64),yes)
 PORTS_SRCS-$(CONFIG_MSVS) += float_control_word.asm