Fix typo.
[glibc.git] / sysdeps / m68k / asm-syntax.h
blobfbb0e2f5d27fd4522c1825e4fb369a40c4dc8642
1 /* Definitions for 68k syntax variations.
2 Copyright (C) 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
4 This file is part of the GNU C Library. Its master source is NOT part of
5 the C library, however. The master source lives in the GNU MP Library.
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
12 The GNU C Library 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 GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with the GNU C Library; see the file COPYING.LIB. If not,
19 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 #ifdef HAVE_ELF
24 /* ELF uses byte-counts for .align, most others use log2 of count of bytes. */
25 #define ALIGNARG(log2) 1<<log2
26 /* For ELF we need the `.type' directive to make shared libs work right. */
27 #define PROLOG(name) .type name,@function
28 #define EPILOG(name) .size name,.-name
29 /* For ELF we need to prefix register names and local labels. */
30 #ifdef __STDC__
31 #define R_(r) %##r
32 #define R(r) R_(r)
33 #define L(label) .##label
34 #else
35 #define R(r) %/**/r
36 #define L(label) ./**/label
37 #endif
39 #else
41 #define ALIGNARG(log2) log2
42 #define PROLOG(name) /* Nothing. */
43 #define EPILOG(name) /* Nothing. */
44 #define R(r) r
45 #define L(label) label
47 #endif
49 #ifdef MIT_SYNTAX
50 #define MEM(base)R(base)@
51 #define MEM_DISP(base,displacement)R(base)@(displacement)
52 #define MEM_INDX(base,idx,size_suffix)R(base)@(R(idx):size_suffix)
53 #define MEM_INDX1(base,idx,size_suffix,scale)R(base)@(R(idx):size_suffix:scale)
54 #define MEM_PREDEC(memory_base)R(memory_base)@-
55 #define MEM_POSTINC(memory_base)R(memory_base)@+
56 #define TEXT .text
57 #define ALIGN .even
58 #define GLOBL .globl
59 /* Use variable sized opcodes. */
60 #define bcc jcc
61 #define bcs jcs
62 #define bls jls
63 #define beq jeq
64 #define bne jne
65 #define bra jra
66 #endif
68 #ifdef MOTOROLA_SYNTAX
69 #define MEM(base)(R(base))
70 #define MEM_DISP(base,displacement)(displacement,R(base))
71 #define MEM_PREDEC(memory_base)-(R(memory_base))
72 #define MEM_POSTINC(memory_base)(R(memory_base))+
73 #ifdef __STDC__
74 #define MEM_INDX_(base,idx,size_suffix)(R(base),R(idx##.##size_suffix))
75 #define MEM_INDX(base,idx,size_suffix)MEM_INDX_(base,idx,size_suffix)
76 #define MEM_INDX1_(base,idx,size_suffix,scale)(R(base),R(idx##.##size_suffix*scale))
77 #define MEM_INDX1(base,idx,size_suffix,scale)MEM_INDX1_(base,idx,size_suffix,scale)
78 #else
79 #define MEM_INDX(base,idx,size_suffix)(R(base),R(idx).size_suffix)
80 #define MEM_INDX1(base,idx,size_suffix,scale)(R(base),R(idx).size_suffix*scale)
81 #endif
82 #define TEXT .text
83 #define ALIGN .align ALIGNARG(2)
84 #define GLOBL .globl
85 #define bcc jbcc
86 #define bcs jbcs
87 #define bls jbls
88 #define beq jbeq
89 #define bne jbne
90 #define bra jbra
91 #define movel move.l
92 #define moveml movem.l
93 #define moveql moveq.l
94 #define cmpl cmp.l
95 #define orl or.l
96 #define clrl clr.l
97 #define eorw eor.w
98 #define lsrl lsr.l
99 #define lsll lsl.l
100 #define roxrl roxr.l
101 #define roxll roxl.l
102 #define addl add.l
103 #define addxl addx.l
104 #define addql addq.l
105 #define subl sub.l
106 #define subxl subx.l
107 #define subql subq.l
108 #define negl neg.l
109 #define mulul mulu.l
110 #endif