OSDN Git Service

2001-10-19 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / ptx4-i.h
1 /* Target definitions for GNU compiler for Intel 80386 running Dynix/ptx v4
2    Copyright (C) 1996 Free Software Foundation, Inc.
3
4    Modified from sysv4.h
5    Originally written by Ron Guilmette (rfg@netcom.com).
6    Modified by Tim Wright (timw@sequent.com).
7
8 This file is part of GNU CC.
9
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)
13 any later version.
14
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.
19
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.  */
24
25
26 #undef TARGET_VERSION
27 #define TARGET_VERSION fprintf (stderr, " (i386 Sequent Dynix/ptx Version 4)");
28
29 /* The svr4 ABI for the i386 says that records and unions are returned
30    in memory.  */
31
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))
36
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"
42
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.  */
47
48 #undef ASM_OUTPUT_FLOAT
49 #define ASM_OUTPUT_FLOAT(FILE,VALUE)                                    \
50 do { long value;                                                        \
51      REAL_VALUE_TO_TARGET_SINGLE ((VALUE), value);                      \
52      if (sizeof (int) == sizeof (long))                                 \
53          fprintf((FILE), "%s0x%x\n", ASM_LONG, value);                  \
54      else                                                               \
55          fprintf((FILE), "%s0x%lx\n", ASM_LONG, value);                 \
56    } while (0)
57
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.  */
62
63 #undef ASM_OUTPUT_DOUBLE
64 #define ASM_OUTPUT_DOUBLE(FILE,VALUE)                                   \
65 do { long value[2];                                                     \
66      REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), value);                      \
67      if (sizeof (int) == sizeof (long))                                 \
68        {                                                                \
69          fprintf((FILE), "%s0x%x\n", ASM_LONG, value[0]);               \
70          fprintf((FILE), "%s0x%x\n", ASM_LONG, value[1]);               \
71        }                                                                \
72      else                                                               \
73        {                                                                \
74          fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[0]);              \
75          fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[1]);              \
76        }                                                                \
77    } while (0)
78
79
80 #undef ASM_OUTPUT_LONG_DOUBLE
81 #define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE)                              \
82 do { long value[3];                                                     \
83      REAL_VALUE_TO_TARGET_LONG_DOUBLE ((VALUE), value);                 \
84      if (sizeof (int) == sizeof (long))                                 \
85        {                                                                \
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]);               \
89        }                                                                \
90      else                                                               \
91        {                                                                \
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]);              \
95        }                                                                \
96    } while (0)
97
98 #undef DBX_REGISTER_NUMBER
99 #define DBX_REGISTER_NUMBER(n)  svr4_dbx_register_map[n]
100
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.  */
107
108 #undef ASM_OUTPUT_ASCII
109 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH)                             \
110   do                                                                    \
111     {                                                                   \
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++)                      \
117         {                                                               \
118           register const unsigned char *p;                              \
119           if (bytes_in_chunk >= 64)                                     \
120             {                                                           \
121               fputc ('\n', (FILE));                                     \
122               bytes_in_chunk = 0;                                       \
123             }                                                           \
124           for (p = _ascii_bytes; p < limit && *p != '\0'; p++)          \
125             continue;                                                   \
126           if (p < limit && (p - _ascii_bytes) <= STRING_LIMIT)          \
127             {                                                           \
128               if (bytes_in_chunk > 0)                                   \
129                 {                                                       \
130                   fputc ('\n', (FILE));                                 \
131                   bytes_in_chunk = 0;                                   \
132                 }                                                       \
133               ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes);         \
134               _ascii_bytes = p;                                         \
135             }                                                           \
136           else                                                          \
137             {                                                           \
138               if (bytes_in_chunk == 0)                                  \
139                 fprintf ((FILE), "\t.byte\t");                          \
140               else                                                      \
141                 fputc (',', (FILE));                                    \
142               fprintf ((FILE), "0x%02x", *_ascii_bytes);                \
143               bytes_in_chunk += 5;                                      \
144             }                                                           \
145         }                                                               \
146       if (bytes_in_chunk > 0)                                           \
147         fprintf ((FILE), "\n");                                         \
148     }                                                                   \
149   while (0)