* target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op,
[official-gcc.git] / gcc / config / i860 / sysv3.h
blobcc26176c963383483ce807db35a2eaa8c3812eeb
1 /* Target definitions for GNU compiler for Intel 80860 running System V.3
2 Copyright (C) 1991, 1996, 2000 Free Software Foundation, Inc.
3 Contributed by Ron Guilmette (rfg@monkeys.com).
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 #undef TARGET_VERSION
23 #define TARGET_VERSION fprintf (stderr, " (i860, System V Release 3)")
25 /* Provide a set of pre-definitions and pre-assertions appropriate for
26 the i860 running svr3. */
27 #define CPP_PREDEFINES "-Di860 -Dunix -D__svr3__ -Asystem=unix -Asystem=svr3 -Acpu=i860 -Amachine=i860"
29 /* Use crt1.o as a startup file and crtn.o as a closing file. */
31 #define STARTFILE_SPEC \
32 "%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}"
34 #define LIB_SPEC "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} -lc crtn.o%s"
36 /* Special flags for the linker. I don't know what they do. */
38 #define LINK_SPEC "%{T*} %{z:-lm}"
40 /* The prefix to be used in assembler output for all names of registers.
41 None is needed in V.3. */
43 #define I860_REG_PREFIX ""
45 /* Delimiter that starts comments in the assembler code. */
47 #define ASM_COMMENT_START "//"
49 /* Output the special word the System V SDB wants to see just before
50 the first word of each function's prologue code. */
52 extern const char *current_function_original_name;
54 /* This special macro is used to output a magic word just before the
55 first word of each function. On some versions of UNIX running on
56 the i860, this word can be any word that looks like a NOP, however
57 under svr4, this neds to be an `shr r0,r0,r0' instruction in which
58 the normally unused low-order bits contain the length of the function
59 prologue code (in bytes). This is needed to make the System V SDB
60 debugger happy. */
62 #undef ASM_OUTPUT_FUNCTION_PREFIX
63 #define ASM_OUTPUT_FUNCTION_PREFIX(FILE, FNNAME) \
64 do { ASM_OUTPUT_ALIGN (FILE, 2); \
65 fprintf ((FILE), "\t.long\t.ep."); \
66 assemble_name (FILE, FNNAME); \
67 fprintf (FILE, "-"); \
68 assemble_name (FILE, FNNAME); \
69 fprintf (FILE, "+0xc8000000\n"); \
70 current_function_original_name = (FNNAME); \
71 } while (0)
73 /* Output the special label that must go just after each function's
74 prologue code to support svr4 SDB. */
76 #define ASM_OUTPUT_PROLOGUE_SUFFIX(FILE) \
77 do { fprintf (FILE, ".ep."); \
78 assemble_name (FILE, current_function_original_name); \
79 fprintf (FILE, ":\n"); \
80 } while (0)
82 /* This says how to output an assembler line
83 to define a local common symbol.
84 The difference from svr3.h is we don't limit align to 2. */
86 #undef ASM_OUTPUT_LOCAL
87 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
88 do { \
89 int align = exact_log2 (ROUNDED); \
90 data_section (); \
91 ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align); \
92 ASM_OUTPUT_LABEL ((FILE), (NAME)); \
93 fprintf ((FILE), "\t.set .,.+%u\n", (ROUNDED)); \
94 } while (0)
96 /* The routine used to output string literals. */
98 #define ASCII_DATA_ASM_OP "\t.byte\t"
100 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
101 do \
103 register const unsigned char *str = (const unsigned char *) (STR); \
104 register const unsigned char *limit = str + (LENGTH); \
105 register unsigned bytes_in_chunk = 0; \
106 for (; str < limit; str++) \
108 register unsigned ch = *str; \
109 if (ch < 32 || ch == '\\' || ch == '"' || ch >= 127) \
111 if (bytes_in_chunk > 0) \
113 fprintf ((FILE), "\"\n"); \
114 bytes_in_chunk = 0; \
116 assemble_aligned_integer (1, GEN_INT (ch)); \
118 else \
120 if (bytes_in_chunk >= 60) \
122 fprintf ((FILE), "\"\n"); \
123 bytes_in_chunk = 0; \
125 if (bytes_in_chunk == 0) \
126 fprintf ((FILE), "%s\"", ASCII_DATA_ASM_OP); \
127 putc (ch, (FILE)); \
128 bytes_in_chunk++; \
131 if (bytes_in_chunk > 0) \
132 fprintf ((FILE), "\"\n"); \
134 while (0)
137 #undef CTORS_SECTION_ASM_OP
138 #define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"x\""
139 #undef DTORS_SECTION_ASM_OP
140 #define DTORS_SECTION_ASM_OP "\t.section\t.dtors,\"x\""
142 /* Add definitions to support the .tdesc section as specified in the svr4
143 ABI for the i860. */
145 #define TDESC_SECTION_ASM_OP "\t.section\t.tdesc"
147 #undef EXTRA_SECTIONS
148 #define EXTRA_SECTIONS in_const, in_tdesc
150 #undef EXTRA_SECTION_FUNCTIONS
151 #define EXTRA_SECTION_FUNCTIONS \
152 CONST_SECTION_FUNCTION \
153 TDESC_SECTION_FUNCTION
155 #define TDESC_SECTION_FUNCTION \
156 void \
157 tdesc_section () \
159 if (in_section != in_tdesc) \
161 fprintf (asm_out_file, "%s\n", TDESC_SECTION_ASM_OP); \
162 in_section = in_tdesc; \
166 /* Enable the `const' section that svr3.h defines how to use. */
167 #undef USE_CONST_SECTION
168 #define USE_CONST_SECTION 1