xref: /netbsd-src/external/lgpl3/gmp/dist/mpn/alpha/alpha-defs.m4 (revision ce54336801cf28877c3414aa2fcb251dddd543a2)
1divert(-1)
2
3dnl  m4 macros for Alpha assembler.
4
5dnl  Copyright 2003, 2004 Free Software Foundation, Inc.
6
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 modify
10dnl  it under the terms of either:
11dnl
12dnl    * the GNU Lesser General Public License as published by the Free
13dnl      Software Foundation; either version 3 of the License, or (at your
14dnl      option) any later version.
15dnl
16dnl  or
17dnl
18dnl    * the GNU General Public License as published by the Free Software
19dnl      Foundation; either version 2 of the License, or (at your option) any
20dnl      later version.
21dnl
22dnl  or both in parallel, as here.
23dnl
24dnl  The GNU MP Library is distributed in the hope that it will be useful, but
25dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
26dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
27dnl  for more details.
28dnl
29dnl  You should have received copies of the GNU General Public License and the
30dnl  GNU Lesser General Public License along with the GNU MP Library.  If not,
31dnl  see https://www.gnu.org/licenses/.
32
33
34dnl  Usage: ASSERT([reg] [,code])
35dnl
36dnl  Require that the given reg is non-zero after executing the test code.
37dnl  For example,
38dnl
39dnl         ASSERT(r8,
40dnl         `       cmpult r16, r17, r8')
41dnl
42dnl  If the register argument is empty then nothing is tested, the code is
43dnl  just executed.  This can be used for setups required by later ASSERTs.
44dnl  If the code argument is omitted then the register is just tested, with
45dnl  no special setup code.
46
47define(ASSERT,
48m4_assert_numargs_range(1,2)
49m4_assert_defined(`WANT_ASSERT')
50`ifelse(WANT_ASSERT,1,
51`ifelse(`$2',,,`$2')
52ifelse(`$1',,,
53`	bne	$1, L(ASSERTok`'ASSERT_label_counter)
54	.long	0	C halt
55L(ASSERTok`'ASSERT_label_counter):
56define(`ASSERT_label_counter',eval(ASSERT_label_counter+1))
57')
58')')
59define(`ASSERT_label_counter',1)
60
61
62dnl  Usage: bigend(`code')
63dnl
64dnl  Emit the given code only for a big-endian system, like Unicos.  This
65dnl  can be used for instance for extra stuff needed by extwl.
66
67define(bigend,
68m4_assert_numargs(1)
69`ifdef(`HAVE_LIMB_BIG_ENDIAN',`$1',
70`ifdef(`HAVE_LIMB_LITTLE_ENDIAN',`',
71`m4_error(`Cannot assemble, unknown limb endianness')')')')
72
73
74dnl  Usage: bwx_available_p
75dnl
76dnl  Evaluate to 1 if the BWX byte memory instructions are available, or to
77dnl  0 if not.
78dnl
79dnl  Listing the chips which do have BWX means anything we haven't looked at
80dnl  will use safe non-BWX code.  The only targets without BWX currently are
81dnl  plain alpha (ie. ev4) and alphaev5.
82
83define(bwx_available_p,
84m4_assert_numargs(-1)
85`m4_ifdef_anyof_p(
86	`HAVE_HOST_CPU_alphaev56',
87	`HAVE_HOST_CPU_alphapca56',
88	`HAVE_HOST_CPU_alphapca57',
89	`HAVE_HOST_CPU_alphaev6',
90	`HAVE_HOST_CPU_alphaev67',
91	`HAVE_HOST_CPU_alphaev68',
92	`HAVE_HOST_CPU_alphaev69',
93	`HAVE_HOST_CPU_alphaev7',
94	`HAVE_HOST_CPU_alphaev79')')
95
96
97dnl  Usage: unop
98dnl
99dnl  The Cray Unicos assembler lacks unop, so give the equivalent ldq_u
100dnl  explicitly.
101
102define(unop,
103m4_assert_numargs(-1)
104`ldq_u	r31, 0(r30)')
105
106
107divert
108