summaryrefslogtreecommitdiffstats
path: root/libvpx/third_party/x86inc/x86inc.asm
diff options
context:
space:
mode:
authorhkuang <hkuang@google.com>2013-11-07 15:50:31 -0800
committerhkuang <hkuang@google.com>2013-11-08 11:40:06 -0800
commit5ae7ac49f08a179e4f054d99fcfc9dce78d26e58 (patch)
tree0d891d2cbbac4c3da6fd15a25bf8797b29b31994 /libvpx/third_party/x86inc/x86inc.asm
parente6eeaaa14ccef4c0938fcce21c54979204041a30 (diff)
downloadandroid_external_libvpx-5ae7ac49f08a179e4f054d99fcfc9dce78d26e58.tar.gz
android_external_libvpx-5ae7ac49f08a179e4f054d99fcfc9dce78d26e58.tar.bz2
android_external_libvpx-5ae7ac49f08a179e4f054d99fcfc9dce78d26e58.zip
Roll latest libvpx into Android.
The lastest libvpx just added multithread tile decoding support. Checkout is from master: abdefeaa89a0908327518e5ca75c935c66b2e1aa Bug:11576718 Change-Id: Icbe5430633e179b8dc6d419e280ad7ebd3cad4a0
Diffstat (limited to 'libvpx/third_party/x86inc/x86inc.asm')
-rw-r--r--libvpx/third_party/x86inc/x86inc.asm90
1 files changed, 82 insertions, 8 deletions
diff --git a/libvpx/third_party/x86inc/x86inc.asm b/libvpx/third_party/x86inc/x86inc.asm
index a66a96b..9e4918a 100644
--- a/libvpx/third_party/x86inc/x86inc.asm
+++ b/libvpx/third_party/x86inc/x86inc.asm
@@ -97,21 +97,91 @@
%endif
%endmacro
-%if WIN64
+; PIC macros are copied from vpx_ports/x86_abi_support.asm. The "define PIC"
+; from original code is added in for 64bit.
+%ifidn __OUTPUT_FORMAT__,elf32
+%define ABI_IS_32BIT 1
+%elifidn __OUTPUT_FORMAT__,macho32
+%define ABI_IS_32BIT 1
+%elifidn __OUTPUT_FORMAT__,win32
+%define ABI_IS_32BIT 1
+%elifidn __OUTPUT_FORMAT__,aout
+%define ABI_IS_32BIT 1
+%else
+%define ABI_IS_32BIT 0
+%endif
+
+%if ABI_IS_32BIT
+ %if CONFIG_PIC=1
+ %ifidn __OUTPUT_FORMAT__,elf32
+ %define GET_GOT_SAVE_ARG 1
+ %define WRT_PLT wrt ..plt
+ %macro GET_GOT 1
+ extern _GLOBAL_OFFSET_TABLE_
+ push %1
+ call %%get_got
+ %%sub_offset:
+ jmp %%exitGG
+ %%get_got:
+ mov %1, [esp]
+ add %1, _GLOBAL_OFFSET_TABLE_ + $$ - %%sub_offset wrt ..gotpc
+ ret
+ %%exitGG:
+ %undef GLOBAL
+ %define GLOBAL(x) x + %1 wrt ..gotoff
+ %undef RESTORE_GOT
+ %define RESTORE_GOT pop %1
+ %endmacro
+ %elifidn __OUTPUT_FORMAT__,macho32
+ %define GET_GOT_SAVE_ARG 1
+ %macro GET_GOT 1
+ push %1
+ call %%get_got
+ %%get_got:
+ pop %1
+ %undef GLOBAL
+ %define GLOBAL(x) x + %1 - %%get_got
+ %undef RESTORE_GOT
+ %define RESTORE_GOT pop %1
+ %endmacro
+ %endif
+ %endif
+
+ %if ARCH_X86_64 == 0
+ %undef PIC
+ %endif
+
+%else
+ %macro GET_GOT 1
+ %endmacro
+ %define GLOBAL(x) rel x
+ %define WRT_PLT wrt ..plt
+
+ %if WIN64
%define PIC
-%elifidn __OUTPUT_FORMAT__,macho64
+ %elifidn __OUTPUT_FORMAT__,macho64
%define PIC
-%elif ARCH_X86_64 == 0
-; x86_32 doesn't require PIC.
-; Some distros prefer shared objects to be PIC, but nothing breaks if
-; the code contains a few textrels, so we'll skip that complexity.
- %undef PIC
-%elif CONFIG_PIC
+ %elif CONFIG_PIC
%define PIC
+ %endif
+%endif
+
+%ifnmacro GET_GOT
+ %macro GET_GOT 1
+ %endmacro
+ %define GLOBAL(x) x
+%endif
+%ifndef RESTORE_GOT
+%define RESTORE_GOT
%endif
+%ifndef WRT_PLT
+%define WRT_PLT
+%endif
+
%ifdef PIC
default rel
%endif
+; Done with PIC macros
; Always use long nops (reduces 0x90 spam in disassembly on x86_32)
%ifndef __NASM_VER__
@@ -528,6 +598,10 @@ DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14
global %1:function hidden
%elifidn __OUTPUT_FORMAT__,elf64
global %1:function hidden
+ %elifidn __OUTPUT_FORMAT__,macho32
+ global %1:private_extern
+ %elifidn __OUTPUT_FORMAT__,macho64
+ global %1:private_extern
%else
global %1
%endif