update copyrights in config dir.
[official-gcc.git] / gcc / config / m68k / amix.h
blob9b40a29248b2b389caffba01c0bfe5d026b90785
1 /* Definitions of target machine for GNU compiler.
2 Commodore Amiga A3000UX version.
4 Copyright (C) 1991, 1993 Free Software Foundation, Inc.
6 This file is part of GNU CC.
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.
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.
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, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 #include "m68k/m68kv4.h"
25 /* rhealey@aggregate.com says dots are no good either. */
26 #define NO_DOT_IN_LABEL
28 /* Alter assembler syntax for fsgldiv and fsglmul.
29 It is highly likely that this is a generic SGS m68k assembler dependency.
30 If so, it should eventually be handled in the m68k/sgs.h ASM_OUTPUT_OPCODE
31 macro, like the other SGS assembler quirks. -fnf */
33 #define FSGLDIV_USE_S /* Use fsgldiv.s, not fsgldiv.x */
34 #define FSGLMUL_USE_S /* Use fsglmul.s, not fsglmul.x */
36 /* Names to predefine in the preprocessor for this target machine. For the
37 Amiga, these definitions match those of the native AT&T compiler. Note
38 that we override the definition in m68kv4.h, where SVR4 is defined and
39 AMIX isn't. */
41 #undef CPP_PREDEFINES
42 #define CPP_PREDEFINES \
43 "-Dm68k -Dunix -DAMIX -D__svr4__ -D__motorola__ \
44 -Amachine(m68k) -Acpu(m68k) -Asystem(unix) -Alint(off)"
46 /* At end of a switch table, define LDnnn iff the symbol LInnn was defined.
47 Some SGS assemblers have a bug such that "Lnnn-LInnn-2.b(pc,d0.l*2)"
48 fails to assemble. Luckily "Lnnn(pc,d0.l*2)" produces the results
49 we want. This difference can be accommodated by making the assembler
50 define such "LDnnn" to be either "Lnnn-LInnn-2.b", "Lnnn", or any other
51 string, as necessary. This is accomplished via the ASM_OUTPUT_CASE_END
52 macro. (the Amiga assembler has this bug) */
54 #undef ASM_OUTPUT_CASE_END
55 #define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE) \
56 do { \
57 if (switch_table_difference_label_flag) \
58 asm_fprintf ((FILE), "\t%s %LLD%d,%LL%d\n", SET_ASM_OP, (NUM), (NUM));\
59 switch_table_difference_label_flag = 0; \
60 } while (0)
62 int switch_table_difference_label_flag;
64 /* This says how to output assembler code to declare an
65 uninitialized external linkage data object. Under SVR4,
66 the linker seems to want the alignment of data objects
67 to depend on their types. We do exactly that here.
68 [This macro overrides the one in svr4.h because the amix assembler
69 has a minimum default alignment of 4, and will not accept any
70 explicit alignment smaller than this. -fnf] */
72 #undef ASM_OUTPUT_ALIGNED_COMMON
73 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
74 do { \
75 fputs ("\t.comm\t", (FILE)); \
76 assemble_name ((FILE), (NAME)); \
77 fprintf ((FILE), ",%u,%u\n", (SIZE), MAX ((ALIGN) / BITS_PER_UNIT, 4)); \
78 } while (0)
80 /* This says how to output assembler code to declare an
81 uninitialized internal linkage data object. Under SVR4,
82 the linker seems to want the alignment of data objects
83 to depend on their types. We do exactly that here.
84 [This macro overrides the one in svr4.h because the amix assembler
85 has a minimum default alignment of 4, and will not accept any
86 explicit alignment smaller than this. -fnf] */
88 #undef ASM_OUTPUT_ALIGNED_LOCAL
89 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
90 do { \
91 fprintf ((FILE), "\t%s\t%s,%u,%u\n", \
92 BSS_ASM_OP, (NAME), (SIZE), MAX ((ALIGN) / BITS_PER_UNIT, 4)); \
93 } while (0)
95 /* This definition of ASM_OUTPUT_ASCII is the same as the one in m68k/sgs.h,
96 which has been overridden by the one in svr4.h. However, we can't use
97 the one in svr4.h because the amix assembler croaks on some of the
98 strings that it emits (such as .string "\"%s\"\n"). */
100 #undef ASM_OUTPUT_ASCII
101 #define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
102 do { \
103 register int sp = 0, lp = 0, ch; \
104 fprintf ((FILE), "\t%s ", BYTE_ASM_OP); \
105 do { \
106 ch = (PTR)[sp]; \
107 if (ch > ' ' && ! (ch & 0x80) && ch != '\\') \
109 fprintf ((FILE), "'%c", ch); \
111 else \
113 fprintf ((FILE), "0x%x", ch); \
115 if (++sp < (LEN)) \
117 if ((sp % 10) == 0) \
119 fprintf ((FILE), "\n\t%s ", BYTE_ASM_OP); \
121 else \
123 putc (',', (FILE)); \
126 } while (sp < (LEN)); \
127 putc ('\n', (FILE)); \
128 } while (0)
130 /* The following should be unnecessary as a result of PIC_CASE_VECTOR_ADDRESS.
131 But rhealey@aggregate.com says they are still needed. */
133 /* Override these for the sake of an assembler bug: the Amix
134 assembler can't handle .LC0@GOT syntax. This pollutes the final
135 table for shared librarys but what's a poor soul to do; sigh... RFH */
137 #undef ASM_GENERATE_INTERNAL_LABEL
138 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
139 if (flag_pic && !strcmp(PREFIX,"LC")) \
140 sprintf (LABEL, "*%s%%%d", PREFIX, NUM); \
141 else \
142 sprintf (LABEL, "*%s%s%d", LOCAL_LABEL_PREFIX, PREFIX, NUM)
144 #undef ASM_OUTPUT_INTERNAL_LABEL
145 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
146 if (flag_pic && !strcmp(PREFIX,"LC")) \
147 asm_fprintf (FILE, "%s%%%d:\n", PREFIX, NUM); \
148 else \
149 asm_fprintf (FILE, "%0L%s%d:\n", PREFIX, NUM)