blob: 5fa89eca35d8fd15d8333c0e0234e68f47b2f0f5 [file] [log] [blame]
Austin Schuhdace2a62020-08-18 10:56:48 -07001divert(-1)
2
3dnl m4 macros for MIPS assembly code (both 32-bit and 64-bit).
4
5
6dnl Copyright 2000-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 either:
12dnl
13dnl * the GNU Lesser General Public License as published by the Free
14dnl Software Foundation; either version 3 of the License, or (at your
15dnl option) any later version.
16dnl
17dnl or
18dnl
19dnl * the GNU General Public License as published by the Free Software
20dnl Foundation; either version 2 of the License, or (at your option) any
21dnl later version.
22dnl
23dnl or both in parallel, as here.
24dnl
25dnl The GNU MP Library is distributed in the hope that it will be useful, but
26dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
27dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
28dnl for more details.
29dnl
30dnl You should have received copies of the GNU General Public License and the
31dnl GNU Lesser General Public License along with the GNU MP Library. If not,
32dnl see https://www.gnu.org/licenses/.
33
34
35dnl Usage: ASM_START()
36define(`ASM_START',
37m4_assert_numargs(0)
38` .set noreorder
39 .set nomacro')
40
41dnl Usage: X(value)
42define(`X',
43m4_assert_numargs(1)
44`0x$1')
45
46dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
47dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
48
49define(`PROLOGUE_cpu',
50m4_assert_numargs(1)
51` .text
52 .align 4
53 .globl $1
54 .ent $1
55$1:')
56
57define(`EPILOGUE_cpu',
58m4_assert_numargs(1)
59` .end $1')
60
61
62dnl Usage: r0 ... r31
63dnl f0 ... f31
64dnl
65dnl Map register names r0 to $0, and f0 to $f0, etc.
66dnl
67dnl defreg() is used to protect the $ in $0 (otherwise it would represent a
68dnl macro argument). Double quoting is used to protect the f0 in $f0
69dnl (otherwise it would be an infinite recursion).
70
71forloop(i,0,31,`defreg(`r'i,$i)')
72forloop(i,0,31,`deflit(`f'i,``$f''i)')
73
74
75dnl Usage: ASM_END()
76define(`ASM_END',
77m4_assert_numargs(0)
78)
79
80divert