xref: /netbsd-src/external/lgpl3/gmp/dist/mpn/powerpc64/aix.m4 (revision d11b170b9000ada93db553723522a63d5deac310)
1divert(-1)
2dnl  m4 macros for AIX 64-bit assembly.
3
4dnl  Copyright 2000, 2001, 2002, 2005, 2006, 2010, 2012 Free Software
5dnl  Foundation, Inc.
6dnl
7dnl  This file is part of the GNU MP Library.
8dnl
9dnl  The GNU MP Library is free software; you can redistribute it and/or
10dnl  modify it under the terms of the GNU Lesser General Public License as
11dnl  published by the Free Software Foundation; either version 3 of the
12dnl  License, or (at your option) any later version.
13dnl
14dnl  The GNU MP Library is distributed in the hope that it will be useful,
15dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
16dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17dnl  Lesser General Public License for more details.
18dnl
19dnl  You should have received a copy of the GNU Lesser General Public License
20dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
21
22define(`ASM_START',
23	`.machine	"any"
24	.toc')
25
26dnl  Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
27dnl          EPILOGUE_cpu(GSYM_PREFIX`'foo)
28dnl
29dnl  Don't want ELF style .size in the epilogue.
30
31define(`PROLOGUE_cpu',
32m4_assert_numargs(1)
33	`
34	.globl	$1
35	.globl	.$1
36	.csect	[DS], 3
37$1:
38	.llong	.$1, TOC[tc0], 0
39	.csect	.$1[PR], 6
40.$1:')
41
42define(`EPILOGUE_cpu',
43m4_assert_numargs(1)
44`')
45
46define(`TOC_ENTRY', `')
47
48define(`LEA',
49m4_assert_numargs(2)
50`define(`TOC_ENTRY',
51`	.toc
52..$2:	.tc	$2[TC], $2')'
53	`ld	$1, ..$2(2)')
54
55define(`LEAL',
56m4_assert_numargs(2)
57`LEA($1,$2)')
58
59
60define(`EXTERN',
61m4_assert_numargs(1)
62`	.globl	$1')
63
64define(`EXTERN_FUNC',
65m4_assert_numargs(1)
66`	.globl	.$1')
67
68define(`DEF_OBJECT',
69m4_assert_numargs_range(1,2)
70`	.csect	[RO], 3
71	ALIGN(ifelse($#,1,2,$2))
72$1:
73')
74
75define(`END_OBJECT',
76m4_assert_numargs(1))
77
78define(`CALL',
79	`bl	.$1
80	nop')
81
82define(`ASM_END', `TOC_ENTRY')
83
84divert
85