From 7913e79a7e6320ed3805958eb6fc7e8dfdab8ac6 Mon Sep 17 00:00:00 2001 From: Makoto Kato Date: Wed, 9 Jun 2010 20:18:51 +0900 Subject: [PATCH] Bug 570882 - Need assembler optimization for VPX on Windows x64. r=cpearce --- configure.in | 9 ++- media/libvpx/Makefile.in | 2 + media/libvpx/vpx_config.asm | 2 + media/libvpx/vpx_config.h | 4 ++ media/libvpx/vpx_config_c.c | 3 + media/libvpx/vpx_config_x86_64-win64-vs8.asm | 61 ++++++++++++++++++ media/libvpx/vpx_config_x86_64-win64-vs8.c | 2 + media/libvpx/vpx_config_x86_64-win64-vs8.h | 65 ++++++++++++++++++++ 8 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 media/libvpx/vpx_config_x86_64-win64-vs8.asm create mode 100644 media/libvpx/vpx_config_x86_64-win64-vs8.c create mode 100644 media/libvpx/vpx_config_x86_64-win64-vs8.h diff --git a/configure.in b/configure.in index 9dba3e82f0e..91252ae5364 100644 --- a/configure.in +++ b/configure.in @@ -5915,7 +5915,8 @@ if test -n "$MOZ_WEBM"; then fi else - dnl For Darwin x86, Darwin x86_64, and Linux x86 we can use YASM. + dnl For Darwin x86, Darwin x86_64, Linux x86, and WINNT x86_64 + dhl we can use YASM. AC_MSG_CHECKING([for YASM assembler]) AC_CHECK_PROGS(VPX_AS, yasm, "") if test -n "$VPX_AS"; then @@ -5933,9 +5934,13 @@ if test -n "$MOZ_WEBM"; then VPX_ASFLAGS="-f macho64 -rnasm -pnasm -DPIC" VPX_X86_ASM=1 ;; + WINNT:x86_64) + VPX_ASFLAGS="-f x64 -rnasm -pnasm" + VPX_X86_ASM=1 + ;; esac fi # end have YASM - fi # end !WINNT + fi # end !WINNT_x86_MSVC if test -n "$VPX_X86_ASM"; then AC_DEFINE(VPX_X86_ASM) diff --git a/media/libvpx/Makefile.in b/media/libvpx/Makefile.in index f45a99f81c3..f73acfb2023 100644 --- a/media/libvpx/Makefile.in +++ b/media/libvpx/Makefile.in @@ -192,10 +192,12 @@ ASFILES += \ $(NULL) ifeq ($(OS_ARCH),WINNT) +ifneq ($(OS_TEST),x86_64) ASFILES += \ safeseh.asm \ $(NULL) endif +endif endif diff --git a/media/libvpx/vpx_config.asm b/media/libvpx/vpx_config.asm index 6a9597ba977..53447025508 100644 --- a/media/libvpx/vpx_config.asm +++ b/media/libvpx/vpx_config.asm @@ -6,4 +6,6 @@ %include "vpx_config_x86_64-darwin9-gcc.asm" %elifidn __OUTPUT_FORMAT__,win32 %include "vpx_config_x86-win32-vs8.asm" +%elifidn __OUTPUT_FORMAT__,x64 +%include "vpx_config_x86_64-win64-vs8.asm" %endif diff --git a/media/libvpx/vpx_config.h b/media/libvpx/vpx_config.h index 583486dce7b..25e9cdb930b 100644 --- a/media/libvpx/vpx_config.h +++ b/media/libvpx/vpx_config.h @@ -16,6 +16,10 @@ /* 32 bit Linux. */ #include "vpx_config_x86-linux-gcc.h" +#elif defined(_MSC_VER) && defined(_M_X64) +/* 64 bit Windows */ +#include "vpx_config_x86_64-win64-vs8.h" + #else #error VPX_X86_ASM is defined, but assembly not supported on this platform! #endif diff --git a/media/libvpx/vpx_config_c.c b/media/libvpx/vpx_config_c.c index 3206380ce7d..9b023e87d47 100644 --- a/media/libvpx/vpx_config_c.c +++ b/media/libvpx/vpx_config_c.c @@ -16,6 +16,9 @@ /* 32 bit Linux. */ #include "vpx_config_x86-linux-gcc.c" +#elif defined(_MSC_VER) && defined(_M_X64) +#include "vpx_config_x86_64-win64-vs8.c" + #else #error VPX_X86_ASM is defined, but assembly not supported on this platform! #endif diff --git a/media/libvpx/vpx_config_x86_64-win64-vs8.asm b/media/libvpx/vpx_config_x86_64-win64-vs8.asm new file mode 100644 index 00000000000..b1c381e0037 --- /dev/null +++ b/media/libvpx/vpx_config_x86_64-win64-vs8.asm @@ -0,0 +1,61 @@ +ARCH_ARM equ 0 +ARCH_MIPS equ 0 +ARCH_X86 equ 0 +ARCH_X86_64 equ 1 +ARCH_PPC32 equ 0 +ARCH_PPC64 equ 0 +HAVE_ARMV5TE equ 0 +HAVE_ARMV6 equ 0 +HAVE_ARMV7 equ 0 +HAVE_IWMMXT equ 0 +HAVE_IWMMXT2 equ 0 +HAVE_MIPS32 equ 0 +HAVE_MMX equ 1 +HAVE_SSE equ 1 +HAVE_SSE2 equ 1 +HAVE_SSE3 equ 1 +HAVE_SSSE3 equ 1 +HAVE_ALTIVEC equ 0 +HAVE_VPX_PORTS equ 1 +HAVE_STDINT_H equ 0 +HAVE_ALT_TREE_LAYOUT equ 0 +HAVE_PTHREAD_H equ 0 +HAVE_SYS_MMAN_H equ 0 +CONFIG_EXTERNAL_BUILD equ 1 +CONFIG_INSTALL_DOCS equ 0 +CONFIG_INSTALL_BINS equ 1 +CONFIG_INSTALL_LIBS equ 1 +CONFIG_INSTALL_SRCS equ 0 +CONFIG_DEBUG equ 0 +CONFIG_GPROF equ 0 +CONFIG_GCOV equ 0 +CONFIG_RVCT equ 0 +CONFIG_GCC equ 0 +CONFIG_MSVS equ 1 +CONFIG_PIC equ 0 +CONFIG_BIG_ENDIAN equ 0 +CONFIG_CODEC_SRCS equ 0 +CONFIG_DEBUG_LIBS equ 0 +CONFIG_FAST_UNALIGNED equ 1 +CONFIG_MEM_MANAGER equ 0 +CONFIG_MEM_TRACKER equ 0 +CONFIG_MEM_CHECKS equ 0 +CONFIG_MD5 equ 1 +CONFIG_DEQUANT_TOKENS equ 0 +CONFIG_DC_RECON equ 0 +CONFIG_NEW_TOKENS equ 0 +CONFIG_EVAL_LIMIT equ 0 +CONFIG_RUNTIME_CPU_DETECT equ 1 +CONFIG_POSTPROC equ 1 +CONFIG_POSTPROC_GENERIC equ 0 +CONFIG_MULTITHREAD equ 1 +CONFIG_PSNR equ 0 +CONFIG_VP8_ENCODER equ 0 +CONFIG_VP8_DECODER equ 1 +CONFIG_VP8 equ 1 +CONFIG_ENCODERS equ 0 +CONFIG_DECODERS equ 1 +CONFIG_STATIC_MSVCRT equ 0 +CONFIG_SPATIAL_RESAMPLING equ 1 +CONFIG_REALTIME_ONLY equ 0 +CONFIG_SHARED equ 0 diff --git a/media/libvpx/vpx_config_x86_64-win64-vs8.c b/media/libvpx/vpx_config_x86_64-win64-vs8.c new file mode 100644 index 00000000000..a13c649a91c --- /dev/null +++ b/media/libvpx/vpx_config_x86_64-win64-vs8.c @@ -0,0 +1,2 @@ +static const char* const cfg = "--target=x86_64-win64-vs8 --disable-vp8-encoder --disable-examples --disable-install-docs"; +const char *vpx_codec_build_config(void) {return cfg;} diff --git a/media/libvpx/vpx_config_x86_64-win64-vs8.h b/media/libvpx/vpx_config_x86_64-win64-vs8.h new file mode 100644 index 00000000000..06b32fb875f --- /dev/null +++ b/media/libvpx/vpx_config_x86_64-win64-vs8.h @@ -0,0 +1,65 @@ +/* This file automatically generated by configure. Do not edit! */ +#define INLINE __inline +#define FORCEINLINE __forceinline +#define RESTRICT +#define ARCH_ARM 0 +#define ARCH_MIPS 0 +#define ARCH_X86 0 +#define ARCH_X86_64 1 +#define ARCH_PPC32 0 +#define ARCH_PPC64 0 +#define HAVE_ARMV5TE 0 +#define HAVE_ARMV6 0 +#define HAVE_ARMV7 0 +#define HAVE_IWMMXT 0 +#define HAVE_IWMMXT2 0 +#define HAVE_MIPS32 0 +#define HAVE_MMX 1 +#define HAVE_SSE 1 +#define HAVE_SSE2 1 +#define HAVE_SSE3 1 +#define HAVE_SSSE3 1 +#define HAVE_ALTIVEC 0 +#define HAVE_VPX_PORTS 1 +#define HAVE_STDINT_H 0 +#define HAVE_ALT_TREE_LAYOUT 0 +#define HAVE_PTHREAD_H 0 +#define HAVE_SYS_MMAN_H 0 +#define CONFIG_EXTERNAL_BUILD 1 +#define CONFIG_INSTALL_DOCS 0 +#define CONFIG_INSTALL_BINS 1 +#define CONFIG_INSTALL_LIBS 1 +#define CONFIG_INSTALL_SRCS 0 +#define CONFIG_DEBUG 0 +#define CONFIG_GPROF 0 +#define CONFIG_GCOV 0 +#define CONFIG_RVCT 0 +#define CONFIG_GCC 0 +#define CONFIG_MSVS 1 +#define CONFIG_PIC 0 +#define CONFIG_BIG_ENDIAN 0 +#define CONFIG_CODEC_SRCS 0 +#define CONFIG_DEBUG_LIBS 0 +#define CONFIG_FAST_UNALIGNED 1 +#define CONFIG_MEM_MANAGER 0 +#define CONFIG_MEM_TRACKER 0 +#define CONFIG_MEM_CHECKS 0 +#define CONFIG_MD5 1 +#define CONFIG_DEQUANT_TOKENS 0 +#define CONFIG_DC_RECON 0 +#define CONFIG_NEW_TOKENS 0 +#define CONFIG_EVAL_LIMIT 0 +#define CONFIG_RUNTIME_CPU_DETECT 1 +#define CONFIG_POSTPROC 1 +#define CONFIG_POSTPROC_GENERIC 0 +#define CONFIG_MULTITHREAD 1 +#define CONFIG_PSNR 0 +#define CONFIG_VP8_ENCODER 0 +#define CONFIG_VP8_DECODER 1 +#define CONFIG_VP8 1 +#define CONFIG_ENCODERS 0 +#define CONFIG_DECODERS 1 +#define CONFIG_STATIC_MSVCRT 0 +#define CONFIG_SPATIAL_RESAMPLING 1 +#define CONFIG_REALTIME_ONLY 0 +#define CONFIG_SHARED 0