xref: /netbsd-src/external/lgpl3/gmp/dist/mpn/alpha/default.m4 (revision ce54336801cf28877c3414aa2fcb251dddd543a2)
1divert(-1)
2
3dnl  m4 macros for alpha assembler (everywhere except unicos).
4
5
6dnl  Copyright 2000, 2002-2004, 2013 Free Software Foundation, Inc.
7
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 noat')
40
41dnl  Usage: X(value)
42define(`X',
43m4_assert_numargs(1)
44`0x$1')
45
46dnl  Usage: FLOAT64(label,value)
47define(`FLOAT64',
48m4_assert_numargs(2)
49`	.align	3
50$1:	.t_floating $2')
51
52
53dnl  Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,gp|noalign])
54dnl          EPILOGUE_cpu(GSYM_PREFIX`'foo)
55
56define(`PROLOGUE_cpu',
57m4_assert_numargs_range(1,2)
58`ifelse(`$2',gp,,
59`ifelse(`$2',noalign,,
60`ifelse(`$2',,,`m4_error(`Unrecognised PROLOGUE parameter
61')')')')dnl
62	.text
63ifelse(`$2',noalign,,`	ALIGN(16)')
64	.globl	$1
65	.ent	$1
66$1:
67	.frame r30,0,r26,0
68ifelse(`$2',gp,`	ldgp	r29, 0(r27)
69`$'$1..ng:')
70	.prologue ifelse(`$2',gp,1,0)')
71
72define(`EPILOGUE_cpu',
73m4_assert_numargs(1)
74`	.end	$1')
75
76
77dnl  Usage: LDGP(dst,src)
78dnl
79dnl  Emit an "ldgp dst,src", but only if the system uses a GOT.
80
81define(LDGP,
82m4_assert_numargs(2)
83`ldgp	`$1', `$2'')
84
85
86dnl  Usage: EXTERN(variable_name)
87define(`EXTERN',
88m4_assert_numargs(1)
89)
90
91dnl  Usage: r0 ... r31
92dnl         f0 ... f31
93dnl
94dnl  Map register names r0 to $0, and f0 to $f0, etc.
95dnl  This is needed on all systems but Unicos
96dnl
97dnl  defreg() is used to protect the $ in $0 (otherwise it would represent a
98dnl  macro argument).  Double quoting is used to protect the f0 in $f0
99dnl  (otherwise it would be an infinite recursion).
100
101forloop(i,0,31,`defreg(`r'i,$i)')
102forloop(i,0,31,`deflit(`f'i,``$f''i)')
103
104
105dnl  Usage: DATASTART(name,align)  or  DATASTART(name)
106dnl         DATAEND()
107
108define(`DATASTART',
109m4_assert_numargs_range(1,2)
110`	RODATA
111	ALIGN(ifelse($#,1,2,$2))
112$1:')
113define(`DATAEND',
114m4_assert_numargs(0)
115)
116
117dnl  Load a symbolic address into a register
118define(`LEA',
119m4_assert_numargs(2)
120`lda	$1, $2')
121
122dnl  Usage: ASM_END()
123define(`ASM_END',
124m4_assert_numargs(0)
125)
126
127divert
128