use intrinsics for 'emms'
BUG=webm:1500 Change-Id: I3235d8c2abc01dd3a35e14c5cbcfe20283ff8fb2
This commit is contained in:
parent
c12398fe81
commit
118a57045b
@ -11,19 +11,13 @@
|
||||
#define TEST_CLEAR_SYSTEM_STATE_H_
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#if ARCH_X86 || ARCH_X86_64
|
||||
#include "vpx_ports/x86.h"
|
||||
#endif
|
||||
#include "vpx_ports/system_state.h"
|
||||
|
||||
namespace libvpx_test {
|
||||
|
||||
// Reset system to a known state. This function should be used for all non-API
|
||||
// test cases.
|
||||
inline void ClearSystemState() {
|
||||
#if ARCH_X86 || ARCH_X86_64
|
||||
vpx_reset_mmx_state();
|
||||
#endif
|
||||
}
|
||||
inline void ClearSystemState() { vpx_clear_system_state(); }
|
||||
|
||||
} // namespace libvpx_test
|
||||
#endif // TEST_CLEAR_SYSTEM_STATE_H_
|
||||
|
@ -12,11 +12,6 @@
|
||||
%include "vpx_ports/x86_abi_support.asm"
|
||||
|
||||
section .text
|
||||
global sym(vpx_reset_mmx_state) PRIVATE
|
||||
sym(vpx_reset_mmx_state):
|
||||
emms
|
||||
ret
|
||||
|
||||
|
||||
%if LIBVPX_YASM_WIN64
|
||||
global sym(vpx_winx64_fldcw) PRIVATE
|
||||
|
13
vpx_ports/emms_mmx.c
Normal file
13
vpx_ports/emms_mmx.c
Normal file
@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Copyright (c) 2018 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 <mmintrin.h>
|
||||
|
||||
void vpx_clear_system_state() { _mm_empty(); }
|
@ -13,10 +13,18 @@
|
||||
|
||||
#include "./vpx_config.h"
|
||||
|
||||
#if ARCH_X86 || ARCH_X86_64
|
||||
void vpx_reset_mmx_state(void);
|
||||
#define vpx_clear_system_state() vpx_reset_mmx_state()
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if HAVE_MMX
|
||||
extern void vpx_clear_system_state();
|
||||
#else
|
||||
#define vpx_clear_system_state()
|
||||
#endif // ARCH_X86 || ARCH_X86_64
|
||||
#endif // HAVE_MMX
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // VPX_PORTS_SYSTEM_STATE_H_
|
||||
|
@ -17,6 +17,8 @@ PORTS_SRCS-yes += msvc.h
|
||||
PORTS_SRCS-yes += system_state.h
|
||||
PORTS_SRCS-yes += vpx_timer.h
|
||||
|
||||
PORTS_SRCS-$(HAVE_MMX) += emms_mmx.c
|
||||
|
||||
ifeq ($(ARCH_X86)$(ARCH_X86_64),yes)
|
||||
PORTS_SRCS-yes += emms.asm
|
||||
PORTS_SRCS-yes += x86.h
|
||||
|
@ -317,8 +317,6 @@ static INLINE unsigned int x87_set_double_precision(void) {
|
||||
return mode;
|
||||
}
|
||||
|
||||
extern void vpx_reset_mmx_state(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user