xref: /netbsd-src/external/lgpl3/gmp/dist/mpn/x86_64/darwin.m4 (revision 8450a7c42673d65e3b1f6560d3b6ecd317a6cbe8)
1divert(-1)
2dnl  Copyright 2008, 2011, 2012 Free Software Foundation, Inc.
3dnl
4dnl  This file is part of the GNU MP Library.
5
6dnl  The GNU MP Library is free software; you can redistribute it and/or modify
7dnl  it under the terms of the GNU Lesser General Public License as published
8dnl  by the Free Software Foundation; either version 3 of the License, or (at
9dnl  your option) any later version.
10
11dnl  The GNU MP Library is distributed in the hope that it will be useful, but
12dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14dnl  License for more details.
15
16dnl  You should have received a copy of the GNU Lesser General Public License
17dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
18
19define(`DARWIN')
20
21define(`LEA',`dnl
22ifdef(`PIC',
23	`lea	$1(%rip), $2'
24,
25	`movabs	`$'$1, $2')
26')
27
28dnl  Usage: CALL(funcname)
29dnl
30dnl  Simply override the definition in x86_64-defs.m4.
31
32define(`CALL',`call	GSYM_PREFIX`'$1')
33
34
35dnl  Usage: JUMPTABSECT
36dnl
37dnl  CAUTION: Do not put anything sensible here, like RODATA.  That works with
38dnl  some Darwin tool chains, but silently breaks with other.  (Note that
39dnl  putting jump tables in the text segment is a really poor idea for PC many
40dnl  processors, since they cannot cache the same thing in both L1D and L2I.)
41
42define(`JUMPTABSECT', `.text')
43
44
45dnl  Usage: JMPENT(targlabel,tablabel)
46
47define(`JMPENT',`dnl
48ifdef(`PIC',
49	`.set	$1_tmp, $1-$2
50	.long	$1_tmp'
51,
52	`.quad	$1'
53)')
54
55dnl  Target ABI macros.  For Darwin we override IFELF (and leave default for
56dnl  IFDOS and IFSTD).
57
58define(`IFELF',   `')
59
60
61dnl  Usage: PROTECT(symbol)
62dnl
63dnl  Used for private GMP symbols that should never be overridden by users.
64dnl  This can save reloc entries and improve shlib sharing as well as
65dnl  application startup times
66
67define(`PROTECT',  `.private_extern $1')
68
69
70divert`'dnl
71