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. */
27 #define TARGET_VERSION fprintf (stderr, " (i386 Sequent Dynix/ptx Version 4)");
29 /* The svr4 ABI for the i386 says that records and unions are returned
32 #undef RETURN_IN_MEMORY
33 #define RETURN_IN_MEMORY(TYPE) \
34 (TYPE_MODE (TYPE) == BLKmode \
35 || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
37 /* Define which macros to predefine. _SEQUENT_ is our extension. */
38 /* This used to define X86, but james@bigtex.cactus.org says that
39 is supposed to be defined optionally by user programs--not by default. */
40 #define CPP_PREDEFINES \
41 "-Dunix -D_SEQUENT_ -Asystem=unix -Asystem=ptx4"
43 /* This is how to output assembly code to define a `float' constant.
44 We always have to use a .long pseudo-op to do this because the native
45 SVR4 ELF assembler is buggy and it generates incorrect values when we
46 try to use the .float pseudo-op instead. */
48 #undef ASM_OUTPUT_FLOAT
49 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
51 REAL_VALUE_TO_TARGET_SINGLE ((VALUE), value); \
52 if (sizeof (int) == sizeof (long)) \
53 fprintf((FILE), "%s0x%x\n", ASM_LONG, value); \
55 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value); \
58 /* This is how to output assembly code to define a `double' constant.
59 We always have to use a pair of .long pseudo-ops to do this because
60 the native SVR4 ELF assembler is buggy and it generates incorrect
61 values when we try to use the .double pseudo-op instead. */
63 #undef ASM_OUTPUT_DOUBLE
64 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
66 REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), value); \
67 if (sizeof (int) == sizeof (long)) \
69 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[0]); \
70 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[1]); \
74 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[0]); \
75 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[1]); \
80 #undef ASM_OUTPUT_LONG_DOUBLE
81 #define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE) \
83 REAL_VALUE_TO_TARGET_LONG_DOUBLE ((VALUE), value); \
84 if (sizeof (int) == sizeof (long)) \
86 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[0]); \
87 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[1]); \
88 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[2]); \
92 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[0]); \
93 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[1]); \
94 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[2]); \
98 #undef DBX_REGISTER_NUMBER
99 #define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
101 /* The routine used to output sequences of byte values. We use a special
102 version of this for most svr4 targets because doing so makes the
103 generated assembly code more compact (and thus faster to assemble)
104 as well as more readable. Note that if we find subparts of the
105 character sequence which end with NUL (and which are shorter than
106 STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */
108 #undef ASM_OUTPUT_ASCII
109 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
112 register const unsigned char *_ascii_bytes = \
113 (const unsigned char *) (STR); \
114 register const unsigned char *limit = _ascii_bytes + (LENGTH); \
115 register unsigned bytes_in_chunk = 0; \
116 for (; _ascii_bytes < limit; _ascii_bytes++) \
118 register const unsigned char *p; \
119 if (bytes_in_chunk >= 64) \
121 fputc ('\n', (FILE)); \
122 bytes_in_chunk = 0; \
124 for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \
126 if (p < limit && (p - _ascii_bytes) <= STRING_LIMIT) \
128 if (bytes_in_chunk > 0) \
130 fputc ('\n', (FILE)); \
131 bytes_in_chunk = 0; \
133 ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \
138 if (bytes_in_chunk == 0) \
139 fprintf ((FILE), "\t.byte\t"); \
141 fputc (',', (FILE)); \
142 fprintf ((FILE), "0x%02x", *_ascii_bytes); \
143 bytes_in_chunk += 5; \
146 if (bytes_in_chunk > 0) \
147 fprintf ((FILE), "\n"); \