Blame mpn/alpha/alpha-defs.m4

Packit 5c3484
divert(-1)
Packit 5c3484
Packit 5c3484
dnl  m4 macros for Alpha assembler.
Packit 5c3484
Packit 5c3484
dnl  Copyright 2003, 2004 Free Software Foundation, Inc.
Packit 5c3484
Packit 5c3484
dnl  This file is part of the GNU MP Library.
Packit 5c3484
dnl
Packit 5c3484
dnl  The GNU MP Library is free software; you can redistribute it and/or modify
Packit 5c3484
dnl  it under the terms of either:
Packit 5c3484
dnl
Packit 5c3484
dnl    * the GNU Lesser General Public License as published by the Free
Packit 5c3484
dnl      Software Foundation; either version 3 of the License, or (at your
Packit 5c3484
dnl      option) any later version.
Packit 5c3484
dnl
Packit 5c3484
dnl  or
Packit 5c3484
dnl
Packit 5c3484
dnl    * the GNU General Public License as published by the Free Software
Packit 5c3484
dnl      Foundation; either version 2 of the License, or (at your option) any
Packit 5c3484
dnl      later version.
Packit 5c3484
dnl
Packit 5c3484
dnl  or both in parallel, as here.
Packit 5c3484
dnl
Packit 5c3484
dnl  The GNU MP Library is distributed in the hope that it will be useful, but
Packit 5c3484
dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
Packit 5c3484
dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
Packit 5c3484
dnl  for more details.
Packit 5c3484
dnl
Packit 5c3484
dnl  You should have received copies of the GNU General Public License and the
Packit 5c3484
dnl  GNU Lesser General Public License along with the GNU MP Library.  If not,
Packit 5c3484
dnl  see https://www.gnu.org/licenses/.
Packit 5c3484
Packit 5c3484
Packit 5c3484
dnl  Usage: ASSERT([reg] [,code])
Packit 5c3484
dnl
Packit 5c3484
dnl  Require that the given reg is non-zero after executing the test code.
Packit 5c3484
dnl  For example,
Packit 5c3484
dnl
Packit 5c3484
dnl         ASSERT(r8,
Packit 5c3484
dnl         `       cmpult r16, r17, r8')
Packit 5c3484
dnl
Packit 5c3484
dnl  If the register argument is empty then nothing is tested, the code is
Packit 5c3484
dnl  just executed.  This can be used for setups required by later ASSERTs.
Packit 5c3484
dnl  If the code argument is omitted then the register is just tested, with
Packit 5c3484
dnl  no special setup code.
Packit 5c3484
Packit 5c3484
define(ASSERT,
Packit 5c3484
m4_assert_numargs_range(1,2)
Packit 5c3484
m4_assert_defined(`WANT_ASSERT')
Packit 5c3484
`ifelse(WANT_ASSERT,1,
Packit 5c3484
`ifelse(`$2',,,`$2')
Packit 5c3484
ifelse(`$1',,,
Packit 5c3484
`	bne	$1, L(ASSERTok`'ASSERT_label_counter)
Packit 5c3484
	.long	0	C halt
Packit 5c3484
L(ASSERTok`'ASSERT_label_counter):
Packit 5c3484
define(`ASSERT_label_counter',eval(ASSERT_label_counter+1))
Packit 5c3484
')
Packit 5c3484
')')
Packit 5c3484
define(`ASSERT_label_counter',1)
Packit 5c3484
Packit 5c3484
Packit 5c3484
dnl  Usage: bigend(`code')
Packit 5c3484
dnl
Packit 5c3484
dnl  Emit the given code only for a big-endian system, like Unicos.  This
Packit 5c3484
dnl  can be used for instance for extra stuff needed by extwl.
Packit 5c3484
Packit 5c3484
define(bigend,
Packit 5c3484
m4_assert_numargs(1)
Packit 5c3484
`ifdef(`HAVE_LIMB_BIG_ENDIAN',`$1',
Packit 5c3484
`ifdef(`HAVE_LIMB_LITTLE_ENDIAN',`',
Packit 5c3484
`m4_error(`Cannot assemble, unknown limb endianness')')')')
Packit 5c3484
Packit 5c3484
Packit 5c3484
dnl  Usage: bwx_available_p
Packit 5c3484
dnl
Packit 5c3484
dnl  Evaluate to 1 if the BWX byte memory instructions are available, or to
Packit 5c3484
dnl  0 if not.
Packit 5c3484
dnl
Packit 5c3484
dnl  Listing the chips which do have BWX means anything we haven't looked at
Packit 5c3484
dnl  will use safe non-BWX code.  The only targets without BWX currently are
Packit 5c3484
dnl  plain alpha (ie. ev4) and alphaev5.
Packit 5c3484
Packit 5c3484
define(bwx_available_p,
Packit 5c3484
m4_assert_numargs(-1)
Packit 5c3484
`m4_ifdef_anyof_p(
Packit 5c3484
	`HAVE_HOST_CPU_alphaev56',
Packit 5c3484
	`HAVE_HOST_CPU_alphapca56',
Packit 5c3484
	`HAVE_HOST_CPU_alphapca57',
Packit 5c3484
	`HAVE_HOST_CPU_alphaev6',
Packit 5c3484
	`HAVE_HOST_CPU_alphaev67',
Packit 5c3484
	`HAVE_HOST_CPU_alphaev68',
Packit 5c3484
	`HAVE_HOST_CPU_alphaev69',
Packit 5c3484
	`HAVE_HOST_CPU_alphaev7',
Packit 5c3484
	`HAVE_HOST_CPU_alphaev79')')
Packit 5c3484
Packit 5c3484
Packit 5c3484
dnl  Usage: unop
Packit 5c3484
dnl
Packit 5c3484
dnl  The Cray Unicos assembler lacks unop, so give the equivalent ldq_u
Packit 5c3484
dnl  explicitly.
Packit 5c3484
Packit 5c3484
define(unop,
Packit 5c3484
m4_assert_numargs(-1)
Packit 5c3484
`ldq_u	r31, 0(r30)')
Packit 5c3484
Packit 5c3484
Packit 5c3484
divert