github.com/aergoio/aergo@v1.3.1/libtool/src/gmp-6.1.2/mpn/x86_64/dos64.m4 (about)

     1  divert(-1)
     2  dnl  Copyright 2011-2013 Free Software Foundation, Inc.
     3  
     4  dnl  This file is part of the GNU MP Library.
     5  dnl
     6  dnl  The GNU MP Library is free software; you can redistribute it and/or modify
     7  dnl  it under the terms of either:
     8  dnl
     9  dnl    * the GNU Lesser General Public License as published by the Free
    10  dnl      Software Foundation; either version 3 of the License, or (at your
    11  dnl      option) any later version.
    12  dnl
    13  dnl  or
    14  dnl
    15  dnl    * the GNU General Public License as published by the Free Software
    16  dnl      Foundation; either version 2 of the License, or (at your option) any
    17  dnl      later version.
    18  dnl
    19  dnl  or both in parallel, as here.
    20  dnl
    21  dnl  The GNU MP Library is distributed in the hope that it will be useful, but
    22  dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    23  dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    24  dnl  for more details.
    25  dnl
    26  dnl  You should have received copies of the GNU General Public License and the
    27  dnl  GNU Lesser General Public License along with the GNU MP Library.  If not,
    28  dnl  see https://www.gnu.org/licenses/.
    29  
    30  define(`HOST_DOS64')
    31  
    32  
    33  dnl  On DOS64 we always generate position-independent-code
    34  dnl
    35  
    36  define(`PIC')
    37  
    38  
    39  define(`LEA',`
    40  	lea	$1(%rip), $2
    41  ')
    42  
    43  
    44  dnl  Usage: CALL(funcname)
    45  dnl
    46  dnl  Simply override the definition in x86_64-defs.m4.
    47  
    48  define(`CALL',`call	GSYM_PREFIX`'$1')
    49  
    50  
    51  dnl  Usage: JUMPTABSECT
    52  
    53  define(`JUMPTABSECT', `RODATA')
    54  
    55  
    56  dnl  Usage: JMPENT(targlabel,tablabel)
    57  
    58  define(`JMPENT', `.long	$1-$2')
    59  
    60  
    61  dnl  Usage: FUNC_ENTRY(nregparmas)
    62  dnl  Usage: FUNC_EXIT()
    63  
    64  dnl  FUNC_ENTRY and FUNC_EXIT provide an easy path for adoption of standard
    65  dnl  ABI assembly to the DOS64 ABI.
    66  
    67  define(`FUNC_ENTRY',
    68  	`push	%rdi
    69  	push	%rsi
    70  	mov	%rcx, %rdi
    71  ifelse(eval($1>=2),1,`dnl
    72  	mov	%rdx, %rsi
    73  ifelse(eval($1>=3),1,`dnl
    74  	mov	%r8, %rdx
    75  ifelse(eval($1>=4),1,`dnl
    76  	mov	%r9, %rcx
    77  ')')')')
    78  
    79  define(`FUNC_EXIT',
    80  	`pop	%rsi
    81  	pop	%rdi')
    82  
    83  
    84  dnl  Target ABI macros.  For DOS64 we override the defaults.
    85  
    86  define(`IFDOS',   `$1')
    87  define(`IFSTD',   `')
    88  define(`IFELF',   `')
    89  
    90  
    91  dnl  Usage: PROTECT(symbol)
    92  dnl
    93  dnl  Used for private GMP symbols that should never be overridden by users.
    94  dnl  This can save reloc entries and improve shlib sharing as well as
    95  dnl  application startup times
    96  
    97  define(`PROTECT',  `')
    98  
    99  
   100  divert`'dnl