|
|
1.1 root 1: /* Target definitions for GNU compiler for Intel 80860 running System V.4
2: Copyright (C) 1991 Free Software Foundation, Inc.
3:
4: Written by Ron Guilmette ([email protected]).
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: #include "i860.h"
23: #include "svr4.h"
24:
25: #undef TARGET_VERSION
26: #define TARGET_VERSION fprintf (stderr, " (i860 System V Release 4)");
27:
28: /* Provide a set of pre-definitions and pre-assertions appropriate for
29: the i860 running svr4. Note that the symbol `__SVR4__' MUST BE
30: DEFINED! It is needed so that the va_list struct in va-i860.h
31: will get correctly defined for the svr4 (ABI compliant) case rather
32: than for the previous (svr3, svr2, ...) case. It also needs to be
33: defined so that the correct (svr4) version of __builtin_saveregs
34: will be selected when we are building gnulib2.c.
35: __svr4__ is our extension. */
36:
37: #define CPP_PREDEFINES \
38: "-Di860 -Dunix -DSVR4 -D__svr4__ -Asystem(unix) -Acpu(i860) -Amachine(i860)"
39:
40: /* The prefix to be used in assembler output for all names of registers.
41: This string gets prepended to all i860 register names (svr4 only). */
42:
43: #define I860_REG_PREFIX "%"
44:
45: #define ASM_COMMENT_START "#"
46:
47: #undef TYPE_OPERAND_FMT
48: #define TYPE_OPERAND_FMT "\"%s\""
49:
50: #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
51:
52: /* The following macro definition overrides the one in i860.h
53: because the svr4 i860 assembler requires a different syntax
54: for getting parts of constant/relocatable values. */
55:
56: #undef PRINT_OPERAND_PART
57: #define PRINT_OPERAND_PART(FILE, X, PART_CODE) \
58: do { fprintf (FILE, "["); \
59: output_address (X); \
60: fprintf (FILE, "]@%s", PART_CODE); \
61: } while (0)
62:
63: #undef ASM_FILE_START
64: #define ASM_FILE_START(FILE) \
65: do { output_file_directive (FILE, main_input_filename); \
66: fprintf (FILE, "\t.version\t\"01.01\"\n"); \
67: } while (0)
68:
69: /* Output the special word the svr4 SDB wants to see just before
70: the first word of each function's prologue code. */
71:
72: extern char *current_function_original_name;
73:
74: /* This special macro is used to output a magic word just before the
75: first word of each function. On some versions of UNIX running on
76: the i860, this word can be any word that looks like a NOP, however
77: under svr4, this neds to be an `shr r0,r0,r0' instruction in which
78: the normally unused low-order bits contain the length of the function
79: prologue code (in bytes). This is needed to make the svr4 SDB debugger
80: happy. */
81:
82: #undef ASM_OUTPUT_FUNCTION_PREFIX
83: #define ASM_OUTPUT_FUNCTION_PREFIX(FILE, FNNAME) \
84: do { ASM_OUTPUT_ALIGN (FILE, 2); \
85: fprintf ((FILE), "\t.long\t.ep."); \
86: assemble_name (FILE, FNNAME); \
87: fprintf (FILE, "-"); \
88: assemble_name (FILE, FNNAME); \
89: fprintf (FILE, "+0xc8000000\n"); \
90: current_function_original_name = (FNNAME); \
91: } while (0)
92:
93: /* Output the special label that must go just after each function's
94: prologue code to support svr4 SDB. */
95:
96: #define ASM_OUTPUT_PROLOGUE_SUFFIX(FILE) \
97: do { fprintf (FILE, ".ep."); \
98: assemble_name (FILE, current_function_original_name); \
99: fprintf (FILE, ":\n"); \
100: } while (0)
101:
102: #undef CTORS_SECTION_ASM_OP
1.1.1.2 ! root 103: #define CTORS_SECTION_ASM_OP ".section\t.ctors,\"a\",\"progbits\""
1.1 root 104: #undef DTORS_SECTION_ASM_OP
1.1.1.2 ! root 105: #define DTORS_SECTION_ASM_OP ".section\t.dtors,\"a\",\"progbits\""
1.1 root 106:
107: /* Add definitions to support the .tdesc section as specified in the svr4
108: ABI for the i860. */
109:
1.1.1.2 ! root 110: #define TDESC_SECTION_ASM_OP ".section\t.tdesc"
1.1 root 111:
112: #undef EXTRA_SECTIONS
113: #define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_tdesc
114:
115: #undef EXTRA_SECTION_FUNCTIONS
116: #define EXTRA_SECTION_FUNCTIONS \
117: CONST_SECTION_FUNCTION \
118: CTORS_SECTION_FUNCTION \
119: DTORS_SECTION_FUNCTION \
120: TDESC_SECTION_FUNCTION
121:
122: #define TDESC_SECTION_FUNCTION \
123: void \
124: tdesc_section () \
125: { \
126: if (in_section != in_tdesc) \
127: { \
128: fprintf (asm_out_file, "%s\n", TDESC_SECTION_ASM_OP); \
129: in_section = in_tdesc; \
130: } \
131: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.