OSDN Git Service

(ASM_OUTPUT_ALIGN_CODE): Override to avoid generating a second argument.
[pf3gnuchains/gcc-fork.git] / gcc / config / ns32k / encore.h
1 /* Definitions of target machine for GNU compiler.  ENCORE NS32000 version.
2    Copyright (C) 1988 Free Software Foundation, Inc.
3    Adapted by Robert Brown (brown@harvard.harvard.edu) from the Sequent
4      version by Michael Tiemann (tiemann@mcc.com).
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 2, 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
23 #define EXTERNAL_PREFIX '?'
24 #define IMMEDIATE_PREFIX '$'
25
26 #include "ns32k/ns32k.h"
27
28 #define SDB_DEBUGGING_INFO
29 #undef DBX_REGISTER_NUMBER
30 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
31
32 /* Cause long-jump assembler to be used,
33    since otherwise some files fail to be assembled right.  */
34 #define ASM_SPEC "-j"
35
36 #undef ASM_FILE_START
37 #undef ASM_GENERATE_INTERNAL_LABEL
38 #undef ASM_OUTPUT_ADDR_DIFF_ELT
39 #undef ASM_OUTPUT_ALIGN
40 #undef ASM_OUTPUT_ASCII
41 #undef ASM_OUTPUT_DOUBLE
42 #undef ASM_OUTPUT_INT
43 #undef ASM_OUTPUT_INTERNAL_LABEL
44 #undef ASM_OUTPUT_LOCAL
45 #undef CPP_PREDEFINES
46 #undef FUNCTION_BOUNDARY
47 #undef PRINT_OPERAND
48 #undef PRINT_OPERAND_ADDRESS
49 #undef TARGET_VERSION
50 #undef FUNCTION_PROFILER
51 #undef ASM_OUTPUT_LABELREF_AS_INT
52
53 #define TARGET_DEFAULT 9  /* 32332 with 32081.  */
54 #define TARGET_VERSION fprintf (stderr, " (32000, Encore syntax)");
55 /* Note Encore does not standardly do -Dencore.  */
56 /* budd: should have a -ns32332 (or -apc) switch! but no harm for now */
57 #define CPP_PREDEFINES "-Dns32000 -Dn16 -Dns16000 -Dns32332 -Dunix"
58
59 /* Ignore certain cpp directives used in header files on sysV.  */
60 #define SCCS_DIRECTIVE
61
62 /* Output #ident as a .ident.  */
63 #define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME);
64
65 /* The .file command should always begin the output.  */
66 #define ASM_FILE_START(FILE) \
67 output_file_directive ((FILE), main_input_filename)
68
69 #define FUNCTION_BOUNDARY 128           /* speed optimization */
70
71 /*
72  *  The Encore assembler uses ".align 2" to align on 2-byte boundaries.
73  */
74
75 #define ASM_OUTPUT_ALIGN(FILE,LOG)                                      \
76         fprintf (FILE, "\t.align %d\n", 1 << (LOG))
77
78 /* The Encore assembler doesn't seem to accept this syntax.  */
79 #undef ASM_OUTPUT_ALIGN_CODE
80 #define ASM_OUTPUT_ALIGN_CODE(FILE)     \
81   fprintf (FILE, "\t.align 2\n")
82
83 /*
84  *  Internal labels are prefixed with a period.
85  */
86
87 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)                   \
88         sprintf (LABEL, "*.%s%d", PREFIX, NUM)
89 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)                      \
90         fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
91 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)                      \
92         fprintf (FILE, "\t.word .L%d-.LI%d\n", VALUE, REL)
93
94 /*
95  *  Different syntax for integer constants, double constants, and
96  *  uninitialized locals.
97  */
98
99 #define ASM_OUTPUT_INT(FILE,VALUE)                              \
100 ( fprintf (FILE, "\t.double "),                                 \
101   output_addr_const (FILE, (VALUE)),                            \
102   fprintf (FILE, "\n"))
103
104 #define ASM_OUTPUT_LABELREF_AS_INT(STREAM, NAME)                        \
105 do {                                                                    \
106   fprintf (STREAM, "\t.double\t");                                      \
107   ASM_OUTPUT_LABELREF (STREAM, NAME);                                   \
108   fprintf (STREAM, "\n");                                               \
109 } while (0)
110
111
112 #define ASM_OUTPUT_DOUBLE(FILE,VALUE)                           \
113  fprintf (FILE, "\t.long 0f%.20e\n", (VALUE))
114
115 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)             \
116 ( fputs ("\t.bss ", (FILE)),                                    \
117   assemble_name ((FILE), (NAME)),                               \
118   fprintf ((FILE), ",%u,%u\n", (SIZE), (ROUNDED)))
119
120  /*
121   *  Encore assembler can't handle huge string constants like the one in
122   *  gcc.c.  If the default routine in varasm.c were more conservative, this
123   *  code could be eliminated.  It starts a new .ascii directive every 40
124   *  characters.
125   */
126
127 #define ASM_OUTPUT_ASCII(file, p, size)                 \
128 {                                                       \
129   for (i = 0; i < (size); i++)                          \
130     {                                                   \
131       register int c = (p)[i];                          \
132       if ((i / 40) * 40 == i)                           \
133       if (i == 0)                                       \
134         fprintf ((file), "\t.ascii \"");                \
135       else                                              \
136         fprintf ((file), "\"\n\t.ascii \"");            \
137       if (c == '\"' || c == '\\')                       \
138         putc ('\\', (file));                            \
139       if (c >= ' ' && c < 0177)                         \
140         putc (c, (file));                               \
141       else                                              \
142         {                                               \
143           fprintf ((file), "\\%o", c);                  \
144           if (i < (size) - 1                            \
145               && (p)[i + 1] >= '0' && (p)[i + 1] <= '9')\
146           fprintf ((file), "\"\n\t.ascii \"");          \
147         }                                               \
148     }                                                   \
149   fprintf ((file), "\"\n");                             \
150 }
151
152 /* Modify syntax of jsr instructions.  */
153 #define CALL_MEMREF_IMPLICIT
154
155 #define NO_ABSOLUTE_PREFIX_IF_SYMBOLIC
156
157 #define PRINT_OPERAND(FILE, X, CODE) print_operand(FILE, X, CODE)
158
159 #define PRINT_OPERAND_ADDRESS(FILE, ADDR)  print_operand_address(FILE, ADDR)
160 \f
161 /* Change the way in which data is allocated and initialized on the
162    encore so that both private and shared data are supported.  Shared data
163    that is initialized must be contained in the ".shrdata" section
164    of the program.  This is accomplished by defining the SHARED_SECTION_ASM_OP
165    macro.  Share data that is simply allocated, and not initialized must
166    be prefixed with the ".shrcomm" or ".shrbss" pseudo op, for common or
167    local data respectively.  This is accomplished by redefining the
168    ASM_OUTPUT_COMMON and ASM_OUTPUT_LOCAL macros. */
169     
170 /* Assembler pseudo-op for shared data segment. */
171
172 #define SHARED_SECTION_ASM_OP ".shrdata"
173
174 /* This says how to output an assembler line
175    to define a shared common symbol. */
176
177 #define ASM_OUTPUT_SHARED_COMMON(FILE, NAME, SIZE, ROUNDED) \
178 ( fputs (".shrcomm ", (FILE)),                  \
179   assemble_name ((FILE), (NAME)),               \
180   fprintf ((FILE), ",%d\n", (ROUNDED)))
181
182 /* This says how to output an assembler line
183    to define a shared local symbol. */
184
185 #define ASM_OUTPUT_SHARED_LOCAL(FILE, NAME, SIZE, ROUNDED) \
186 ( fputs ("\t.shrbss ", (FILE)),                         \
187   assemble_name ((FILE), (NAME)),                       \
188   fprintf ((FILE), ",%d,%d\n", (SIZE), (ROUNDED)))
189
190 #define FUNCTION_PROFILER(FILE, LABELNO)  \
191    fprintf (FILE, "\taddr .LP%d,r0\n\tjsr mcount\n", (LABELNO))
192
193 #define ENCORE_ASM