summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFritz Koenig <frkoenig@google.com>2010-09-14 15:46:37 -0700
committerFritz Koenig <frkoenig@google.com>2010-09-15 12:41:15 -0700
commit746439ef6c1dd2fedbe0c24ddb76d40cb9d26357 (patch)
treed45f2351114f9078b1ca07dbc85ddf507b9d9a23
parent769f2424ccce47c491913c38b06581aa777a53c0 (diff)
downloadlibvpx-746439ef6c1dd2fedbe0c24ddb76d40cb9d26357.tar
libvpx-746439ef6c1dd2fedbe0c24ddb76d40cb9d26357.tar.gz
libvpx-746439ef6c1dd2fedbe0c24ddb76d40cb9d26357.tar.bz2
libvpx-746439ef6c1dd2fedbe0c24ddb76d40cb9d26357.zip
Modify GET_GOT macro for performance.
GET_GOT was producing a zero length call. This resulted in pipeline flushes occuring when returing from the assembly functions. Masked on out of order cores, but evident on Atom cores. Change-Id: I8c375af313e8a169c77adbaf956693c0cfeb5ccd
-rw-r--r--vpx_ports/x86_abi_support.asm19
1 files changed, 13 insertions, 6 deletions
diff --git a/vpx_ports/x86_abi_support.asm b/vpx_ports/x86_abi_support.asm
index 5d85d8e2e..dc9e2d92c 100644
--- a/vpx_ports/x86_abi_support.asm
+++ b/vpx_ports/x86_abi_support.asm
@@ -90,7 +90,7 @@
%macro ALIGN_STACK 2
mov %2, rsp
and rsp, -%1
- sub rsp, %1 - REG_SZ_BYTES
+ lea rsp, [rsp - (%1 - REG_SZ_BYTES)]
push %2
%endmacro
@@ -105,7 +105,6 @@
%idefine XMMWORD
%idefine MMWORD
-
; PIC macros
;
%if ABI_IS_32BIT
@@ -116,9 +115,13 @@
extern _GLOBAL_OFFSET_TABLE_
push %1
call %%get_got
+ %%sub_offset:
+ jmp %%exitGG
%%get_got:
- pop %1
- add %1, _GLOBAL_OFFSET_TABLE_ + $$ - %%get_got wrt ..gotpc
+ mov %1, [esp]
+ add %1, _GLOBAL_OFFSET_TABLE_ + $$ - %%sub_offset wrt ..gotpc
+ ret
+ %%exitGG:
%undef GLOBAL
%define GLOBAL + %1 wrt ..gotoff
%undef RESTORE_GOT
@@ -128,9 +131,13 @@
%macro GET_GOT 1
push %1
call %%get_got
+ %%sub_offset:
+ jmp %%exitGG
%%get_got:
- pop %1
- add %1, fake_got - %%get_got
+ mov %1, [esp]
+ add %1, fake_got - %%sub_offset
+ ret
+ %%exitGG:
%undef GLOBAL
%define GLOBAL + %1 - fake_got
%undef RESTORE_GOT