]>
Commit | Line | Data |
---|---|---|
70beb075 RS |
1 | /* Definitions of target machine for GNU compiler. |
2 | Commodore Amiga A3000UX version. | |
3 | ||
016c8440 | 4 | Copyright (C) 1991, 1993, 2000 Free Software Foundation, Inc. |
70beb075 RS |
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 | |
c30b6330 | 10 | the Free Software Foundation; either version 2, or (at your option) |
70beb075 RS |
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 | |
0e29e3c9 RK |
20 | the Free Software Foundation, 59 Temple Place - Suite 330, |
21 | Boston, MA 02111-1307, USA. */ | |
70beb075 | 22 | |
57e51b0e | 23 | #include "m68k/m68kv4.h" |
70beb075 | 24 | |
0736d253 RS |
25 | /* rhealey@aggregate.com says dots are no good either. */ |
26 | #define NO_DOT_IN_LABEL | |
4cfe7532 | 27 | |
08611787 RS |
28 | /* Alter assembler syntax for fsgldiv and fsglmul. |
29 | It is highly likely that this is a generic SGS m68k assembler dependency. | |
b4226a3f | 30 | If so, it should eventually be handled in the m68k/sgs.h ASM_OUTPUT_OPCODE |
08611787 | 31 | macro, like the other SGS assembler quirks. -fnf */ |
348affc3 | 32 | |
08611787 RS |
33 | #define FSGLDIV_USE_S /* Use fsgldiv.s, not fsgldiv.x */ |
34 | #define FSGLMUL_USE_S /* Use fsglmul.s, not fsglmul.x */ | |
348affc3 | 35 | |
70beb075 RS |
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 | |
7a1929e1 | 39 | AMIX isn't. */ |
70beb075 RS |
40 | |
41 | #undef CPP_PREDEFINES | |
42 | #define CPP_PREDEFINES \ | |
4381295b | 43 | "-Dm68k -Dunix -DAMIX -D__svr4__ -D__motorola__ \ |
2b57e919 | 44 | -Amachine=m68k -Acpu=m68k -Asystem=unix -Alint=off" |
70beb075 | 45 | |
70beb075 RS |
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 | |
fc3ffe83 | 49 | we want. This difference can be accommodated by making the assembler |
70beb075 RS |
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) */ | |
53 | ||
54 | #undef ASM_OUTPUT_CASE_END | |
55 | #define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE) \ | |
56 | do { \ | |
fc3ffe83 | 57 | if (switch_table_difference_label_flag) \ |
016c8440 | 58 | asm_fprintf ((FILE), "%s%LLD%d,%LL%d\n", SET_ASM_OP, (NUM), (NUM));\ |
c4c120b4 | 59 | switch_table_difference_label_flag = 0; \ |
70beb075 RS |
60 | } while (0) |
61 | ||
fc3ffe83 RK |
62 | int switch_table_difference_label_flag; |
63 | ||
70beb075 RS |
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] */ | |
71 | ||
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) | |
79 | ||
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] */ | |
87 | ||
88 | #undef ASM_OUTPUT_ALIGNED_LOCAL | |
89 | #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ | |
90 | do { \ | |
016c8440 | 91 | fprintf ((FILE), "%s%s,%u,%u\n", \ |
70beb075 RS |
92 | BSS_ASM_OP, (NAME), (SIZE), MAX ((ALIGN) / BITS_PER_UNIT, 4)); \ |
93 | } while (0) | |
94 | ||
b4226a3f | 95 | /* This definition of ASM_OUTPUT_ASCII is the same as the one in m68k/sgs.h, |
70beb075 RS |
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 | |
7a1929e1 | 98 | strings that it emits (such as .string "\"%s\"\n"). */ |
70beb075 RS |
99 | |
100 | #undef ASM_OUTPUT_ASCII | |
101 | #define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \ | |
9e269f72 | 102 | do { \ |
9d955c3a | 103 | register size_t sp = 0, limit = (LEN); \ |
301d03af | 104 | fputs (integer_asm_op (1, TRUE), (FILE)); \ |
70beb075 | 105 | do { \ |
9d955c3a | 106 | int ch = (PTR)[sp]; \ |
70beb075 RS |
107 | if (ch > ' ' && ! (ch & 0x80) && ch != '\\') \ |
108 | { \ | |
109 | fprintf ((FILE), "'%c", ch); \ | |
110 | } \ | |
111 | else \ | |
112 | { \ | |
113 | fprintf ((FILE), "0x%x", ch); \ | |
114 | } \ | |
9d955c3a | 115 | if (++sp < limit) \ |
70beb075 RS |
116 | { \ |
117 | if ((sp % 10) == 0) \ | |
118 | { \ | |
301d03af | 119 | fprintf ((FILE), "\n%s", integer_asm_op (1, TRUE)); \ |
70beb075 RS |
120 | } \ |
121 | else \ | |
122 | { \ | |
123 | putc (',', (FILE)); \ | |
124 | } \ | |
125 | } \ | |
9d955c3a | 126 | } while (sp < limit); \ |
70beb075 | 127 | putc ('\n', (FILE)); \ |
9e269f72 | 128 | } while (0) |
f5bbc09d | 129 | \f |
0736d253 RS |
130 | /* The following should be unnecessary as a result of PIC_CASE_VECTOR_ADDRESS. |
131 | But rhealey@aggregate.com says they are still needed. */ | |
f01d4c3d | 132 | |
f5bbc09d RS |
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 */ | |
136 | ||
137 | #undef ASM_GENERATE_INTERNAL_LABEL | |
138 | #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ | |
046b71ed | 139 | do { \ |
f5bbc09d | 140 | if (flag_pic && !strcmp(PREFIX,"LC")) \ |
046b71ed | 141 | sprintf (LABEL, "*%s%%%ld", PREFIX, (long)(NUM)); \ |
f5bbc09d | 142 | else \ |
046b71ed KG |
143 | sprintf (LABEL, "*%s%s%ld", LOCAL_LABEL_PREFIX, PREFIX, (long)(NUM)); \ |
144 | } while (0) |