1 /* Target definitions for GNU compiler for Intel 80386 running System V.4
2 Copyright (C) 1991, 2001, 2002 Free Software Foundation, Inc.
4 Written by Ron Guilmette (rfg@netcom.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, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
24 #define TARGET_VERSION fprintf (stderr, " (i386 System V Release 4)");
26 /* The svr4 ABI for the i386 says that records and unions are returned
29 #undef RETURN_IN_MEMORY
30 #define RETURN_IN_MEMORY(TYPE) \
31 (TYPE_MODE (TYPE) == BLKmode \
32 || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
34 /* Define which macros to predefine. __svr4__ is our extension. */
35 /* This used to define X86, but james@bigtex.cactus.org says that
36 is supposed to be defined optionally by user programs--not by default. */
37 #define CPP_PREDEFINES \
38 "-Dunix -D__svr4__ -Asystem=unix -Asystem=svr4"
40 /* Output at beginning of assembler file. */
41 /* The .file command should always begin the output. */
44 #define ASM_FILE_START(FILE) \
46 output_file_directive (FILE, main_input_filename); \
47 fprintf (FILE, "\t.version\t\"01.01\"\n"); \
50 #undef DBX_REGISTER_NUMBER
51 #define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
53 /* The routine used to output sequences of byte values. We use a special
54 version of this for most svr4 targets because doing so makes the
55 generated assembly code more compact (and thus faster to assemble)
56 as well as more readable. Note that if we find subparts of the
57 character sequence which end with NUL (and which are shorter than
58 STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */
60 #undef ASM_OUTPUT_ASCII
61 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
64 register const unsigned char *_ascii_bytes = \
65 (const unsigned char *) (STR); \
66 register const unsigned char *limit = _ascii_bytes + (LENGTH); \
67 register unsigned bytes_in_chunk = 0; \
68 for (; _ascii_bytes < limit; _ascii_bytes++) \
70 register const unsigned char *p; \
71 if (bytes_in_chunk >= 64) \
73 fputc ('\n', (FILE)); \
76 for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \
78 if (p < limit && (p - _ascii_bytes) <= (long) STRING_LIMIT) \
80 if (bytes_in_chunk > 0) \
82 fputc ('\n', (FILE)); \
85 ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \
90 if (bytes_in_chunk == 0) \
91 fprintf ((FILE), "\t.byte\t"); \
93 fputc (',', (FILE)); \
94 fprintf ((FILE), "0x%02x", *_ascii_bytes); \
95 bytes_in_chunk += 5; \
98 if (bytes_in_chunk > 0) \
99 fprintf ((FILE), "\n"); \
103 /* A C statement (sans semicolon) to output to the stdio stream
104 FILE the assembler definition of uninitialized global DECL named
105 NAME whose size is SIZE bytes and alignment is ALIGN bytes.
106 Try to use asm_output_aligned_bss to implement this macro. */
108 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
109 asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
111 /* Handle special EH pointer encodings. Absolute, pc-relative, and
112 indirect are handled automatically. */
113 #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
115 if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
117 fputs (ASM_LONG, FILE); \
118 assemble_name (FILE, XSTR (ADDR, 0)); \
119 fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
124 /* Used by crtstuff.c to initialize the base of data-relative relocations.
125 These are GOT relative on x86, so return the pic register. */
127 #define CRT_GET_RFIB_DATA(BASE) \
129 register void *ebx_ __asm__("ebx"); \
133 #define CRT_GET_RFIB_DATA(BASE) \
134 __asm__ ("call\t.LPR%=\n" \
137 /* Due to a GAS bug, this cannot use EAX. That encodes \
138 smaller than the traditional EBX, which results in the \
139 offset being off by one. */ \
140 "addl\t$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0" \
145 #define CPP_SPEC "%(cpp_cpu)"