| Index: simd/jsimdext.inc
|
| diff --git a/simd/jsimdext.inc b/simd/jsimdext.inc
|
| index abb686354ba6d2ea29f21f89d87b48f7b8528bec..e1442de16fbf6eeab3fb0d49ce43d6b16568faed 100644
|
| --- a/simd/jsimdext.inc
|
| +++ b/simd/jsimdext.inc
|
| @@ -30,7 +30,7 @@
|
| ; ==========================================================================
|
| ; System-dependent configurations
|
|
|
| -%ifdef WIN32 ; ----(nasm -fwin32 -DWIN32 ...)--------
|
| +%ifdef WIN32 ; ----(nasm -fwin32 -DWIN32 ...)--------
|
| ; * Microsoft Visual C++
|
| ; * MinGW (Minimalist GNU for Windows)
|
| ; * CygWin
|
| @@ -46,7 +46,7 @@
|
| %define SEG_CONST .rdata align=16 public use32 class=CONST
|
| %endif
|
|
|
| -%elifdef WIN64 ; ----(nasm -fwin64 -DWIN64 ...)--------
|
| +%elifdef WIN64 ; ----(nasm -fwin64 -DWIN64 ...)--------
|
| ; * Microsoft Visual C++
|
|
|
| ; -- segment definition --
|
| @@ -58,24 +58,21 @@
|
| %define SEG_TEXT .text align=16 public use64 class=CODE
|
| %define SEG_CONST .rdata align=16 public use64 class=CONST
|
| %endif
|
| -%define EXTN(name) name ; foo() -> foo
|
| +%define EXTN(name) name ; foo() -> foo
|
|
|
| -%elifdef OBJ32 ; ----(nasm -fobj -DOBJ32 ...)----------
|
| +%elifdef OBJ32 ; ----(nasm -fobj -DOBJ32 ...)----------
|
| ; * Borland C++ (Win32)
|
|
|
| ; -- segment definition --
|
| ;
|
| -%define SEG_TEXT .text align=16 public use32 class=CODE
|
| -%define SEG_CONST .data align=16 public use32 class=DATA
|
| +%define SEG_TEXT _text align=16 public use32 class=CODE
|
| +%define SEG_CONST _data align=16 public use32 class=DATA
|
|
|
| -%elifdef ELF ; ----(nasm -felf[64] -DELF ...)------------
|
| +%elifdef ELF ; ----(nasm -felf[64] -DELF ...)------------
|
| ; * Linux
|
| ; * *BSD family Unix using elf format
|
| ; * Unix System V, including Solaris x86, UnixWare and SCO Unix
|
|
|
| -; PIC is the default on Linux
|
| -%define PIC
|
| -
|
| ; mark stack as non-executable
|
| section .note.GNU-stack noalloc noexec nowrite progbits
|
|
|
| @@ -91,10 +88,10 @@ section .note.GNU-stack noalloc noexec nowrite progbits
|
|
|
| ; To make the code position-independent, append -DPIC to the commandline
|
| ;
|
| -%define GOT_SYMBOL _GLOBAL_OFFSET_TABLE_ ; ELF supports PIC
|
| -%define EXTN(name) name ; foo() -> foo
|
| +%define GOT_SYMBOL _GLOBAL_OFFSET_TABLE_ ; ELF supports PIC
|
| +%define EXTN(name) name ; foo() -> foo
|
|
|
| -%elifdef AOUT ; ----(nasm -faoutb/aout -DAOUT ...)----
|
| +%elifdef AOUT ; ----(nasm -faoutb/aout -DAOUT ...)----
|
| ; * Older Linux using a.out format (nasm -f aout -DAOUT ...)
|
| ; * *BSD family Unix using a.out format (nasm -f aoutb -DAOUT ...)
|
|
|
| @@ -105,29 +102,29 @@ section .note.GNU-stack noalloc noexec nowrite progbits
|
|
|
| ; To make the code position-independent, append -DPIC to the commandline
|
| ;
|
| -%define GOT_SYMBOL __GLOBAL_OFFSET_TABLE_ ; BSD-style a.out supports PIC
|
| +%define GOT_SYMBOL __GLOBAL_OFFSET_TABLE_ ; BSD-style a.out supports PIC
|
|
|
| -%elifdef MACHO ; ----(nasm -fmacho -DMACHO ...)--------
|
| +%elifdef MACHO ; ----(nasm -fmacho -DMACHO ...)--------
|
| ; * NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X (Mach-O format)
|
|
|
| ; -- segment definition --
|
| ;
|
| -%define SEG_TEXT .text ;align=16 ; nasm doesn't accept align=16. why?
|
| +%define SEG_TEXT .text ;align=16 ; nasm doesn't accept align=16. why?
|
| %define SEG_CONST .rodata align=16
|
|
|
| ; The generation of position-independent code (PIC) is the default on Darwin.
|
| ;
|
| %define PIC
|
| -%define GOT_SYMBOL _MACHO_PIC_ ; Mach-O style code-relative addressing
|
| +%define GOT_SYMBOL _MACHO_PIC_ ; Mach-O style code-relative addressing
|
|
|
| -%else ; ----(Other case)----------------------
|
| +%else ; ----(Other case)----------------------
|
|
|
| ; -- segment definition --
|
| ;
|
| %define SEG_TEXT .text
|
| %define SEG_CONST .data
|
|
|
| -%endif ; ----------------------------------------------
|
| +%endif ; ----------------------------------------------
|
|
|
| ; ==========================================================================
|
|
|
| @@ -182,7 +179,7 @@ section .note.GNU-stack noalloc noexec nowrite progbits
|
| ; External Symbol Name
|
| ;
|
| %ifndef EXTN
|
| -%define EXTN(name) _ %+ name ; foo() -> _foo
|
| +%define EXTN(name) _ %+ name ; foo() -> _foo
|
| %endif
|
|
|
| ; --------------------------------------------------------------------------
|
| @@ -199,79 +196,79 @@ section .note.GNU-stack noalloc noexec nowrite progbits
|
| ; At present, nasm doesn't seem to support PIC generation for Mach-O.
|
| ; The PIC support code below is a little tricky.
|
|
|
| - SECTION SEG_CONST
|
| + SECTION SEG_CONST
|
| const_base:
|
|
|
| %define GOTOFF(got,sym) (got) + (sym) - const_base
|
|
|
| -%imacro get_GOT 1
|
| - ; NOTE: this macro destroys ecx resister.
|
| - call %%geteip
|
| - add ecx, byte (%%ref - $)
|
| - jmp short %%adjust
|
| +%imacro get_GOT 1
|
| + ; NOTE: this macro destroys ecx resister.
|
| + call %%geteip
|
| + add ecx, byte (%%ref - $)
|
| + jmp short %%adjust
|
| %%geteip:
|
| - mov ecx, POINTER [esp]
|
| - ret
|
| + mov ecx, POINTER [esp]
|
| + ret
|
| %%adjust:
|
| - push ebp
|
| - xor ebp,ebp ; ebp = 0
|
| -%ifidni %1,ebx ; (%1 == ebx)
|
| - ; db 0x8D,0x9C + jmp near const_base =
|
| - ; lea ebx, [ecx+ebp*8+(const_base-%%ref)] ; 8D,9C,E9,(offset32)
|
| - db 0x8D,0x9C ; 8D,9C
|
| - jmp near const_base ; E9,(const_base-%%ref)
|
| + push ebp
|
| + xor ebp,ebp ; ebp = 0
|
| +%ifidni %1,ebx ; (%1 == ebx)
|
| + ; db 0x8D,0x9C + jmp near const_base =
|
| + ; lea ebx, [ecx+ebp*8+(const_base-%%ref)] ; 8D,9C,E9,(offset32)
|
| + db 0x8D,0x9C ; 8D,9C
|
| + jmp near const_base ; E9,(const_base-%%ref)
|
| %%ref:
|
| %else ; (%1 != ebx)
|
| - ; db 0x8D,0x8C + jmp near const_base =
|
| - ; lea ecx, [ecx+ebp*8+(const_base-%%ref)] ; 8D,8C,E9,(offset32)
|
| - db 0x8D,0x8C ; 8D,8C
|
| - jmp near const_base ; E9,(const_base-%%ref)
|
| -%%ref: mov %1, ecx
|
| + ; db 0x8D,0x8C + jmp near const_base =
|
| + ; lea ecx, [ecx+ebp*8+(const_base-%%ref)] ; 8D,8C,E9,(offset32)
|
| + db 0x8D,0x8C ; 8D,8C
|
| + jmp near const_base ; E9,(const_base-%%ref)
|
| +%%ref: mov %1, ecx
|
| %endif ; (%1 == ebx)
|
| - pop ebp
|
| + pop ebp
|
| %endmacro
|
|
|
| -%else ; GOT_SYMBOL != _MACHO_PIC_ ----------------
|
| +%else ; GOT_SYMBOL != _MACHO_PIC_ ----------------
|
|
|
| %define GOTOFF(got,sym) (got) + (sym) wrt ..gotoff
|
|
|
| -%imacro get_GOT 1
|
| - extern GOT_SYMBOL
|
| - call %%geteip
|
| - add %1, GOT_SYMBOL + $$ - $ wrt ..gotpc
|
| - jmp short %%done
|
| +%imacro get_GOT 1
|
| + extern GOT_SYMBOL
|
| + call %%geteip
|
| + add %1, GOT_SYMBOL + $$ - $ wrt ..gotpc
|
| + jmp short %%done
|
| %%geteip:
|
| - mov %1, POINTER [esp]
|
| - ret
|
| + mov %1, POINTER [esp]
|
| + ret
|
| %%done:
|
| %endmacro
|
|
|
| -%endif ; GOT_SYMBOL == _MACHO_PIC_ ----------------
|
| +%endif ; GOT_SYMBOL == _MACHO_PIC_ ----------------
|
|
|
| -%imacro pushpic 1.nolist
|
| - push %1
|
| +%imacro pushpic 1.nolist
|
| + push %1
|
| %endmacro
|
| -%imacro poppic 1.nolist
|
| - pop %1
|
| +%imacro poppic 1.nolist
|
| + pop %1
|
| %endmacro
|
| -%imacro movpic 2.nolist
|
| - mov %1,%2
|
| +%imacro movpic 2.nolist
|
| + mov %1,%2
|
| %endmacro
|
|
|
| -%else ; !PIC -----------------------------------------
|
| +%else ; !PIC -----------------------------------------
|
|
|
| %define GOTOFF(got,sym) (sym)
|
|
|
| -%imacro get_GOT 1.nolist
|
| +%imacro get_GOT 1.nolist
|
| %endmacro
|
| -%imacro pushpic 1.nolist
|
| +%imacro pushpic 1.nolist
|
| %endmacro
|
| -%imacro poppic 1.nolist
|
| +%imacro poppic 1.nolist
|
| %endmacro
|
| -%imacro movpic 2.nolist
|
| +%imacro movpic 2.nolist
|
| %endmacro
|
|
|
| -%endif ; PIC -----------------------------------------
|
| +%endif ; PIC -----------------------------------------
|
|
|
| ; --------------------------------------------------------------------------
|
| ; Align the next instruction on {2,4,8,16,..}-byte boundary.
|
| @@ -281,28 +278,28 @@ const_base:
|
| %define FILLB(b,n) (($$-(b)) & ((n)-1))
|
|
|
| %imacro alignx 1-2.nolist 0xFFFF
|
| -%%bs: times MSKLE(FILLB(%%bs,%1),%2) & MSKLE(16,FILLB($,%1)) & FILLB($,%1) \
|
| - db 0x90 ; nop
|
| - times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/9 \
|
| - db 0x8D,0x9C,0x23,0x00,0x00,0x00,0x00 ; lea ebx,[ebx+0x00000000]
|
| - times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/7 \
|
| - db 0x8D,0xAC,0x25,0x00,0x00,0x00,0x00 ; lea ebp,[ebp+0x00000000]
|
| - times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/6 \
|
| - db 0x8D,0xAD,0x00,0x00,0x00,0x00 ; lea ebp,[ebp+0x00000000]
|
| - times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/4 \
|
| - db 0x8D,0x6C,0x25,0x00 ; lea ebp,[ebp+0x00]
|
| - times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/3 \
|
| - db 0x8D,0x6D,0x00 ; lea ebp,[ebp+0x00]
|
| - times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/2 \
|
| - db 0x8B,0xED ; mov ebp,ebp
|
| - times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/1 \
|
| - db 0x90 ; nop
|
| +%%bs: times MSKLE(FILLB(%%bs,%1),%2) & MSKLE(16,FILLB($,%1)) & FILLB($,%1) \
|
| + db 0x90 ; nop
|
| + times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/9 \
|
| + db 0x8D,0x9C,0x23,0x00,0x00,0x00,0x00 ; lea ebx,[ebx+0x00000000]
|
| + times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/7 \
|
| + db 0x8D,0xAC,0x25,0x00,0x00,0x00,0x00 ; lea ebp,[ebp+0x00000000]
|
| + times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/6 \
|
| + db 0x8D,0xAD,0x00,0x00,0x00,0x00 ; lea ebp,[ebp+0x00000000]
|
| + times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/4 \
|
| + db 0x8D,0x6C,0x25,0x00 ; lea ebp,[ebp+0x00]
|
| + times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/3 \
|
| + db 0x8D,0x6D,0x00 ; lea ebp,[ebp+0x00]
|
| + times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/2 \
|
| + db 0x8B,0xED ; mov ebp,ebp
|
| + times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/1 \
|
| + db 0x90 ; nop
|
| %endmacro
|
|
|
| ; Align the next data on {2,4,8,16,..}-byte boundary.
|
| ;
|
| %imacro alignz 1.nolist
|
| - align %1, db 0 ; filling zeros
|
| + align %1, db 0 ; filling zeros
|
| %endmacro
|
|
|
| %ifdef __x86_64__
|
| @@ -310,61 +307,61 @@ const_base:
|
| %ifdef WIN64
|
|
|
| %imacro collect_args 0
|
| - push r12
|
| - push r13
|
| - push r14
|
| - push r15
|
| - mov r10, rcx
|
| - mov r11, rdx
|
| - mov r12, r8
|
| - mov r13, r9
|
| - mov r14, [rax+48]
|
| - mov r15, [rax+56]
|
| - push rsi
|
| - push rdi
|
| - sub rsp, SIZEOF_XMMWORD
|
| - movaps XMMWORD [rsp], xmm6
|
| - sub rsp, SIZEOF_XMMWORD
|
| - movaps XMMWORD [rsp], xmm7
|
| + push r12
|
| + push r13
|
| + push r14
|
| + push r15
|
| + mov r10, rcx
|
| + mov r11, rdx
|
| + mov r12, r8
|
| + mov r13, r9
|
| + mov r14, [rax+48]
|
| + mov r15, [rax+56]
|
| + push rsi
|
| + push rdi
|
| + sub rsp, SIZEOF_XMMWORD
|
| + movaps XMMWORD [rsp], xmm6
|
| + sub rsp, SIZEOF_XMMWORD
|
| + movaps XMMWORD [rsp], xmm7
|
| %endmacro
|
|
|
| %imacro uncollect_args 0
|
| - movaps xmm7, XMMWORD [rsp]
|
| - add rsp, SIZEOF_XMMWORD
|
| - movaps xmm6, XMMWORD [rsp]
|
| - add rsp, SIZEOF_XMMWORD
|
| - pop rdi
|
| - pop rsi
|
| - pop r15
|
| - pop r14
|
| - pop r13
|
| - pop r12
|
| + movaps xmm7, XMMWORD [rsp]
|
| + add rsp, SIZEOF_XMMWORD
|
| + movaps xmm6, XMMWORD [rsp]
|
| + add rsp, SIZEOF_XMMWORD
|
| + pop rdi
|
| + pop rsi
|
| + pop r15
|
| + pop r14
|
| + pop r13
|
| + pop r12
|
| %endmacro
|
|
|
| %else
|
|
|
| %imacro collect_args 0
|
| - push r10
|
| - push r11
|
| - push r12
|
| - push r13
|
| - push r14
|
| - push r15
|
| - mov r10, rdi
|
| - mov r11, rsi
|
| - mov r12, rdx
|
| - mov r13, rcx
|
| - mov r14, r8
|
| - mov r15, r9
|
| + push r10
|
| + push r11
|
| + push r12
|
| + push r13
|
| + push r14
|
| + push r15
|
| + mov r10, rdi
|
| + mov r11, rsi
|
| + mov r12, rdx
|
| + mov r13, rcx
|
| + mov r14, r8
|
| + mov r15, r9
|
| %endmacro
|
|
|
| %imacro uncollect_args 0
|
| - pop r15
|
| - pop r14
|
| - pop r13
|
| - pop r12
|
| - pop r11
|
| - pop r10
|
| + pop r15
|
| + pop r14
|
| + pop r13
|
| + pop r12
|
| + pop r11
|
| + pop r10
|
| %endmacro
|
|
|
| %endif
|
| @@ -376,14 +373,4 @@ const_base:
|
| ;
|
| %include "jsimdcfg.inc"
|
|
|
| -; Begin chromium edits
|
| -%ifdef MACHO ; ----(nasm -fmacho -DMACHO ...)--------
|
| -%define PRIVATE :private_extern
|
| -%elifdef ELF ; ----(nasm -felf[64] -DELF ...)------------
|
| -%define PRIVATE :hidden
|
| -%else
|
| -%define PRIVATE
|
| -%endif
|
| -; End chromium edits
|
| -
|
| ; --------------------------------------------------------------------------
|
|
|