Blame mpn/arm/arm-defs.m4

Packit 5c3484
divert(-1)
Packit 5c3484
Packit 5c3484
dnl  m4 macros for ARM assembler.
Packit 5c3484
Packit 5c3484
dnl  Copyright 2001, 2012, 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
dnl  Standard commenting is with @, the default m4 # is for constants and we
Packit 5c3484
dnl  don't want to disable macro expansions in or after them.
Packit 5c3484
Packit 5c3484
changecom(@&*$)
Packit 5c3484
Packit 5c3484
Packit 5c3484
dnl  APCS register names.
Packit 5c3484
Packit 5c3484
deflit(a1,r0)
Packit 5c3484
deflit(a2,r1)
Packit 5c3484
deflit(a3,r2)
Packit 5c3484
deflit(a4,r3)
Packit 5c3484
deflit(v1,r4)
Packit 5c3484
deflit(v2,r5)
Packit 5c3484
deflit(v3,r6)
Packit 5c3484
deflit(v4,r7)
Packit 5c3484
deflit(v5,r8)
Packit 5c3484
deflit(v6,r9)
Packit 5c3484
deflit(sb,r9)
Packit 5c3484
deflit(v7,r10)
Packit 5c3484
deflit(sl,r10)
Packit 5c3484
deflit(fp,r11)
Packit 5c3484
deflit(ip,r12)
Packit 5c3484
deflit(sp,r13)
Packit 5c3484
deflit(lr,r14)
Packit 5c3484
deflit(pc,r15)
Packit 5c3484
Packit 5c3484
Packit 5c3484
define(`lea_list', `')
Packit 5c3484
define(`lea_num',0)
Packit 5c3484
Packit 5c3484
dnl  LEA(reg,gmp_symbol)
Packit 5c3484
dnl
Packit 5c3484
dnl  Load the address of gmp_symbol into a register.  The gmp_symbol must be
Packit 5c3484
dnl  either local or protected/hidden, since we assume it has a fixed distance
Packit 5c3484
dnl  from the point of use.
Packit 5c3484
Packit 5c3484
define(`LEA',`dnl
Packit 5c3484
ldr	$1, L(ptr`'lea_num)
Packit 5c3484
ifdef(`PIC',dnl
Packit 5c3484
`dnl
Packit 5c3484
L(bas`'lea_num):dnl
Packit 5c3484
	add	$1, $1, pc`'dnl
Packit 5c3484
	m4append(`lea_list',`
Packit 5c3484
L(ptr'lea_num`):	.word	GSYM_PREFIX`'$2-L(bas'lea_num`)-8')
Packit 5c3484
	define(`lea_num', eval(lea_num+1))dnl
Packit 5c3484
',`dnl
Packit 5c3484
	m4append(`lea_list',`
Packit 5c3484
L(ptr'lea_num`):	.word	GSYM_PREFIX`'$2')
Packit 5c3484
	define(`lea_num', eval(lea_num+1))dnl
Packit 5c3484
')dnl
Packit 5c3484
')
Packit 5c3484
Packit 5c3484
define(`ret',`ifdef(`NOTHUMB',`mov	pc, ',`bx')')
Packit 5c3484
Packit 5c3484
Packit 5c3484
define(`EPILOGUE_cpu',
Packit 5c3484
`lea_list
Packit 5c3484
	SIZE(`$1',.-`$1')')
Packit 5c3484
Packit 5c3484
divert