FSF GCC merge 02/23/03
[official-gcc.git] / gcc / config / m68k / pbb.h
blob68c8d09ead591ea36880f745840fe693c45cefc9
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, 2002 Free Software Foundation, Inc.
5 This file is part of GNU CC.
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.
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.
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. */
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) */
26 #include "m68k/m68k.h"
28 /* See m68k.h. 5 means 68020 without 68881. */
30 #define TARGET_DEFAULT (MASK_BITFIELD|MASK_68020)
32 /* Don't try using XFmode. */
33 #undef LONG_DOUBLE_TYPE_SIZE
34 #define LONG_DOUBLE_TYPE_SIZE 64
36 /* Every structure or union's size must be a multiple of 2 bytes. */
37 #define STRUCTURE_SIZE_BOUNDARY 16
39 /* Define __HAVE_68881__ in preprocessor if -m68881 is specified.
40 This will control the use of inline 68881 insns in certain macros. */
42 #define CPP_SPEC "%{m68881:-D__HAVE_68881__}"
44 /* Names to predefine in the preprocessor for this target machine. */
46 #define CPP_PREDEFINES "-Dm68k -Dunix -DUnicomPBB -Dmc68k -Dmc68020 -Dmc68k32 -Asystem=unix -Acpu=m68k -Amachine=m68k"
48 /* We want DBX format for use with gdb under COFF. */
50 #define DBX_DEBUGGING_INFO 1
52 /* Generate calls to memcpy, memcmp and memset. */
54 #define TARGET_MEM_FUNCTIONS
56 /* -m68000 requires special flags to the assembler. */
58 #define ASM_SPEC \
59 " %{m68000:-mc68010}%{mc68000:-mc68010}"
61 /* we use /lib/libp/lib* when profiling */
63 #define LIB_SPEC "%{p:-L/usr/lib/libp} %{pg:-L/usr/lib/libp} -lc"
66 /* Use crt1.o as a startup file and crtn.o as a closing file. */
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__.
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 .
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}"
84 #define ENDFILE_SPEC "crtn.o%s"
86 /* GAS register prefix assembly syntax: */
88 /* User labels have no prefix */
89 #undef USER_LABEL_PREFIX
90 #define USER_LABEL_PREFIX ""
92 /* local labels are prefixed with ".L" */
93 #undef LOCAL_LABEL_PREFIX
94 #define LOCAL_LABEL_PREFIX "."
96 /* registers are prefixed with "%" */
97 #undef REGISTER_PREFIX
98 #define REGISTER_PREFIX "%"
100 #undef REGISTER_NAMES
101 #define REGISTER_NAMES \
102 {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
103 "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp", \
104 "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7"}
106 #undef FUNCTION_EXTRA_EPILOGUE
107 #define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) \
108 { if (current_function_returns_pointer \
109 && ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \
110 asm_fprintf (FILE, "\tmovl %Rd0,%Ra0\n"); }
112 #define ASM_RETURN_CASE_JUMP \
113 do { \
114 if (TARGET_5200) \
116 if (ADDRESS_REG_P (operands[0])) \
117 return "jmp %%pc@(2,%0:l)"; \
118 else \
119 return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \
121 else \
122 return "jmp %%pc@(2,%0:w)"; \
123 } while (0)
125 /* Although the gas we use can create .ctor and .dtor sections from N_SETT
126 stabs, it does not support section directives, so we need to have the loader
127 define the lists.
129 #define CTOR_LISTS_DEFINED_EXTERNALLY
131 /* similar to default, but allows for the table defined by ld with gcc.ifile.
132 nptrs is always 0. So we need to instead check that __DTOR_LIST__[1] != 0.
133 The old check is left in so that the same macro can be used if and when
134 a future version of gas does support section directives. */
136 #define DO_GLOBAL_DTORS_BODY {int nptrs = *(int *)__DTOR_LIST__; int i; \
137 if (nptrs == -1 || (__DTOR_LIST__[0] == 0 && __DTOR_LIST__[1] != 0)) \
138 for (nptrs = 0; __DTOR_LIST__[nptrs + 1] != 0; nptrs++); \
139 for (i = nptrs; i >= 1; i--) \
140 __DTOR_LIST__[i] (); }
143 * Here is an example gcc.ifile. I've tested it on PBB 68k and on sco 386
144 * systems. The NEXT(0x200000) works on just about all 386 and m68k systems,
145 * but can be reduced to any power of 2 that is >= NBPS (0x10000 on a pbb).
147 SECTIONS {
148 .text BIND(0x200200) BLOCK (0x200) :
149 { *(.init) *(.text) vfork = fork; *(.fini) }
151 GROUP BIND( NEXT(0x200000) + ADDR(.text) + SIZEOF(.text)):
152 { .data : { __CTOR_LIST__ = . ; . += 4; *(.ctor) . += 4 ;
153 __DTOR_LIST__ = . ; . += 4; *(.dtor) . += 4 ; }
154 .bss : { }
160 Local variables:
161 version-control: t
162 End: