xref: /netbsd-src/external/lgpl3/gmp/dist/mpn/arm/arm-defs.m4 (revision a24efa7dea9f1f56c3bdb15a927d3516792ace1c)
1divert(-1)
2
3dnl  m4 macros for ARM assembler.
4
5dnl  Copyright 2001, 2012, 2013 Free Software 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
22
23dnl  Standard commenting is with @, the default m4 # is for constants and we
24dnl  don't want to disable macro expansions in or after them.
25
26changecom(@&*$)
27
28
29dnl  APCS register names.
30
31deflit(a1,r0)
32deflit(a2,r1)
33deflit(a3,r2)
34deflit(a4,r3)
35deflit(v1,r4)
36deflit(v2,r5)
37deflit(v3,r6)
38deflit(v4,r7)
39deflit(v5,r8)
40deflit(v6,r9)
41deflit(sb,r9)
42deflit(v7,r10)
43deflit(sl,r10)
44deflit(fp,r11)
45deflit(ip,r12)
46deflit(sp,r13)
47deflit(lr,r14)
48deflit(pc,r15)
49
50
51define(`lea_list', `')
52define(`lea_num',0)
53
54dnl  LEA(reg,gmp_symbol)
55dnl
56dnl  Load the address of gmp_symbol into a register.  The gmp_symbol must be
57dnl  either local or protected/hidden, since we assume it has a fixed distance
58dnl  from the point of use.
59
60define(`LEA',`dnl
61ldr	$1, L(ptr`'lea_num)
62ifdef(`PIC',dnl
63`dnl
64L(bas`'lea_num):dnl
65	add	$1, $1, pc`'dnl
66	m4append(`lea_list',`
67L(ptr'lea_num`):	.word	GSYM_PREFIX`'$2-L(bas'lea_num`)-8')
68	define(`lea_num', eval(lea_num+1))dnl
69',`dnl
70	m4append(`lea_list',`
71L(ptr'lea_num`):	.word	GSYM_PREFIX`'$2')
72	define(`lea_num', eval(lea_num+1))dnl
73')dnl
74')
75
76define(`EPILOGUE_cpu',
77`lea_list
78	SIZE(`$1',.-`$1')')
79
80divert
81