3 dnl m4 macros for Alpha assembler.
5 dnl Copyright 2003, 2004 Free Software Foundation, Inc.
7 dnl This file is part of the GNU MP Library.
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.
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.
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/.
23 dnl Usage: ASSERT([reg] [,code])
25 dnl Require that the given reg is non-zero after executing the test code.
29 dnl ` cmpult r16, r17, r8')
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.
37 m4_assert_numargs_range(1,2)
38 m4_assert_defined(`WANT_ASSERT')
39 `ifelse(WANT_ASSERT,1,
42 ` bne $1, L(ASSERTok`'ASSERT_label_counter)
44 L(ASSERTok`'ASSERT_label_counter):
45 define(`ASSERT_label_counter',eval(ASSERT_label_counter+1))
48 define(`ASSERT_label_counter',1)
51 dnl Usage: bigend(`code')
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.
58 `ifdef(`HAVE_LIMB_BIG_ENDIAN',`$1',
59 `ifdef(`HAVE_LIMB_LITTLE_ENDIAN',`',
60 `m4_error(`Cannot assemble, unknown limb endianness')')')')
63 dnl Usage: bwx_available_p
65 dnl Evaluate to 1 if the BWX byte memory instructions are available, or to
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.
72 define(bwx_available_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')')
88 dnl The Cray Unicos assembler lacks unop, so give the equivalent ldq_u