Recover some float-related assembly on windows
BUG=aomedia:2968,aomedia:3098
Change-Id: Ieeef7bb07d27ab36e8ab6790fd71715562c4f802
diff --git a/aom_ports/aom_ports.cmake b/aom_ports/aom_ports.cmake
index 3ef1754..43b2b4d 100644
--- a/aom_ports/aom_ports.cmake
+++ b/aom_ports/aom_ports.cmake
@@ -20,6 +20,8 @@
"${AOM_ROOT}/aom_ports/mem_ops_aligned.h"
"${AOM_ROOT}/aom_ports/msvc.h" "${AOM_ROOT}/aom_ports/sanitizer.h")
+list(APPEND AOM_PORTS_ASM_X86 "${AOM_ROOT}/aom_ports/float.asm")
+
list(APPEND AOM_PORTS_INCLUDES_X86 "${AOM_ROOT}/aom_ports/x86_abi_support.asm")
list(APPEND AOM_PORTS_SOURCES_ARM "${AOM_ROOT}/aom_ports/arm.h"
@@ -41,7 +43,10 @@
#
# * The libaom target must exist before this function is called.
function(setup_aom_ports_targets)
- if("${AOM_TARGET_CPU}" MATCHES "arm")
+ if("${AOM_TARGET_CPU}" MATCHES "^x86")
+ add_asm_library("aom_ports" "AOM_PORTS_ASM_X86")
+ set(aom_ports_has_symbols 1)
+ elseif("${AOM_TARGET_CPU}" MATCHES "arm")
add_library(aom_ports OBJECT ${AOM_PORTS_SOURCES_ARM})
set(aom_ports_has_symbols 1)
elseif("${AOM_TARGET_CPU}" MATCHES "ppc")
@@ -59,6 +64,11 @@
if(aom_ports_has_symbols)
target_sources(aom_ports PRIVATE ${AOM_PORTS_INCLUDES})
+ if("${AOM_TARGET_CPU}" STREQUAL "x86"
+ OR "${AOM_TARGET_CPU}" STREQUAL "x86_64")
+ target_sources(aom_ports PRIVATE ${AOM_PORTS_INCLUDES_X86})
+ endif()
+
set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} PARENT_SCOPE)
else()
target_sources(aom PRIVATE ${AOM_PORTS_INCLUDES})
diff --git a/aom_ports/float.asm b/aom_ports/float.asm
new file mode 100644
index 0000000..abff60a
--- /dev/null
+++ b/aom_ports/float.asm
@@ -0,0 +1,33 @@
+;
+; Copyright (c) 2016, Alliance for Open Media. All rights reserved
+;
+; This source code is subject to the terms of the BSD 2 Clause License and
+; the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
+; was not distributed with this source code in the LICENSE file, you can
+; obtain it at www.aomedia.org/license/software. If the Alliance for Open
+; Media Patent License 1.0 was not distributed with this source code in the
+; PATENTS file, you can obtain it at www.aomedia.org/license/patent.
+;
+
+
+%include "aom_ports/x86_abi_support.asm"
+
+section .text
+%if LIBAOM_YASM_WIN64
+globalsym(aom_winx64_fldcw)
+sym(aom_winx64_fldcw):
+ sub rsp, 8
+ mov [rsp], rcx ; win x64 specific
+ fldcw [rsp]
+ add rsp, 8
+ ret
+
+
+globalsym(aom_winx64_fstcw)
+sym(aom_winx64_fstcw):
+ sub rsp, 8
+ fstcw [rsp]
+ mov rax, [rsp]
+ add rsp, 8
+ ret
+%endif