Tizen 2.1 base
[external/gmp.git] / mpn / alpha / unicos.m4
1 divert(-1)
2
3 dnl  m4 macros for alpha assembler on 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  Note that none of the standard GMP_ASM_ autoconf tests are done for
25 dnl  unicos, so none of the config.m4 results can be used here.
26
27 dnl  No underscores on unicos
28 define(`GSYM_PREFIX')
29
30 define(`ASM_START',
31 m4_assert_numargs(0)
32 `       .ident  dummy')
33
34 define(`X',
35 m4_assert_numargs(1)
36 `^X$1')
37
38 define(`FLOAT64',
39 m4_assert_numargs(2)
40 `       .psect  $1@crud,data
41 $1:     .t_floating $2
42         .endp')
43
44 dnl  Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,gp|noalign])
45 dnl          EPILOGUE_cpu(GSYM_PREFIX`'foo)
46
47 define(`PROLOGUE_cpu',
48 m4_assert_numargs_range(1,2)
49 `ifelse(`$2',gp,,
50 `ifelse(`$2',noalign,,
51 `ifelse(`$2',,,`m4_error(`Unrecognised PROLOGUE parameter
52 ')')')')dnl
53         .stack  192             ; What does this mean?  Only Cray knows.
54         .psect  $1@code,code,cache
55 $1::')
56
57 define(`EPILOGUE_cpu',
58 m4_assert_numargs(1)
59 `       .endp')
60
61
62 dnl  Usage: LDGP(dst,src)
63 dnl
64 dnl  Emit an "ldgp dst,src", but only on systems using a GOT (which unicos
65 dnl  doesn't).
66
67 define(LDGP,
68 m4_assert_numargs(2)
69 )
70
71
72 dnl  Usage: EXTERN(variable_name)
73 define(`EXTERN',
74 m4_assert_numargs(1)
75 `       .extern $1')
76
77 define(`DATASTART',
78 m4_assert_numargs(1)
79 `       .psect  $1@crud,data
80 $1:')
81
82 define(`DATAEND',
83 m4_assert_numargs(0)
84 `       .endp')
85
86 define(`ASM_END',
87 m4_assert_numargs(0)
88 `       .end')
89
90 define(`cvttqc',
91 m4_assert_numargs(-1)
92 `cvttq/c')
93
94 dnl  Load a symbolic address into a register
95 define(`LEA',
96 m4_assert_numargs(2)
97         `laum   $1,  $2(r31)
98         sll     $1,  32,   $1
99         lalm    $1,  $2($1)
100         lal     $1,  $2($1)')
101
102
103 dnl  Usage: ALIGN(bytes)
104 dnl
105 dnl  Unicos assembler .align emits zeros, even in code segments, so disable
106 dnl  aligning.
107 dnl
108 dnl  GCC uses a macro emiting nops until the desired alignment is reached
109 dnl  (see unicosmk_file_start in alpha.c).  Could do something like that if
110 dnl  we cared.  The maximum desired alignment must be established at the
111 dnl  start of the section though, since of course emitting nops only
112 dnl  advances relative to the section beginning.
113
114 define(`ALIGN',
115 m4_assert_numargs(1)
116 )
117
118
119 divert