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).
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 2, or (at your option)
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
23 #define EXTERNAL_PREFIX '?'
24 #define IMMEDIATE_PREFIX '$'
26 #include "ns32k/ns32k.h"
28 #define SDB_DEBUGGING_INFO
29 #undef DBX_REGISTER_NUMBER
30 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
32 /* Cause long-jump assembler to be used,
33 since otherwise some files fail to be assembled right. */
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
43 #undef ASM_OUTPUT_INTERNAL_LABEL
44 #undef ASM_OUTPUT_LOCAL
46 #undef FUNCTION_BOUNDARY
48 #undef PRINT_OPERAND_ADDRESS
50 #undef FUNCTION_PROFILER
51 #undef ASM_OUTPUT_LABELREF_AS_INT
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 -Asystem(unix) -Acpu(ns32k) -Amachine(ns32k)"
59 /* Ignore certain cpp directives used in header files on sysV. */
60 #define SCCS_DIRECTIVE
62 /* Output #ident as a .ident. */
63 #define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME);
65 /* The .file command should always begin the output. */
66 #define ASM_FILE_START(FILE) \
67 output_file_directive ((FILE), main_input_filename)
69 #define FUNCTION_BOUNDARY 128 /* speed optimization */
72 * The Encore assembler uses ".align 2" to align on 2-byte boundaries.
75 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
76 fprintf (FILE, "\t.align %d\n", 1 << (LOG))
78 /* The Encore assembler doesn't seem to accept the usual second argument
79 and warns that .align may not work in the text section if optimization
81 #undef ASM_OUTPUT_ALIGN_CODE
82 #define ASM_OUTPUT_ALIGN_CODE(FILE)
85 * Internal labels are prefixed with a period.
88 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
89 sprintf (LABEL, "*.%s%d", PREFIX, NUM)
90 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
91 fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
92 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
93 fprintf (FILE, "\t.double .L%d-.LI%d\n", VALUE, REL)
96 * Different syntax for integer constants, double constants, and
97 * uninitialized locals.
100 #define ASM_OUTPUT_INT(FILE,VALUE) \
101 ( fprintf (FILE, "\t.double "), \
102 output_addr_const (FILE, (VALUE)), \
103 fprintf (FILE, "\n"))
105 #define ASM_OUTPUT_LABELREF_AS_INT(STREAM, NAME) \
107 fprintf (STREAM, "\t.double\t"); \
108 ASM_OUTPUT_LABELREF (STREAM, NAME); \
109 fprintf (STREAM, "\n"); \
113 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
114 fprintf (FILE, "\t.long 0f%.20e\n", (VALUE))
116 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
117 ( fputs ("\t.bss ", (FILE)), \
118 assemble_name ((FILE), (NAME)), \
119 fprintf ((FILE), ",%u,%u\n", (SIZE), (ROUNDED)))
122 * Encore assembler can't handle huge string constants like the one in
123 * gcc.c. If the default routine in varasm.c were more conservative, this
124 * code could be eliminated. It starts a new .ascii directive every 40
128 #define ASM_OUTPUT_ASCII(file, p, size) \
131 for (i = 0; i < (size); i++) \
133 register int c = (p)[i]; \
134 if ((i / 40) * 40 == i) \
136 fprintf ((file), "\t.ascii \""); \
138 fprintf ((file), "\"\n\t.ascii \""); \
139 if (c == '\"' || c == '\\') \
140 putc ('\\', (file)); \
141 if (c >= ' ' && c < 0177) \
145 fprintf ((file), "\\%o", c); \
147 && (p)[i + 1] >= '0' && (p)[i + 1] <= '9')\
148 fprintf ((file), "\"\n\t.ascii \""); \
151 fprintf ((file), "\"\n"); \
154 /* Modify syntax of jsr instructions. */
155 #define CALL_MEMREF_IMPLICIT
157 #define NO_ABSOLUTE_PREFIX_IF_SYMBOLIC
159 #define PRINT_OPERAND(FILE, X, CODE) print_operand(FILE, X, CODE)
161 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address(FILE, ADDR)
163 /* Change the way in which data is allocated and initialized on the
164 encore so that both private and shared data are supported. Shared data
165 that is initialized must be contained in the ".shrdata" section
166 of the program. This is accomplished by defining the SHARED_SECTION_ASM_OP
167 macro. Share data that is simply allocated, and not initialized must
168 be prefixed with the ".shrcomm" or ".shrbss" pseudo op, for common or
169 local data respectively. This is accomplished by redefining the
170 ASM_OUTPUT_COMMON and ASM_OUTPUT_LOCAL macros. */
172 /* Assembler pseudo-op for shared data segment. */
174 #define SHARED_SECTION_ASM_OP ".shrdata"
176 /* This says how to output an assembler line
177 to define a shared common symbol. */
179 #define ASM_OUTPUT_SHARED_COMMON(FILE, NAME, SIZE, ROUNDED) \
180 ( fputs (".shrcomm ", (FILE)), \
181 assemble_name ((FILE), (NAME)), \
182 fprintf ((FILE), ",%d\n", (ROUNDED)))
184 /* This says how to output an assembler line
185 to define a shared local symbol. */
187 #define ASM_OUTPUT_SHARED_LOCAL(FILE, NAME, SIZE, ROUNDED) \
188 ( fputs ("\t.shrbss ", (FILE)), \
189 assemble_name ((FILE), (NAME)), \
190 fprintf ((FILE), ",%d,%d\n", (SIZE), (ROUNDED)))
192 #define FUNCTION_PROFILER(FILE, LABELNO) \
193 fprintf (FILE, "\taddr .LP%d,r0\n\tjsr mcount\n", (LABELNO))