OSDN Git Service

2002-04-12 Eric Norum <eric.norum@usask.ca>
[pf3gnuchains/gcc-fork.git] / gcc / config / m68k / pbb.h
1 /* Definitions of target machine for GNU compiler.
2    Citicorp/TTI Unicom PBB version (using GAS with a %-register prefix)
3    Copyright (C) 1987, 1988, 1990, 1996, 1997 Free Software Foundation, Inc.
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 /* Note:   This config uses a version of gas with a postprocessing stage that
23    converts the output of gas to coff containing stab debug symbols.
24    (See vasta@apollo.com or mb@soldev.tti.com) */
25
26 #include "m68k/m68k.h"
27
28 /* See m68k.h.  5 means 68020 without 68881.  */
29
30 #define TARGET_DEFAULT (MASK_BITFIELD|MASK_68020)
31
32 /* Don't try using XFmode.  */
33 #undef LONG_DOUBLE_TYPE_SIZE
34 #define LONG_DOUBLE_TYPE_SIZE 64
35
36 /* Every structure or union's size must be a multiple of 2 bytes.  */
37 #define STRUCTURE_SIZE_BOUNDARY 16
38
39 /* Define __HAVE_68881__ in preprocessor if -m68881 is specified.
40    This will control the use of inline 68881 insns in certain macros.  */
41
42 #define CPP_SPEC "%{m68881:-D__HAVE_68881__}"
43
44 /* Names to predefine in the preprocessor for this target machine.  */
45
46 #define CPP_PREDEFINES "-Dm68k -Dunix -DUnicomPBB -Dmc68k -Dmc68020 -Dmc68k32 -Asystem=unix  -Acpu=m68k -Amachine=m68k"
47
48 /* We want DBX format for use with gdb under COFF.  */
49
50 #define DBX_DEBUGGING_INFO
51
52 /* Generate calls to memcpy, memcmp and memset.  */
53
54 #define TARGET_MEM_FUNCTIONS
55
56 /* -m68000 requires special flags to the assembler.  */
57
58 #define ASM_SPEC \
59  " %{m68000:-mc68010}%{mc68000:-mc68010}"
60
61 /* we use /lib/libp/lib*  when profiling */
62
63 #define LIB_SPEC "%{p:-L/usr/lib/libp} %{pg:-L/usr/lib/libp} -lc"
64
65
66 /* Use crt1.o as a startup file and crtn.o as a closing file.  */
67 /*
68  * The loader directive file gcc.ifile defines how to merge the constructor 
69  * sections into the data section.  Also, since gas only puts out those 
70  * sections in response to N_SETT stabs, and does not (yet) have a 
71  * ".sections" directive, gcc.ifile also defines the list symbols 
72  * __DTOR_LIST__ and __CTOR_LIST__.
73  * 
74  * Finally, we must explicitly specify the file from libgcc.a that defines
75  * exit(), otherwise if the user specifies (for example) "-lc_s" on the 
76  * command line, the wrong exit() will be used and global destructors will 
77  * not get called .
78  */
79
80 #define STARTFILE_SPEC \
81 "%{!r: gcc.ifile%s} %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} \
82 %{!r:_exit.o%s}"
83
84 #define ENDFILE_SPEC "crtn.o%s"
85
86 /* cpp has to support a #sccs directive for the /usr/include files */
87
88 #define SCCS_DIRECTIVE
89
90 /* GAS register prefix assembly syntax: */
91
92 /* User labels have no prefix */
93 #undef  USER_LABEL_PREFIX 
94 #define USER_LABEL_PREFIX ""
95
96 /* local labels are prefixed with ".L" */
97 #undef  LOCAL_LABEL_PREFIX
98 #define LOCAL_LABEL_PREFIX "."
99
100 /* registers are prefixed with "%" */
101 #undef  REGISTER_PREFIX
102 #define REGISTER_PREFIX "%"
103
104 #undef REGISTER_NAMES
105 #define REGISTER_NAMES \
106 {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",        \
107  "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp",        \
108  "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7"}
109
110 #undef FUNCTION_EXTRA_EPILOGUE
111 #define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE)                             \
112 { if (current_function_returns_pointer                                  \
113       && ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode))     \
114       asm_fprintf (FILE, "\tmovl %Rd0,%Ra0\n"); } 
115
116 #define ASM_RETURN_CASE_JUMP \
117   do {                                          \
118     if (TARGET_5200)                            \
119       return "ext%.l %0\n\tjmp %%pc@(2,%0:l)";  \
120     else                                        \
121       return "jmp %%pc@(2,%0:w)";               \
122   } while (0)
123
124 /* Although the gas we use can create .ctor and .dtor sections from N_SETT
125    stabs, it does not support section directives, so we need to have the loader
126    define the lists.
127  */
128 #define CTOR_LISTS_DEFINED_EXTERNALLY
129
130 /* similar to default, but allows for the table defined by ld with gcc.ifile. 
131    nptrs is always 0.  So we need to instead check that __DTOR_LIST__[1] != 0.
132    The old check is left in so that the same macro can be used if and when  
133    a future version of gas does support section directives.  */
134
135 #define DO_GLOBAL_DTORS_BODY {int nptrs = *(int *)__DTOR_LIST__; int i; \
136   if (nptrs == -1 || (__DTOR_LIST__[0] == 0 && __DTOR_LIST__[1] != 0))  \
137     for (nptrs = 0; __DTOR_LIST__[nptrs + 1] != 0; nptrs++);            \
138   for (i = nptrs; i >= 1; i--)                                          \
139     __DTOR_LIST__[i] (); }
140
141 /* 
142  * Here is an example gcc.ifile.  I've tested it on PBB 68k and on sco 386
143  * systems. The NEXT(0x200000) works on just about all 386 and m68k systems, 
144  * but can be reduced to any power of 2 that is >= NBPS (0x10000 on a pbb).
145
146    SECTIONS {
147        .text BIND(0x200200) BLOCK (0x200) : 
148                 { *(.init) *(.text) vfork = fork; *(.fini) }
149
150         GROUP BIND( NEXT(0x200000) + ADDR(.text) + SIZEOF(.text)):
151         {      .data : { __CTOR_LIST__ = . ; . += 4; *(.ctor) . += 4 ;
152                          __DTOR_LIST__ = . ; . += 4; *(.dtor) . += 4 ; }
153                .bss : { }
154        }
155   }
156  */
157
158 /*
159 Local variables:
160 version-control: t
161 End:
162 */