Tizen 2.1 base
[external/gmp.git] / mpn / alpha / alpha-defs.m4
1 divert(-1)
2
3 dnl  m4 macros for Alpha assembler.
4
5 dnl  Copyright 2003, 2004 Free Software Foundation, Inc.
6 dnl
7 dnl  This file is part of the GNU MP Library.
8 dnl
9 dnl  The GNU MP Library is free software; you can redistribute it and/or
10 dnl  modify it under the terms of the GNU Lesser General Public License as
11 dnl  published by the Free Software Foundation; either version 3 of the
12 dnl  License, or (at your option) any later version.
13 dnl
14 dnl  The GNU MP Library is distributed in the hope that it will be useful,
15 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 dnl  Lesser General Public License for more details.
18 dnl
19 dnl  You should have received a copy of the GNU Lesser General Public License
20 dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
21
22
23 dnl  Usage: ASSERT([reg] [,code])
24 dnl
25 dnl  Require that the given reg is non-zero after executing the test code.
26 dnl  For example,
27 dnl
28 dnl         ASSERT(r8,
29 dnl         `       cmpult r16, r17, r8')
30 dnl
31 dnl  If the register argument is empty then nothing is tested, the code is
32 dnl  just executed.  This can be used for setups required by later ASSERTs.
33 dnl  If the code argument is omitted then the register is just tested, with
34 dnl  no special setup code.
35
36 define(ASSERT,
37 m4_assert_numargs_range(1,2)
38 m4_assert_defined(`WANT_ASSERT')
39 `ifelse(WANT_ASSERT,1,
40 `ifelse(`$2',,,`$2')
41 ifelse(`$1',,,
42 `       bne     $1, L(ASSERTok`'ASSERT_label_counter)
43         .long   0       C halt
44 L(ASSERTok`'ASSERT_label_counter):
45 define(`ASSERT_label_counter',eval(ASSERT_label_counter+1))
46 ')
47 ')')
48 define(`ASSERT_label_counter',1)
49
50
51 dnl  Usage: bigend(`code')
52 dnl
53 dnl  Emit the given code only for a big-endian system, like Unicos.  This
54 dnl  can be used for instance for extra stuff needed by extwl.
55
56 define(bigend,
57 m4_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
63 dnl  Usage: bwx_available_p
64 dnl
65 dnl  Evaluate to 1 if the BWX byte memory instructions are available, or to
66 dnl  0 if not.
67 dnl
68 dnl  Listing the chips which do have BWX means anything we haven't looked at
69 dnl  will use safe non-BWX code.  The only targets without BWX currently are
70 dnl  plain alpha (ie. ev4) and alphaev5.
71
72 define(bwx_available_p,
73 m4_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
86 dnl  Usage: unop
87 dnl
88 dnl  The Cray Unicos assembler lacks unop, so give the equivalent ldq_u
89 dnl  explicitly.
90
91 define(unop,
92 m4_assert_numargs(-1)
93 `ldq_u  r31, 0(r30)')
94
95
96 divert