aboutsummaryrefslogtreecommitdiff
path: root/vendor/gmp-6.3.0/mpn/alpha/alpha-defs.m4
blob: af34c9294c9671c052b3a91b52d7344356a0349a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
divert(-1)

dnl  m4 macros for Alpha assembler.

dnl  Copyright 2003, 2004 Free Software Foundation, Inc.

dnl  This file is part of the GNU MP Library.
dnl
dnl  The GNU MP Library is free software; you can redistribute it and/or modify
dnl  it under the terms of either:
dnl
dnl    * the GNU Lesser General Public License as published by the Free
dnl      Software Foundation; either version 3 of the License, or (at your
dnl      option) any later version.
dnl
dnl  or
dnl
dnl    * the GNU General Public License as published by the Free Software
dnl      Foundation; either version 2 of the License, or (at your option) any
dnl      later version.
dnl
dnl  or both in parallel, as here.
dnl
dnl  The GNU MP Library is distributed in the hope that it will be useful, but
dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dnl  for more details.
dnl
dnl  You should have received copies of the GNU General Public License and the
dnl  GNU Lesser General Public License along with the GNU MP Library.  If not,
dnl  see https://www.gnu.org/licenses/.


dnl  Usage: ASSERT([reg] [,code])
dnl
dnl  Require that the given reg is non-zero after executing the test code.
dnl  For example,
dnl
dnl         ASSERT(r8,
dnl         `       cmpult r16, r17, r8')
dnl
dnl  If the register argument is empty then nothing is tested, the code is
dnl  just executed.  This can be used for setups required by later ASSERTs.
dnl  If the code argument is omitted then the register is just tested, with
dnl  no special setup code.

define(ASSERT,
m4_assert_numargs_range(1,2)
m4_assert_defined(`WANT_ASSERT')
`ifelse(WANT_ASSERT,1,
`ifelse(`$2',,,`$2')
ifelse(`$1',,,
`	bne	$1, L(ASSERTok`'ASSERT_label_counter)
	.long	0	C halt
L(ASSERTok`'ASSERT_label_counter):
define(`ASSERT_label_counter',eval(ASSERT_label_counter+1))
')
')')
define(`ASSERT_label_counter',1)


dnl  Usage: bigend(`code')
dnl
dnl  Emit the given code only for a big-endian system, like Unicos.  This
dnl  can be used for instance for extra stuff needed by extwl.

define(bigend,
m4_assert_numargs(1)
`ifdef(`HAVE_LIMB_BIG_ENDIAN',`$1',
`ifdef(`HAVE_LIMB_LITTLE_ENDIAN',`',
`m4_error(`Cannot assemble, unknown limb endianness')')')')


dnl  Usage: bwx_available_p
dnl
dnl  Evaluate to 1 if the BWX byte memory instructions are available, or to
dnl  0 if not.
dnl
dnl  Listing the chips which do have BWX means anything we haven't looked at
dnl  will use safe non-BWX code.  The only targets without BWX currently are
dnl  plain alpha (ie. ev4) and alphaev5.

define(bwx_available_p,
m4_assert_numargs(-1)
`m4_ifdef_anyof_p(
	`HAVE_HOST_CPU_alphaev56',
	`HAVE_HOST_CPU_alphapca56',
	`HAVE_HOST_CPU_alphapca57',
	`HAVE_HOST_CPU_alphaev6',
	`HAVE_HOST_CPU_alphaev67',
	`HAVE_HOST_CPU_alphaev68',
	`HAVE_HOST_CPU_alphaev69',
	`HAVE_HOST_CPU_alphaev7',
	`HAVE_HOST_CPU_alphaev79')')


dnl  Usage: unop
dnl
dnl  The Cray Unicos assembler lacks unop, so give the equivalent ldq_u
dnl  explicitly.

define(unop,
m4_assert_numargs(-1)
`ldq_u	r31, 0(r30)')


divert