diff options
author | Martin Storsjo <martin@martin.st> | 2018-03-23 12:48:42 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2018-03-23 19:57:46 +0000 |
commit | a6fdfda44c0c637b0c99bfa5e583bf691c58bca7 (patch) | |
tree | 70c162fed6e5aac92776d4724670be2ec61077b6 /vpx_ports | |
parent | 99e1784525d940ec9975261e352252f89f0694db (diff) | |
download | libvpx-a6fdfda44c0c637b0c99bfa5e583bf691c58bca7.tar libvpx-a6fdfda44c0c637b0c99bfa5e583bf691c58bca7.tar.gz libvpx-a6fdfda44c0c637b0c99bfa5e583bf691c58bca7.tar.bz2 libvpx-a6fdfda44c0c637b0c99bfa5e583bf691c58bca7.zip |
Restore emms usage on x86_64 after 726b021a12c1b
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
Diffstat (limited to 'vpx_ports')
-rw-r--r-- | vpx_ports/emms_mmx.asm | 18 | ||||
-rw-r--r-- | vpx_ports/system_state.h | 4 | ||||
-rw-r--r-- | vpx_ports/vpx_ports.mk | 4 |
3 files changed, 24 insertions, 2 deletions
diff --git a/vpx_ports/emms_mmx.asm b/vpx_ports/emms_mmx.asm new file mode 100644 index 000000000..9f33590a2 --- /dev/null +++ b/vpx_ports/emms_mmx.asm @@ -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 diff --git a/vpx_ports/system_state.h b/vpx_ports/system_state.h index 0a19c3cfc..72993782a 100644 --- a/vpx_ports/system_state.h +++ b/vpx_ports/system_state.h @@ -17,11 +17,11 @@ 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" diff --git a/vpx_ports/vpx_ports.mk b/vpx_ports/vpx_ports.mk index 9299fa0ca..aa9faf15e 100644 --- a/vpx_ports/vpx_ports.mk +++ b/vpx_ports/vpx_ports.mk @@ -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 |