OSDN Git Service

* config/rs6000/rs6000.c (output_toc): Make "offset" HOST_WIDE_INT.
[pf3gnuchains/gcc-fork.git] / gcc / config / rs6000 / vxworks.h
1 /* Definitions of target machine for GNU compiler.  Vxworks PowerPC version.
2    Copyright (C) 1996, 2000, 2002, 2003, 2004, 2005
3    Free Software Foundation, Inc.
4    Contributed by CodeSourcery, LLC.
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2, or (at your option) any later
11 version.
12
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING.  If not, write to the Free
20 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
21 02110-1301, USA.  */
22
23 /* Note to future editors: VxWorks is mostly an EABI target.  We do
24    not use rs6000/eabi.h because we would have to override most of
25    it anyway.  However, if you change that file, consider making
26    analogous changes here too.  */
27
28 #undef TARGET_VERSION
29 #define TARGET_VERSION fprintf (stderr, " (PowerPC VxWorks)");
30
31 /* CPP predefined macros.  */
32
33 #undef TARGET_OS_CPP_BUILTINS
34 #define TARGET_OS_CPP_BUILTINS()                \
35   do                                            \
36     {                                           \
37       builtin_define ("__ppc");                 \
38       builtin_define ("__EABI__");              \
39       builtin_define ("__ELF__");               \
40       builtin_define ("__vxworks");             \
41       builtin_define ("__VXWORKS__");           \
42       if (!TARGET_SOFT_FLOAT)                   \
43         builtin_define ("__hardfp");            \
44       if (flag_pic == 2)                        \
45         {                                       \
46           builtin_define ("__PIC__=2");         \
47           builtin_define ("__pic__=2");         \
48         }                                       \
49       else if (flag_pic == 1)                   \
50         {                                       \
51           builtin_define ("__PIC__=1");         \
52           builtin_define ("__pic__=1");         \
53         }                                       \
54                                                 \
55       /* C89 namespace violation! */            \
56       builtin_define ("CPU_FAMILY=PPC");        \
57     }                                           \
58   while (0)
59
60 /* Only big endian PPC is supported by VxWorks.  */
61 #undef BYTES_BIG_ENDIAN
62 #define BYTES_BIG_ENDIAN 1
63
64 /* We have to kill off the entire specs set created by rs6000/sysv4.h
65    and substitute our own set.  The top level vxworks.h has done some
66    of this for us.  */
67
68 #undef SUBTARGET_EXTRA_SPECS
69 #undef CPP_SPEC
70 #undef CC1_SPEC
71 #undef ASM_SPEC
72
73 #define SUBTARGET_EXTRA_SPECS /* none needed */
74
75 /* FIXME: The only reason we allow no -mcpu switch at all is because
76    config-ml.in insists on a "." multilib. */
77 #define CPP_SPEC \
78 "%{!DCPU=*:               \
79    %{mcpu=403 : -DCPU=PPC403  ; \
80      mcpu=405 : -DCPU=PPC405  ; \
81      mcpu=440 : -DCPU=PPC440  ; \
82      mcpu=603 : -DCPU=PPC603  ; \
83      mcpu=604 : -DCPU=PPC604  ; \
84      mcpu=860 : -DCPU=PPC860  ; \
85      mcpu=8540: -DCPU=PPC85XX ; \
86               : -DCPU=PPC604  }}" \
87 VXWORKS_ADDITIONAL_CPP_SPEC
88
89 #define CC1_SPEC                                                \
90 "%{G*} %{mno-sdata:-msdata=none} %{msdata:-msdata=default}      \
91  %{mlittle|mlittle-endian:-mstrict-align}                       \
92  %{profile: -p}         \
93  %{fvec:-maltivec} %{fvec-eabi:-maltivec -mabi=altivec}"
94
95 #define ASM_SPEC \
96 "%(asm_cpu) \
97  %{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
98  %{v:-v} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
99  %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} -mbig"
100
101 #undef  LIB_SPEC
102 #define LIB_SPEC VXWORKS_LIB_SPEC
103 #undef  LINK_SPEC
104 #define LINK_SPEC VXWORKS_LINK_SPEC
105 #undef  STARTFILE_SPEC
106 #define STARTFILE_SPEC VXWORKS_STARTFILE_SPEC
107 #undef  ENDFILE_SPEC
108 #define ENDFILE_SPEC VXWORKS_ENDFILE_SPEC
109
110 /* There is no default multilib.  */
111 #undef MULTILIB_DEFAULTS
112
113 #undef TARGET_DEFAULT
114 #define TARGET_DEFAULT \
115   (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_EABI | MASK_STRICT_ALIGN)
116
117 #undef PROCESSOR_DEFAULT
118 #define PROCESSOR_DEFAULT PROCESSOR_PPC604
119
120 /* Nor sdata, for kernel mode.  We use this in
121    SUBSUBTARGET_INITIALIZE_OPTIONS, after rs6000_rtp has been initialized.  */
122 #undef SDATA_DEFAULT_SIZE
123 #define SDATA_DEFAULT_SIZE (TARGET_VXWORKS_RTP ? 8 : 0)
124
125 #undef  STACK_BOUNDARY
126 #define STACK_BOUNDARY (16*BITS_PER_UNIT)
127 /* Override sysv4.h, reset to the default.  */
128 #undef  PREFERRED_STACK_BOUNDARY
129
130 /* Enable SPE */
131 #undef TARGET_SPE_ABI
132 #undef TARGET_SPE
133 #undef TARGET_E500
134 #undef TARGET_ISEL
135 #undef TARGET_FPRS
136
137 #define TARGET_SPE_ABI rs6000_spe_abi
138 #define TARGET_SPE rs6000_spe
139 #define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540)
140 #define TARGET_ISEL rs6000_isel
141 #define TARGET_FPRS (!rs6000_float_gprs)
142
143 /* Make -mcpu=8540 imply SPE.  ISEL is automatically enabled, the
144    others must be done by hand.  Handle -mrtp.  Disable -fPIC
145    for -mrtp - the VxWorks PIC model is not compatible with it.  */
146 #undef SUBSUBTARGET_OVERRIDE_OPTIONS
147 #define SUBSUBTARGET_OVERRIDE_OPTIONS           \
148   do {                                          \
149     if (TARGET_E500)                            \
150       {                                         \
151         rs6000_spe = 1;                         \
152         rs6000_spe_abi = 1;                     \
153         rs6000_float_gprs = 1;                  \
154       }                                         \
155                                                 \
156   if (!g_switch_set)                            \
157     g_switch_value = SDATA_DEFAULT_SIZE;        \
158   VXWORKS_OVERRIDE_OPTIONS;                     \
159   } while (0)
160
161 /* No _mcount profiling on VxWorks.  */
162 #undef FUNCTION_PROFILER
163 #define FUNCTION_PROFILER(FILE,LABELNO) VXWORKS_FUNCTION_PROFILER(FILE,LABELNO)