1divert(-1)
2
3dnl  m4 macros for alpha assembler on 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  Note that none of the standard GMP_ASM_ autoconf tests are done for
36dnl  unicos, so none of the config.m4 results can be used here.
37
38dnl  No underscores on unicos
39define(`GSYM_PREFIX')
40
41define(`ASM_START',
42m4_assert_numargs(0)
43`	.ident	dummy')
44
45define(`X',
46m4_assert_numargs(1)
47`^X$1')
48
49define(`FLOAT64',
50m4_assert_numargs(2)
51`	.psect	$1@crud,data
52$1:	.t_floating $2
53	.endp')
54
55dnl  Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,gp|noalign])
56dnl          EPILOGUE_cpu(GSYM_PREFIX`'foo)
57
58define(`PROLOGUE_cpu',
59m4_assert_numargs_range(1,2)
60`ifelse(`$2',gp,,
61`ifelse(`$2',noalign,,
62`ifelse(`$2',,,`m4_error(`Unrecognised PROLOGUE parameter
63')')')')dnl
64	.stack	192		; What does this mean?  Only Cray knows.
65	.psect	$1@code,code,cache
66$1::')
67
68define(`EPILOGUE_cpu',
69m4_assert_numargs(1)
70`	.endp')
71
72
73dnl  Usage: LDGP(dst,src)
74dnl
75dnl  Emit an "ldgp dst,src", but only on systems using a GOT (which unicos
76dnl  doesn't).
77
78define(LDGP,
79m4_assert_numargs(2)
80)
81
82
83dnl  Usage: EXTERN(variable_name)
84define(`EXTERN',
85m4_assert_numargs(1)
86`	.extern	$1')
87
88define(`DATASTART',
89m4_assert_numargs_range(1,2)
90`	.psect	$1@crud,data
91	ALIGN(ifelse($#,1,2,$2))
92$1:')
93
94define(`DATAEND',
95m4_assert_numargs(0)
96`	.endp')
97
98define(`ASM_END',
99m4_assert_numargs(0)
100`	.end')
101
102define(`cvttqc',
103m4_assert_numargs(-1)
104`cvttq/c')
105
106dnl  Load a symbolic address into a register
107define(`LEA',
108m4_assert_numargs(2)
109	`laum	$1,  $2(r31)
110	sll	$1,  32,   $1
111	lalm	$1,  $2($1)
112	lal	$1,  $2($1)')
113
114
115dnl  Usage: ALIGN(bytes)
116dnl
117dnl  Unicos assembler .align emits zeros, even in code segments, so disable
118dnl  aligning.
119dnl
120dnl  GCC uses a macro emiting nops until the desired alignment is reached
121dnl  (see unicosmk_file_start in alpha.c).  Could do something like that if
122dnl  we cared.  The maximum desired alignment must be established at the
123dnl  start of the section though, since of course emitting nops only
124dnl  advances relative to the section beginning.
125
126define(`ALIGN',
127m4_assert_numargs(1)
128)
129
130
131divert
132