]> git.sesse.net Git - x264/blob - common/x86/x86inc-64.asm
Update file headers throughout x264
[x264] / common / x86 / x86inc-64.asm
1 ;*****************************************************************************
2 ;* x86inc-64.asm: h264 encoder library
3 ;*****************************************************************************
4 ;* Copyright (C) 2005-2008 Loren Merritt <lorenm@u.washington.edu>
5 ;*
6 ;* This program is free software; you can redistribute it and/or modify
7 ;* it under the terms of the GNU General Public License as published by
8 ;* the Free Software Foundation; either version 2 of the License, or
9 ;* (at your option) any later version.
10 ;*
11 ;* This program is distributed in the hope that it will be useful,
12 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ;* GNU General Public License for more details.
15 ;*
16 ;* You should have received a copy of the GNU General Public License
17 ;* along with this program; if not, write to the Free Software
18 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
19 ;*****************************************************************************
20
21 BITS 64
22
23 ; FIXME: All of the 64bit asm functions that take a stride as an argument
24 ; via register, assume that the high dword of that register is filled with 0.
25 ; This is true in practice (since we never do any 64bit arithmetic on strides,
26 ; and x264's strides are all positive), but is not guaranteed by the ABI.
27
28 ; Name of the .rodata section. On OS X we cannot use .rodata because YASM
29 ; is unable to compute address offsets outside of .text so we use the .text
30 ; section instead until YASM is fixed.
31 %macro SECTION_RODATA 0
32     %ifidn __OUTPUT_FORMAT__,macho64
33       SECTION .text align=16
34     %else
35       SECTION .rodata align=16
36     %endif
37 %endmacro
38
39 ; PIC support macros. On x86_64 we just use RIP-relative addressing, which is
40 ; much simpler than the GOT handling we need to perform on x86.
41 ;
42 ; - GLOBAL should be used as a suffix for global addressing, eg.
43 ;     mov eax, [foo GLOBAL]
44 ;   instead of
45 ;     mov eax, [foo]
46 ;
47 %ifdef __PIC__
48     %define GLOBAL wrt rip
49     %define PIC64
50 %else
51     %define GLOBAL
52 %endif
53
54 %macro picgetgot 1
55 %endmacro