beta-0.89.2
[luatex.git] / source / libs / gmp / gmp-src / mpn / alpha / unicos.m4
blobe05cf5cca6669e2dc7cdce3c1762c4032a35fbdc
1 divert(-1)
3 dnl  m4 macros for alpha assembler on unicos.
6 dnl  Copyright 2000, 2002-2004, 2013 Free Software Foundation, Inc.
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 modify
11 dnl  it under the terms of either:
12 dnl
13 dnl    * the GNU Lesser General Public License as published by the Free
14 dnl      Software Foundation; either version 3 of the License, or (at your
15 dnl      option) any later version.
16 dnl
17 dnl  or
18 dnl
19 dnl    * the GNU General Public License as published by the Free Software
20 dnl      Foundation; either version 2 of the License, or (at your option) any
21 dnl      later version.
22 dnl
23 dnl  or both in parallel, as here.
24 dnl
25 dnl  The GNU MP Library is distributed in the hope that it will be useful, but
26 dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
27 dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
28 dnl  for more details.
29 dnl
30 dnl  You should have received copies of the GNU General Public License and the
31 dnl  GNU Lesser General Public License along with the GNU MP Library.  If not,
32 dnl  see https://www.gnu.org/licenses/.
35 dnl  Note that none of the standard GMP_ASM_ autoconf tests are done for
36 dnl  unicos, so none of the config.m4 results can be used here.
38 dnl  No underscores on unicos
39 define(`GSYM_PREFIX')
41 define(`ASM_START',
42 m4_assert_numargs(0)
43 `       .ident  dummy')
45 define(`X',
46 m4_assert_numargs(1)
47 `^X$1')
49 define(`FLOAT64',
50 m4_assert_numargs(2)
51 `       .psect  $1@crud,data
52 $1:     .t_floating $2
53         .endp')
55 dnl  Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,gp|noalign])
56 dnl          EPILOGUE_cpu(GSYM_PREFIX`'foo)
58 define(`PROLOGUE_cpu',
59 m4_assert_numargs_range(1,2)
60 `ifelse(`$2',gp,,
61 `ifelse(`$2',noalign,,
62 `ifelse(`$2',,,`m4_error(`Unrecognised PROLOGUE parameter
63 ')')')')dnl
64         .stack  192             ; What does this mean?  Only Cray knows.
65         .psect  $1@code,code,cache
66 $1::')
68 define(`EPILOGUE_cpu',
69 m4_assert_numargs(1)
70 `       .endp')
73 dnl  Usage: LDGP(dst,src)
74 dnl
75 dnl  Emit an "ldgp dst,src", but only on systems using a GOT (which unicos
76 dnl  doesn't).
78 define(LDGP,
79 m4_assert_numargs(2)
83 dnl  Usage: EXTERN(variable_name)
84 define(`EXTERN',
85 m4_assert_numargs(1)
86 `       .extern $1')
88 define(`DATASTART',
89 m4_assert_numargs_range(1,2)
90 `       .psect  $1@crud,data
91         ALIGN(ifelse($#,1,2,$2))
92 $1:')
94 define(`DATAEND',
95 m4_assert_numargs(0)
96 `       .endp')
98 define(`ASM_END',
99 m4_assert_numargs(0)
100 `       .end')
102 define(`cvttqc',
103 m4_assert_numargs(-1)
104 `cvttq/c')
106 dnl  Load a symbolic address into a register
107 define(`LEA',
108 m4_assert_numargs(2)
109         `laum   $1,  $2(r31)
110         sll     $1,  32,   $1
111         lalm    $1,  $2($1)
112         lal     $1,  $2($1)')
115 dnl  Usage: ALIGN(bytes)
117 dnl  Unicos assembler .align emits zeros, even in code segments, so disable
118 dnl  aligning.
120 dnl  GCC uses a macro emiting nops until the desired alignment is reached
121 dnl  (see unicosmk_file_start in alpha.c).  Could do something like that if
122 dnl  we cared.  The maximum desired alignment must be established at the
123 dnl  start of the section though, since of course emitting nops only
124 dnl  advances relative to the section beginning.
126 define(`ALIGN',
127 m4_assert_numargs(1)
131 divert