xref: /netbsd-src/external/lgpl3/gmp/dist/mpn/mips32/mips.m4 (revision ead2c0eee3abe6bcf08c63bfc78eb8a93a579b2b)
1divert(-1)
2
3dnl  m4 macros for MIPS assembly code.
4
5
6dnl  Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
7dnl
8dnl  This file is part of the GNU MP Library.
9dnl
10dnl  The GNU MP Library is free software; you can redistribute it and/or modify
11dnl  it under the terms of the GNU Lesser General Public License as published
12dnl  by the Free Software Foundation; either version 3 of the License, or (at
13dnl  your option) any later version.
14dnl
15dnl  The GNU MP Library is distributed in the hope that it will be useful, but
16dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
18dnl  License for more details.
19dnl
20dnl  You should have received a copy of the GNU Lesser General Public License
21dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
22
23
24dnl  Usage: ASM_START()
25define(`ASM_START',
26m4_assert_numargs(0)
27`	.set noreorder
28	.set nomacro')
29
30dnl  Usage: X(value)
31define(`X',
32m4_assert_numargs(1)
33`0x$1')
34
35dnl  Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
36dnl          EPILOGUE_cpu(GSYM_PREFIX`'foo)
37
38define(`PROLOGUE_cpu',
39m4_assert_numargs(1)
40`	.text
41	.align	4
42	.globl	$1
43	.ent	$1
44$1:')
45
46define(`EPILOGUE_cpu',
47m4_assert_numargs(1)
48`	.end	$1')
49
50
51dnl  Usage: r0 ... r31
52dnl         f0 ... f31
53dnl
54dnl  Map register names r0 to $0, and f0 to $f0, etc.
55dnl
56dnl  defreg() is used to protect the $ in $0 (otherwise it would represent a
57dnl  macro argument).  Double quoting is used to protect the f0 in $f0
58dnl  (otherwise it would be an infinite recursion).
59
60forloop(i,0,31,`defreg(`r'i,$i)')
61forloop(i,0,31,`deflit(`f'i,``$f''i)')
62
63
64dnl  Usage: ASM_END()
65define(`ASM_END',
66m4_assert_numargs(0)
67)
68
69divert
70