|
Packit |
5c3484 |
divert(-1)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl m4 macros for SPARC assembler (32 and 64 bit).
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl Copyright 2002, 2011, 2013 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 |
changecom(;) dnl cannot use default # since that's used in REGISTER decls
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl Usage: REGISTER(reg,attr)
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl Give a ".register reg,attr" directive, if the assembler supports it.
|
|
Packit |
5c3484 |
dnl HAVE_REGISTER comes from the GMP_ASM_SPARC_REGISTER configure test.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
define(REGISTER,
|
|
Packit |
5c3484 |
m4_assert_numargs(2)
|
|
Packit |
5c3484 |
m4_assert_defined(`HAVE_REGISTER')
|
|
Packit |
5c3484 |
`ifelse(HAVE_REGISTER,yes,
|
|
Packit |
5c3484 |
`.register `$1',`$2'')')
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C Testing mechanism for running newer code on older processors
|
|
Packit |
5c3484 |
ifdef(`FAKE_T3',`
|
|
Packit |
5c3484 |
include_mpn(`sparc64/ultrasparct3/missing.m4')
|
|
Packit |
5c3484 |
',`
|
|
Packit |
5c3484 |
define(`addxccc', ``addxccc' $1, $2, $3')
|
|
Packit |
5c3484 |
define(`addxc', ``addxc' $1, $2, $3')
|
|
Packit |
5c3484 |
define(`umulxhi', ``umulxhi' $1, $2, $3')
|
|
Packit |
5c3484 |
define(`lzcnt', ``lzd' $1, $2')
|
|
Packit |
5c3484 |
')
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl Usage: LEA64(symbol,reg,pic_reg)
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl Use whatever 64-bit code sequence is appropriate to load "symbol" into
|
|
Packit |
5c3484 |
dnl register "reg", potentially using register "pic_reg" to perform the
|
|
Packit |
5c3484 |
dnl calculations.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
define(LEA64,
|
|
Packit |
5c3484 |
m4_assert_numargs(3)
|
|
Packit |
5c3484 |
m4_assert_defined(`HAVE_GOTDATA')
|
|
Packit |
5c3484 |
`ifdef(`PIC',`
|
|
Packit |
5c3484 |
rd %pc, %`$2'
|
|
Packit |
5c3484 |
sethi %hi(_GLOBAL_OFFSET_TABLE_+4), %`$3'
|
|
Packit |
5c3484 |
add %`$3', %lo(_GLOBAL_OFFSET_TABLE_+8), %`$3'
|
|
Packit |
5c3484 |
add %`$2', %`$3', %`$3'
|
|
Packit |
5c3484 |
sethi %hi(`$1'), %`$2'
|
|
Packit |
5c3484 |
or %`$2', %lo(`$1'), %`$2'
|
|
Packit |
5c3484 |
ldx [%`$3' + %`$2'], %`$2'',`
|
|
Packit |
5c3484 |
setx `$1', %`$3', %`$2'')')
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
divert
|