1divert(-1)
2dnl  m4 macros for powerpc32 GNU/Linux 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
40define(`LEA',
41m4_assert_numargs(2)
42`ifdef(`PIC',`
43	mflr	r0
44	bl	20,31,1f
451:	mflr	$1
46	mtlr	r0
47	addis	$1,$1,_GLOBAL_OFFSET_TABLE_-1b@ha
48	addi	$1,$1,_GLOBAL_OFFSET_TABLE_-1b@l
49	lwz	$1, $2@got($1)
50',`
51	lis	$1, $2@ha
52	la	$1, $2@l($1)
53')')
54
55define(`LEAL',
56m4_assert_numargs(2)
57`LEA($1,$2)')
58
59
60define(`EXTERN',
61m4_assert_numargs(1)
62`dnl')
63
64define(`DEF_OBJECT',
65m4_assert_numargs_range(1,2)
66`
67	.section	.rodata
68	ALIGN(ifelse($#,1,2,$2))
69	.type	$1, @object
70$1:
71')
72
73define(`END_OBJECT',
74m4_assert_numargs(1)
75`	.size	$1, .-$1')
76
77define(`ASM_END', `dnl')
78
79ifdef(`PIC',`
80define(`PIC_SLOW')')
81
82dnl  64-bit "long long" parameters are put in an even-odd pair, skipping an
83dnl  even register if that was in turn.  I wish somebody could explain why that
84dnl  is a good idea.
85define(`BROKEN_LONGLONG_PARAM')
86
87divert
88