1divert(-1)
2
3dnl  m4 macros for Alpha assembler.
4
5dnl  Copyright 2003, 2004 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  Usage: ASSERT([reg] [,code])
24dnl
25dnl  Require that the given reg is non-zero after executing the test code.
26dnl  For example,
27dnl
28dnl         ASSERT(r8,
29dnl         `       cmpult r16, r17, r8')
30dnl
31dnl  If the register argument is empty then nothing is tested, the code is
32dnl  just executed.  This can be used for setups required by later ASSERTs.
33dnl  If the code argument is omitted then the register is just tested, with
34dnl  no special setup code.
35
36define(ASSERT,
37m4_assert_numargs_range(1,2)
38m4_assert_defined(`WANT_ASSERT')
39`ifelse(WANT_ASSERT,1,
40`ifelse(`$2',,,`$2')
41ifelse(`$1',,,
42`	bne	$1, L(ASSERTok`'ASSERT_label_counter)
43	.long	0	C halt
44L(ASSERTok`'ASSERT_label_counter):
45define(`ASSERT_label_counter',eval(ASSERT_label_counter+1))
46')
47')')
48define(`ASSERT_label_counter',1)
49
50
51dnl  Usage: bigend(`code')
52dnl
53dnl  Emit the given code only for a big-endian system, like Unicos.  This
54dnl  can be used for instance for extra stuff needed by extwl.
55
56define(bigend,
57m4_assert_numargs(1)
58`ifdef(`HAVE_LIMB_BIG_ENDIAN',`$1',
59`ifdef(`HAVE_LIMB_LITTLE_ENDIAN',`',
60`m4_error(`Cannot assemble, unknown limb endianness')')')')
61
62
63dnl  Usage: bwx_available_p
64dnl
65dnl  Evaluate to 1 if the BWX byte memory instructions are available, or to
66dnl  0 if not.
67dnl
68dnl  Listing the chips which do have BWX means anything we haven't looked at
69dnl  will use safe non-BWX code.  The only targets without BWX currently are
70dnl  plain alpha (ie. ev4) and alphaev5.
71
72define(bwx_available_p,
73m4_assert_numargs(-1)
74`m4_ifdef_anyof_p(
75	`HAVE_HOST_CPU_alphaev56',
76	`HAVE_HOST_CPU_alphapca56',
77	`HAVE_HOST_CPU_alphapca57',
78	`HAVE_HOST_CPU_alphaev6',
79	`HAVE_HOST_CPU_alphaev67',
80	`HAVE_HOST_CPU_alphaev68',
81	`HAVE_HOST_CPU_alphaev69',
82	`HAVE_HOST_CPU_alphaev7',
83	`HAVE_HOST_CPU_alphaev79')')
84
85
86dnl  Usage: unop
87dnl
88dnl  The Cray Unicos assembler lacks unop, so give the equivalent ldq_u
89dnl  explicitly.
90
91define(unop,
92m4_assert_numargs(-1)
93`ldq_u	r31, 0(r30)')
94
95
96divert
97