1 /* Target definitions for GNU compiler for Intel 80386 running Dynix/ptx v4
2 Copyright (C) 1996 Free Software Foundation, Inc.
5 Originally written by Ron Guilmette (rfg@netcom.com).
6 Modified by Tim Wright (timw@sequent.com).
8 This file is part of GNU CC.
10 GNU CC is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
15 GNU CC is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with GNU CC; see the file COPYING. If not, write to
22 the Free Software Foundation, 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
25 #include "i386/i386.h" /* Base i386 target machine definitions */
26 #include "i386/att.h" /* Use the i386 AT&T assembler syntax */
27 #include "ptx4.h" /* Rest of definitions (non architecture dependent) */
30 #define TARGET_VERSION fprintf (stderr, " (i386 Sequent Dynix/ptx Version 4)");
32 /* The svr4 ABI for the i386 says that records and unions are returned
35 #undef RETURN_IN_MEMORY
36 #define RETURN_IN_MEMORY(TYPE) \
37 (TYPE_MODE (TYPE) == BLKmode \
38 || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
40 /* Define which macros to predefine. _SEQUENT_ is our extension. */
41 /* This used to define X86, but james@bigtex.cactus.org says that
42 is supposed to be defined optionally by user programs--not by default. */
43 #define CPP_PREDEFINES \
44 "-Dunix -D_SEQUENT_ -Asystem=unix -Asystem=ptx4"
46 /* This is how to output assembly code to define a `float' constant.
47 We always have to use a .long pseudo-op to do this because the native
48 SVR4 ELF assembler is buggy and it generates incorrect values when we
49 try to use the .float pseudo-op instead. */
51 #undef ASM_OUTPUT_FLOAT
52 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
54 REAL_VALUE_TO_TARGET_SINGLE ((VALUE), value); \
55 if (sizeof (int) == sizeof (long)) \
56 fprintf((FILE), "%s0x%x\n", ASM_LONG, value); \
58 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value); \
61 /* This is how to output assembly code to define a `double' constant.
62 We always have to use a pair of .long pseudo-ops to do this because
63 the native SVR4 ELF assembler is buggy and it generates incorrect
64 values when we try to use the .double pseudo-op instead. */
66 #undef ASM_OUTPUT_DOUBLE
67 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
69 REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), value); \
70 if (sizeof (int) == sizeof (long)) \
72 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[0]); \
73 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[1]); \
77 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[0]); \
78 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[1]); \
83 #undef ASM_OUTPUT_LONG_DOUBLE
84 #define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE) \
86 REAL_VALUE_TO_TARGET_LONG_DOUBLE ((VALUE), value); \
87 if (sizeof (int) == sizeof (long)) \
89 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[0]); \
90 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[1]); \
91 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[2]); \
95 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[0]); \
96 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[1]); \
97 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[2]); \
101 #undef DBX_REGISTER_NUMBER
102 #define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
104 /* The routine used to output sequences of byte values. We use a special
105 version of this for most svr4 targets because doing so makes the
106 generated assembly code more compact (and thus faster to assemble)
107 as well as more readable. Note that if we find subparts of the
108 character sequence which end with NUL (and which are shorter than
109 STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */
111 #undef ASM_OUTPUT_ASCII
112 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
115 register const unsigned char *_ascii_bytes = \
116 (const unsigned char *) (STR); \
117 register const unsigned char *limit = _ascii_bytes + (LENGTH); \
118 register unsigned bytes_in_chunk = 0; \
119 for (; _ascii_bytes < limit; _ascii_bytes++) \
121 register const unsigned char *p; \
122 if (bytes_in_chunk >= 64) \
124 fputc ('\n', (FILE)); \
125 bytes_in_chunk = 0; \
127 for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \
129 if (p < limit && (p - _ascii_bytes) <= STRING_LIMIT) \
131 if (bytes_in_chunk > 0) \
133 fputc ('\n', (FILE)); \
134 bytes_in_chunk = 0; \
136 ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \
141 if (bytes_in_chunk == 0) \
142 fprintf ((FILE), "\t.byte\t"); \
144 fputc (',', (FILE)); \
145 fprintf ((FILE), "0x%02x", *_ascii_bytes); \
146 bytes_in_chunk += 5; \
149 if (bytes_in_chunk > 0) \
150 fprintf ((FILE), "\n"); \
154 /* This is how to output an element of a case-vector that is relative.
155 This is only used for PIC code. See comments by the `casesi' insn in
156 i386.md for an explanation of the expression this outputs. */
158 #undef ASM_OUTPUT_ADDR_DIFF_ELT
159 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
160 fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
162 /* Indicate that jump tables go in the text section. This is
163 necessary when compiling PIC code. */
165 #define JUMP_TABLES_IN_TEXT_SECTION 1