OSDN Git Service

(ASM_OUTPUT_ASCII): Wrap in `do { ... } while (0)'.
[pf3gnuchains/gcc-fork.git] / gcc / config / m68k / amix.h
1 /* Definitions of target machine for GNU compiler.
2    Commodore Amiga A3000UX version.
3
4    Copyright (C) 1991, 1993 Free Software Foundation, Inc.
5
6 This file is part of GNU CC.
7
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 1, or (at your option)
11 any later version.
12
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
21
22 #include "m68k/m68kv4.h"
23
24 /* rhealey@aggregate.com says dots are no good either.  */
25 #define NO_DOT_IN_LABEL
26
27 /* Alter assembler syntax for fsgldiv and fsglmul.
28    It is highly likely that this is a generic SGS m68k assembler dependency.
29    If so, it should eventually be handled in the m68k/sgs.h ASM_OUTPUT_OPCODE
30    macro, like the other SGS assembler quirks.  -fnf */
31
32 #define FSGLDIV_USE_S           /* Use fsgldiv.s, not fsgldiv.x */
33 #define FSGLMUL_USE_S           /* Use fsglmul.s, not fsglmul.x */
34
35 /* Names to predefine in the preprocessor for this target machine.  For the
36    Amiga, these definitions match those of the native AT&T compiler.  Note
37    that we override the definition in m68kv4.h, where SVR4 is defined and
38    AMIX isn't. */
39
40 #undef CPP_PREDEFINES
41 #define CPP_PREDEFINES \
42   "-Dm68k -Dunix -DAMIX -D__svr4__ -D__motorola__ \
43  -Amachine(m68k) -Acpu(m68k) -Asystem(unix) -Alint(off)"
44
45 /* At end of a switch table, define LDnnn iff the symbol LInnn was defined.
46    Some SGS assemblers have a bug such that "Lnnn-LInnn-2.b(pc,d0.l*2)"
47    fails to assemble.  Luckily "Lnnn(pc,d0.l*2)" produces the results
48    we want.  This difference can be accommodated by making the assembler
49    define such "LDnnn" to be either "Lnnn-LInnn-2.b", "Lnnn", or any other
50    string, as necessary.  This is accomplished via the ASM_OUTPUT_CASE_END
51    macro. (the Amiga assembler has this bug) */
52
53 #undef ASM_OUTPUT_CASE_END
54 #define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE)                             \
55 do {                                                                    \
56   if (switch_table_difference_label_flag)                               \
57     asm_fprintf ((FILE), "\t%s %LLD%d,%LL%d\n", SET_ASM_OP, (NUM), (NUM));\
58   switch_table_difference_label_flag = 0;                               \
59 } while (0)
60
61 int switch_table_difference_label_flag;
62
63 /* This says how to output assembler code to declare an
64    uninitialized external linkage data object.  Under SVR4,
65    the linker seems to want the alignment of data objects
66    to depend on their types.  We do exactly that here.
67    [This macro overrides the one in svr4.h because the amix assembler
68     has a minimum default alignment of 4, and will not accept any
69     explicit alignment smaller than this.  -fnf] */
70
71 #undef ASM_OUTPUT_ALIGNED_COMMON
72 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN)              \
73 do {                                                                    \
74   fputs ("\t.comm\t", (FILE));                                          \
75   assemble_name ((FILE), (NAME));                                       \
76   fprintf ((FILE), ",%u,%u\n", (SIZE), MAX ((ALIGN) / BITS_PER_UNIT, 4)); \
77 } while (0)
78
79 /* This says how to output assembler code to declare an
80    uninitialized internal linkage data object.  Under SVR4,
81    the linker seems to want the alignment of data objects
82    to depend on their types.  We do exactly that here.
83    [This macro overrides the one in svr4.h because the amix assembler
84     has a minimum default alignment of 4, and will not accept any
85     explicit alignment smaller than this.  -fnf] */
86
87 #undef ASM_OUTPUT_ALIGNED_LOCAL
88 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN)               \
89 do {                                                                    \
90   fprintf ((FILE), "\t%s\t%s,%u,%u\n",                                  \
91            BSS_ASM_OP, (NAME), (SIZE), MAX ((ALIGN) / BITS_PER_UNIT, 4)); \
92 } while (0)
93
94 /* This definition of ASM_OUTPUT_ASCII is the same as the one in m68k/sgs.h,
95    which has been overridden by the one in svr4.h.  However, we can't use
96    the one in svr4.h because the amix assembler croaks on some of the
97    strings that it emits (such as .string "\"%s\"\n"). */
98
99 #undef ASM_OUTPUT_ASCII
100 #define ASM_OUTPUT_ASCII(FILE,PTR,LEN)                          \
101 do {                                                            \
102   register int sp = 0, lp = 0, ch;                              \
103   fprintf ((FILE), "\t%s ", BYTE_ASM_OP);                       \
104   do {                                                          \
105     ch = (PTR)[sp];                                             \
106     if (ch > ' ' && ! (ch & 0x80) && ch != '\\')                \
107       {                                                         \
108         fprintf ((FILE), "'%c", ch);                            \
109       }                                                         \
110     else                                                        \
111       {                                                         \
112         fprintf ((FILE), "0x%x", ch);                           \
113       }                                                         \
114     if (++sp < (LEN))                                           \
115       {                                                         \
116         if ((sp % 10) == 0)                                     \
117           {                                                     \
118             fprintf ((FILE), "\n\t%s ", BYTE_ASM_OP);           \
119           }                                                     \
120         else                                                    \
121           {                                                     \
122             putc (',', (FILE));                                 \
123           }                                                     \
124       }                                                         \
125   } while (sp < (LEN));                                         \
126   putc ('\n', (FILE));                                          \
127 } while (0)
128 \f
129 /* The following should be unnecessary as a result of PIC_CASE_VECTOR_ADDRESS.
130    But rhealey@aggregate.com says they are still needed.  */
131
132 /* Override these for the sake of an assembler bug: the Amix
133    assembler can't handle .LC0@GOT syntax.  This pollutes the final
134    table for shared librarys but what's a poor soul to do; sigh... RFH */
135
136 #undef ASM_GENERATE_INTERNAL_LABEL
137 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)   \
138   if (flag_pic && !strcmp(PREFIX,"LC"))                 \
139     sprintf (LABEL, "*%s%%%d", PREFIX, NUM);            \
140   else                                                  \
141     sprintf (LABEL, "*%s%s%d", LOCAL_LABEL_PREFIX, PREFIX, NUM)
142
143 #undef ASM_OUTPUT_INTERNAL_LABEL
144 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)      \
145   if (flag_pic && !strcmp(PREFIX,"LC"))                 \
146     asm_fprintf (FILE, "%s%%%d:\n", PREFIX, NUM);       \
147   else                                                  \
148     asm_fprintf (FILE, "%0L%s%d:\n", PREFIX, NUM)