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.
6 This file is part of GCC.
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
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
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
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. */
29 #define TARGET_VERSION fprintf (stderr, " (PowerPC VxWorks)");
31 /* CPP predefined macros. */
33 #undef TARGET_OS_CPP_BUILTINS
34 #define TARGET_OS_CPP_BUILTINS() \
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"); \
46 builtin_define ("__PIC__=2"); \
47 builtin_define ("__pic__=2"); \
49 else if (flag_pic == 1) \
51 builtin_define ("__PIC__=1"); \
52 builtin_define ("__pic__=1"); \
55 /* C89 namespace violation! */ \
56 builtin_define ("CPU_FAMILY=PPC"); \
60 /* Only big endian PPC is supported by VxWorks. */
61 #undef BYTES_BIG_ENDIAN
62 #define BYTES_BIG_ENDIAN 1
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
68 #undef SUBTARGET_EXTRA_SPECS
73 #define SUBTARGET_EXTRA_SPECS /* none needed */
75 /* FIXME: The only reason we allow no -mcpu switch at all is because
76 config-ml.in insists on a "." multilib. */
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 ; \
87 VXWORKS_ADDITIONAL_CPP_SPEC
90 "%{G*} %{mno-sdata:-msdata=none} %{msdata:-msdata=default} \
91 %{mlittle|mlittle-endian:-mstrict-align} \
93 %{fvec:-maltivec} %{fvec-eabi:-maltivec -mabi=altivec}"
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"
102 #define LIB_SPEC VXWORKS_LIB_SPEC
104 #define LINK_SPEC VXWORKS_LINK_SPEC
105 #undef STARTFILE_SPEC
106 #define STARTFILE_SPEC VXWORKS_STARTFILE_SPEC
108 #define ENDFILE_SPEC VXWORKS_ENDFILE_SPEC
110 /* There is no default multilib. */
111 #undef MULTILIB_DEFAULTS
113 #undef TARGET_DEFAULT
114 #define TARGET_DEFAULT \
115 (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_EABI | MASK_STRICT_ALIGN)
117 #undef PROCESSOR_DEFAULT
118 #define PROCESSOR_DEFAULT PROCESSOR_PPC604
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)
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
131 #undef TARGET_SPE_ABI
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)
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 \
152 rs6000_spe_abi = 1; \
153 rs6000_float_gprs = 1; \
157 g_switch_value = SDATA_DEFAULT_SIZE; \
158 VXWORKS_OVERRIDE_OPTIONS; \
161 /* No _mcount profiling on VxWorks. */
162 #undef FUNCTION_PROFILER
163 #define FUNCTION_PROFILER(FILE,LABELNO) VXWORKS_FUNCTION_PROFILER(FILE,LABELNO)