1divert(-1) 2 3dnl m4 macros for alpha assembler (everywhere except unicos). 4 5 6dnl Copyright 2000, 2002, 2003, 2004 Free Software Foundation, Inc. 7dnl 8dnl This file is part of the GNU MP Library. 9dnl 10dnl The GNU MP Library is free software; you can redistribute it and/or 11dnl modify it under the terms of the GNU Lesser General Public License as 12dnl published by the Free Software Foundation; either version 3 of the 13dnl License, or (at your option) any later version. 14dnl 15dnl The GNU MP Library is distributed in the hope that it will be useful, 16dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 17dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18dnl Lesser General Public License for more details. 19dnl 20dnl You should have received a copy of the GNU Lesser General Public License 21dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. 22 23 24dnl Usage: ASM_START() 25define(`ASM_START', 26m4_assert_numargs(0) 27` .set noreorder 28 .set noat') 29 30dnl Usage: X(value) 31define(`X', 32m4_assert_numargs(1) 33`0x$1') 34 35dnl Usage: FLOAT64(label,value) 36define(`FLOAT64', 37m4_assert_numargs(2) 38` .align 3 39$1: .t_floating $2') 40 41 42dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,gp|noalign]) 43dnl EPILOGUE_cpu(GSYM_PREFIX`'foo) 44 45define(`PROLOGUE_cpu', 46m4_assert_numargs_range(1,2) 47`ifelse(`$2',gp,, 48`ifelse(`$2',noalign,, 49`ifelse(`$2',,,`m4_error(`Unrecognised PROLOGUE parameter 50')')')')dnl 51 .text 52ifelse(`$2',noalign,,` ALIGN(16)') 53 .globl $1 54 .ent $1 55$1: 56ifelse(`$2',gp,` ldgp r29,0(r27)') 57 .frame r30,0,r26 58 .prologue ifelse(`$2',gp,1,0)') 59 60define(`EPILOGUE_cpu', 61m4_assert_numargs(1) 62` .end $1') 63 64 65dnl Usage: LDGP(dst,src) 66dnl 67dnl Emit an "ldgp dst,src", but only if the system uses a GOT. 68 69define(LDGP, 70m4_assert_numargs(2) 71`ldgp `$1', `$2'') 72 73 74dnl Usage: EXTERN(variable_name) 75define(`EXTERN', 76m4_assert_numargs(1) 77) 78 79dnl Usage: r0 ... r31 80dnl f0 ... f31 81dnl 82dnl Map register names r0 to $0, and f0 to $f0, etc. 83dnl This is needed on all systems but Unicos 84dnl 85dnl defreg() is used to protect the $ in $0 (otherwise it would represent a 86dnl macro argument). Double quoting is used to protect the f0 in $f0 87dnl (otherwise it would be an infinite recursion). 88 89forloop(i,0,31,`defreg(`r'i,$i)') 90forloop(i,0,31,`deflit(`f'i,``$f''i)') 91 92 93dnl Usage: DATASTART(name) 94dnl DATAEND() 95 96define(`DATASTART', 97m4_assert_numargs(1) 98` DATA 99$1:') 100define(`DATAEND', 101m4_assert_numargs(0) 102) 103 104dnl Load a symbolic address into a register 105define(`LEA', 106m4_assert_numargs(2) 107`lda $1, $2') 108 109dnl Usage: ASM_END() 110define(`ASM_END', 111m4_assert_numargs(0) 112) 113 114divert 115