xref: /netbsd-src/external/lgpl3/gmp/dist/mpn/powerpc32/eabi.m4 (revision af56d1fe9956bd7c616e18c1b7f025f464618471)
1divert(-1)
2dnl  m4 macros for powerpc32 eABI assembly.
3
4dnl  Copyright 2003, 2005, 2006 Free Software Foundation, Inc.
5dnl
6dnl  This file is part of the GNU MP Library.
7dnl
8dnl  The GNU MP Library is free software; you can redistribute it and/or
9dnl  modify it under the terms of the GNU Lesser General Public License as
10dnl  published by the Free Software Foundation; either version 3 of the
11dnl  License, or (at your option) any later version.
12dnl
13dnl  The GNU MP Library is distributed in the hope that it will be useful,
14dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
15dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16dnl  Lesser General Public License for more details.
17dnl
18dnl  You should have received a copy of the GNU Lesser General Public License
19dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
20
21define(`ASM_START',`')
22
23dnl  Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
24dnl          EPILOGUE_cpu(GSYM_PREFIX`'foo)
25dnl
26
27define(`PROLOGUE_cpu',
28m4_assert_numargs(1)
29	`
30	.section	".text"
31	.align	3
32	.globl	$1
33	.type	$1, @function
34$1:')
35
36define(`EPILOGUE_cpu',
37m4_assert_numargs(1)
38`	.size	$1, .-$1')
39
40dnl  This ought to support PIC, but it is unclear how that is done for eABI
41define(`LEA',
42m4_assert_numargs(2)
43`
44	lis	$1, $2@ha
45	la	$1, $2@l($1)
46')
47
48define(`EXTERN',
49m4_assert_numargs(1)
50`dnl')
51
52define(`DEF_OBJECT',
53m4_assert_numargs_range(1,2)
54`
55	.section	.rodata
56	ALIGN(ifelse($#,1,2,$2))
57	.type	$1, @object
58$1:
59')
60
61define(`END_OBJECT',
62m4_assert_numargs(1)
63`	.size	$1, .-$1')
64
65define(`ASM_END', `dnl')
66
67ifdef(`PIC',`
68define(`PIC_SLOW')')
69
70dnl  64-bit "long long" parameters are put in an even-odd pair, skipping an
71dnl  even register if that was in turn.  I wish somebody could explain why that
72dnl  is a good idea.
73define(`BROKEN_LONGLONG_PARAM')
74
75divert
76