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