blob: 04378b8fb3c8b0c6f765491abf98fd990099c2d3 [file] [log] [blame]
Austin Schuhdace2a62020-08-18 10:56:48 -07001divert(-1)
2dnl m4 macros for AIX 64-bit assembly.
3
4dnl Copyright 2000-2002, 2005, 2006, 2010, 2012 Free Software Foundation, Inc.
5
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 modify
9dnl it under the terms of either:
10dnl
11dnl * the GNU Lesser General Public License as published by the Free
12dnl Software Foundation; either version 3 of the License, or (at your
13dnl option) any later version.
14dnl
15dnl or
16dnl
17dnl * the GNU General Public License as published by the Free Software
18dnl Foundation; either version 2 of the License, or (at your option) any
19dnl later version.
20dnl
21dnl or both in parallel, as here.
22dnl
23dnl The GNU MP Library is distributed in the hope that it will be useful, but
24dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
25dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26dnl for more details.
27dnl
28dnl You should have received copies of the GNU General Public License and the
29dnl GNU Lesser General Public License along with the GNU MP Library. If not,
30dnl see https://www.gnu.org/licenses/.
31
32define(`AIX')
33
34define(`ASM_START',
35 `.machine "any"
36 .toc')
37
38dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,toc])
39dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
40dnl
41dnl Don't want ELF style .size in the epilogue.
42
43define(`PROLOGUE_cpu',
44m4_assert_numargs_range(1,2)
45`ifelse(`$2',toc,,
46`ifelse(`$2',,,`m4_error(`Unrecognised PROLOGUE parameter')')')dnl
47 .globl $1
48 .globl .$1
49 .csect [DS], 3
50$1:
51 .llong .$1, TOC[tc0], 0
52 .csect .$1[PR], 6
53.$1:')
54
55define(`EPILOGUE_cpu',
56m4_assert_numargs(1)
57`')
58
59define(`TOC_ENTRY', `')
60
61define(`LEA',
62m4_assert_numargs(2)
63`define(`TOC_ENTRY',
64` .toc
65..$2: .tc $2[TC], $2')'
66 `ld $1, ..$2(2)')
67
68define(`LEAL',
69m4_assert_numargs(2)
70`LEA($1,$2)')
71
72
73define(`EXTERN',
74m4_assert_numargs(1)
75` .globl $1')
76
77define(`EXTERN_FUNC',
78m4_assert_numargs(1)
79` .globl .$1')
80
81define(`DEF_OBJECT',
82m4_assert_numargs_range(1,2)
83` .csect [RO], 3
84 ALIGN(ifelse($#,1,2,$2))
85$1:
86')
87
88define(`END_OBJECT',
89m4_assert_numargs(1))
90
91define(`CALL',
92 `bl .$1
93 nop')
94
95define(`ASM_END', `TOC_ENTRY')
96
97undefine(`EXTRA_REGISTER')
98
99divert