Switched to GPLv3.
[gnupg.git] / mpi / powerpc32 / syntax.h
1 /* gmp2-2.0.2-ppc/mpn/powerpc-linux/syntax.h   Tue Oct  6 19:27:01 1998 */
2 /* From glibc's sysdeps/unix/sysv/linux/powerpc/sysdep.h */
3 /* Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc.
4  *
5  * This file is part of GnuPG.
6  *
7  * GnuPG is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * GnuPG is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, see <http://www.gnu.org/licenses/>.
19  */
20
21 #define USE_PPC_PATCHES 1
22
23 /* This seems to always be the case on PPC.  */
24 #define ALIGNARG(log2) log2
25 /* For ELF we need the `.type' directive to make shared libs work right.  */
26 #define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg;
27 #define ASM_SIZE_DIRECTIVE(name) .size name,.-name
28 #define ASM_GLOBAL_DIRECTIVE   .globl
29
30 #ifdef __STDC__
31 # define C_LABEL(name) C_SYMBOL_NAME(name)##:
32 #else
33 # define C_LABEL(name) C_SYMBOL_NAME(name)/**/:
34 #endif
35
36 #ifdef __STDC__
37 # define L(body) .L##body
38 #else
39 # define L(body) .L/**/body
40 #endif
41
42 /* No profiling of gmp's assembly for now... */
43 #define CALL_MCOUNT /* no profiling */
44
45 #define        ENTRY(name)                                  \
46   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);                 \
47   ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)        \
48   .align ALIGNARG(2);                                       \
49   C_LABEL(name)                                             \
50   CALL_MCOUNT
51
52 #define EALIGN_W_0  /* No words to insert.  */
53 #define EALIGN_W_1  nop
54 #define EALIGN_W_2  nop;nop
55 #define EALIGN_W_3  nop;nop;nop
56 #define EALIGN_W_4  EALIGN_W_3;nop
57 #define EALIGN_W_5  EALIGN_W_4;nop
58 #define EALIGN_W_6  EALIGN_W_5;nop
59 #define EALIGN_W_7  EALIGN_W_6;nop
60
61 /* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
62    past a 2^align boundary.  */
63 #define EALIGN(name, alignt, words)                     \
64   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);             \
65   ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)    \
66   .align ALIGNARG(alignt);                              \
67   EALIGN_W_##words;                                     \
68   C_LABEL(name)
69
70 #undef END
71 #define END(name)                    \
72   ASM_SIZE_DIRECTIVE(name)
73