|
|
1.1 root 1: /* Configuration for a ns32532 running NetBSD as the target machine.
2: Copyright (C) 1988, 1994 Free Software Foundation, Inc.
3:
4: This file is part of GNU CC.
5:
6: GNU CC is free software; you can redistribute it and/or modify
7: it under the terms of the GNU General Public License as published by
8: the Free Software Foundation; either version 2, or (at your option)
9: any later version.
10:
11: GNU CC is distributed in the hope that it will be useful,
12: but WITHOUT ANY WARRANTY; without even the implied warranty of
13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: GNU General Public License for more details.
15:
16: You should have received a copy of the GNU General Public License
17: along with GNU CC; see the file COPYING. If not, write to
18: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19:
20: $Id: netbsd.h,v 1.2 1994/08/08 23:57:00 kenner Exp $
21: */
22:
23: #include <machine/ansi.h>
24: #include "ns32k/ns32k.h"
25:
26: /* Compile for the floating point unit & 32532 by default;
27: Don't assume SB is zero;
28: Don't use bitfield instructions; */
29:
30: #define TARGET_DEFAULT 121
31:
32: /* 32-bit alignment for efficiency */
33:
34: #undef POINTER_BOUNDARY
35: #define POINTER_BOUNDARY 32
36:
37: /* 32-bit alignment for efficiency */
38:
39: #undef FUNCTION_BOUNDARY
40: #define FUNCTION_BOUNDARY 32
41:
42: /* 32532 spec says it can handle any alignment. Rumor from tm-ns32k.h
43: tells this might not be actually true (but it's for 32032, perhaps
44: National has fixed the bug for 32532). You might have to change this
45: if the bug still exists. */
46:
47: #undef STRICT_ALIGNMENT
48: #define STRICT_ALIGNMENT 0
49:
50: /* Use pc relative addressing whenever possible,
51: it's more efficient than absolute (ns32k.c)
52: You have to fix a bug in gas 1.38.1 to make this work with gas,
53: patch available from [email protected].
54: (NetBSD's gas version has this patch already applied) */
55:
56: #define PC_RELATIVE
57:
58: /* Operand of bsr or jsr should be just the address. */
59:
60: #define CALL_MEMREF_IMPLICIT
61:
62: /* movd insns may have floating point constant operands. */
63:
64: #define MOVD_FLOAT_OK
65:
66: /* Names to predefine in the preprocessor for this target machine. */
67:
68: #undef CPP_PREDEFINES
69: #define CPP_PREDEFINES "-Dns32k -Dns32000 -Dns32532 -D__NetBSD__ -Dunix -Dpc532"
70:
71: /* Specify -k to assembler for pic generation. PIC needs -K too. */
72:
73: #define ASM_SPEC "%{fpic:-k} %{fPIC:-k -K}"
74:
75: #define LINK_SPEC \
76: "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*}"
77:
78: #define STARTFILE_SPEC \
79: "%{!shared:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}"
80:
81: /* No more libg.a; no libraries if making shared object */
82:
83: #define LIB_SPEC "%{!shared:%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}"
84:
85: /* Make gcc agree with <machine/ansi.h> */
86:
87: #undef SIZE_TYPE
88: #define SIZE_TYPE "unsigned int"
89:
90: #undef PTRDIFF_TYPE
91: #define PTRDIFF_TYPE "int"
92:
93: #undef WCHAR_TYPE
94: #define WCHAR_TYPE "int"
95:
96: #define WCHAR_UNSIGNED 0
97:
98: #undef WCHAR_TYPE_SIZE
99: #define WCHAR_TYPE_SIZE 32
100:
101: /* This is BSD, so it wants DBX format. */
102:
103: #define DBX_DEBUGGING_INFO
104:
105: /* Do not break .stabs pseudos into continuations. */
106:
107: #define DBX_CONTIN_LENGTH 0
108:
109: /* This is the char to use for continuation (in case we need to turn
110: continuation back on). */
111:
112: #define DBX_CONTIN_CHAR '?'
113:
114: /* Don't use the `xsfoo;' construct in DBX output; this system
115: doesn't support it. */
116:
117: #define DBX_NO_XREFS
118:
119: /* Don't default to pcc-struct-return, because gcc is the only compiler, and
120: we want to retain compatibility with older gcc versions. */
121:
122: #undef PCC_STATIC_STRUCT_RETURN
123: #define DEFAULT_PCC_STRUCT_RETURN 0
124:
125: /*
126: * Some imports from svr4.h in support of shared libraries.
127: */
128:
129: /* Define the strings used for the special svr4 .type and .size directives.
130: These strings generally do not vary from one system running svr4 to
131: another, but if a given system (e.g. m88k running svr) needs to use
132: different pseudo-op names for these, they may be overridden in the
133: file which includes this one. */
134:
135: #define TYPE_ASM_OP ".type"
136: #define SIZE_ASM_OP ".size"
137: #define WEAK_ASM_OP ".weak"
138:
139: /* The following macro defines the format used to output the second
140: operand of the .type assembler directive. Different svr4 assemblers
141: expect various different forms for this operand. The one given here
142: is just a default. You may need to override it in your machine-
143: specific tm.h file (depending upon the particulars of your assembler). */
144:
145: #define TYPE_OPERAND_FMT "@%s"
146:
147: /* Write the extra assembler code needed to declare a function's result.
148: Most svr4 assemblers don't require any special declaration of the
149: result value, but there are exceptions. */
150:
151: #ifndef ASM_DECLARE_RESULT
152: #define ASM_DECLARE_RESULT(FILE, RESULT)
153: #endif
154:
155: /* These macros generate the special .type and .size directives which
156: are used to set the corresponding fields of the linker symbol table
157: entries in an ELF object file under SVR4. These macros also output
158: the starting labels for the relevant functions/objects. */
159:
160: /* Write the extra assembler code needed to declare a function properly.
161: Some svr4 assemblers need to also have something extra said about the
162: function's return value. We allow for that here. */
163:
164: #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
165: do { \
166: fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
167: assemble_name (FILE, NAME); \
168: putc (',', FILE); \
169: fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
170: putc ('\n', FILE); \
171: ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
172: ASM_OUTPUT_LABEL(FILE, NAME); \
173: } while (0)
174:
175: /* Write the extra assembler code needed to declare an object properly. */
176:
177: #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
178: do { \
179: fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
180: assemble_name (FILE, NAME); \
181: putc (',', FILE); \
182: fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
183: putc ('\n', FILE); \
184: size_directive_output = 0; \
185: if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
186: { \
187: size_directive_output = 1; \
188: fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
189: assemble_name (FILE, NAME); \
190: fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (decl))); \
191: } \
192: ASM_OUTPUT_LABEL(FILE, NAME); \
193: } while (0)
194:
195: /* Output the size directive for a decl in rest_of_decl_compilation
196: in the case where we did not do so before the initializer.
197: Once we find the error_mark_node, we know that the value of
198: size_directive_output was set
199: by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
200:
201: #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
202: do { \
203: char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
204: if (!flag_inhibit_size_directive \
205: && !size_directive_output \
206: && DECL_SIZE (DECL) \
207: && ! AT_END && TOP_LEVEL \
208: && DECL_INITIAL (DECL) == error_mark_node) \
209: { \
210: fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
211: assemble_name (FILE, name); \
212: fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
213: } \
214: } while (0)
215:
216: /* This is how to declare the size of a function. */
217:
218: #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
219: do { \
220: if (!flag_inhibit_size_directive) \
221: { \
222: char label[256]; \
223: static int labelno; \
224: labelno++; \
225: ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
226: ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
227: fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
228: assemble_name (FILE, (FNAME)); \
229: fprintf (FILE, ","); \
230: assemble_name (FILE, label); \
231: fprintf (FILE, "-"); \
232: assemble_name (FILE, (FNAME)); \
233: putc ('\n', FILE); \
234: } \
235: } while (0)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.