aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/rs6000/vxworks.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/rs6000/vxworks.h')
-rw-r--r--gcc/config/rs6000/vxworks.h191
1 files changed, 136 insertions, 55 deletions
diff --git a/gcc/config/rs6000/vxworks.h b/gcc/config/rs6000/vxworks.h
index 069a5e1f19b..d389ace8d45 100644
--- a/gcc/config/rs6000/vxworks.h
+++ b/gcc/config/rs6000/vxworks.h
@@ -1,32 +1,66 @@
/* Definitions of target machine for GNU compiler. Vxworks PowerPC version.
- Copyright (C) 1996, 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1996, 2000, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
+ Contributed by CodeSourcery, LLC.
- This file is part of GCC.
+This file is part of GCC.
- GCC is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
- GCC is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- License for more details.
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
- You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING. If not, write to the
- Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA. */
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
-#undef TARGET_OS_CPP_BUILTINS
+/* Note to future editors: VxWorks is mostly an EABI target. We do
+ not use rs6000/eabi.h because we would have to override most of
+ it anyway. However, if you change that file, consider making
+ analogous changes here too. */
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (PowerPC VxWorks)");
+
+/* CPP predefined macros. */
+
+#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
+ builtin_define ("__ppc"); \
+ builtin_define ("__EABI__"); \
+ builtin_define ("__ELF__"); \
builtin_define ("__vxworks"); \
- builtin_define ("__vxworks__"); \
+ builtin_define ("__VXWORKS__"); \
+ if (!TARGET_SOFT_FLOAT) \
+ builtin_define ("__hardfp"); \
+ if (flag_pic == 2) \
+ { \
+ builtin_define ("__PIC__=2"); \
+ builtin_define ("__pic__=2"); \
+ } \
+ else if (flag_pic == 1) \
+ { \
+ builtin_define ("__PIC__=1"); \
+ builtin_define ("__pic__=1"); \
+ } \
+ \
+ /* C89 namespace violation! */ \
+ builtin_define ("CPU_FAMILY=PPC"); \
} \
while (0)
+/* Only big endian PPC is supported by VxWorks. */
+#undef BYTES_BIG_ENDIAN
+#define BYTES_BIG_ENDIAN 1
+
/* We have to kill off the entire specs set created by rs6000/sysv4.h
and substitute our own set. The top level vxworks.h has done some
of this for us. */
@@ -38,45 +72,92 @@
#define SUBTARGET_EXTRA_SPECS /* none needed */
+/* FIXME: The only reason we allow no -mcpu switch at all is because
+ config-ml.in insists on a "." multilib. */
#define CPP_SPEC \
-"-DCPU_FAMILY=PPC -D__ppc -D__EABI__ \
- %{t403: -DCPU=PPC403 -D_SOFT_FLOAT ; \
- t405: -DCPU=PPC405 -D_SOFT_FLOAT ; \
- t440: -DCPU=PPC440 -D_SOFT_FLOAT ; \
- t603: -DCPU=PPC603 ; \
- t604: -DCPU=PPC604 ; \
- t860: -DCPU=PPC860 -D_SOFT_FLOAT ; \
- : -DCPU=PPC604} \
- %{!msoft-float:-D__hardfp} \
- %{fpic|fpie: -D__PIC__=1 -D__pic__=1 ; \
- fPIC|fPIE: -D__PIC__=2 -D__pic__=2 } \
- %(cpp_cpu)"
-
-#define CC1_SPEC \
-"%{t403: -mcpu=403 -mstrict-align ; \
- t405: -mcpu=405 -mstrict-align ; \
- t440: -mcpu=440 -mstrict-align ; \
- t603: -mcpu=603 -mstrict-align ; \
- t604: -mcpu=604 -mstrict-align ; \
- t860: -mcpu=860 ; \
- : -mcpu=604 -mstrict-align } \
- %{G*} %{mno-sdata:-msdata=none} %{msdata:-msdata=default} \
+"%{!DCPU=*: \
+ %{mcpu=403 : -DCPU=PPC403 ; \
+ mcpu=405 : -DCPU=PPC405 ; \
+ mcpu=440 : -DCPU=PPC440 ; \
+ mcpu=603 : -DCPU=PPC603 ; \
+ mcpu=604 : -DCPU=PPC604 ; \
+ mcpu=860 : -DCPU=PPC860 ; \
+ mcpu=8540: -DCPU=PPC85XX ; \
+ : -DCPU=PPC604 }}" \
+VXWORKS_ADDITIONAL_CPP_SPEC
+
+#define CC1_SPEC \
+"%{G*} %{mno-sdata:-msdata=none} %{msdata:-msdata=default} \
%{mlittle|mlittle-endian:-mstrict-align} \
- %{profile: -p} \
+ %{profile: -p} \
%{fvec:-maltivec} %{fvec-eabi:-maltivec -mabi=altivec}"
-
-#define ASM_SPEC "%(asm_cpu) \
-%{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
-%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
-%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} -mbig"
-
-#undef MULTILIB_DEFAULTS
-#define MULTILIB_DEFAULTS { "t604" }
-
-/* We can't use .ctors/.dtors sections. */
-#undef TARGET_ASM_OUTPUT_CONSTRUCTOR
-#undef TARGET_ASM_OUTPUT_DESTRUCTOR
-
-/* Nor sdata. */
-#undef SDATA_DEFAULT_SIZE
-#define SDATA_DEFAULT_SIZE 0
+
+#define ASM_SPEC \
+"%(asm_cpu) \
+ %{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
+ %{v:-v} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
+ %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} -mbig"
+
+#undef LIB_SPEC
+#define LIB_SPEC VXWORKS_LIB_SPEC
+#undef LINK_SPEC
+#define LINK_SPEC VXWORKS_LINK_SPEC
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC VXWORKS_STARTFILE_SPEC
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC VXWORKS_ENDFILE_SPEC
+
+/* There is no default multilib. */
+#undef MULTILIB_DEFAULTS
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT \
+ (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_EABI | MASK_STRICT_ALIGN)
+
+#undef PROCESSOR_DEFAULT
+#define PROCESSOR_DEFAULT PROCESSOR_PPC604
+
+/* Nor sdata, for kernel mode. We use this in
+ SUBSUBTARGET_INITIALIZE_OPTIONS, after rs6000_rtp has been initialized. */
+#undef SDATA_DEFAULT_SIZE
+#define SDATA_DEFAULT_SIZE (TARGET_VXWORKS_RTP ? 8 : 0)
+
+#undef STACK_BOUNDARY
+#define STACK_BOUNDARY (16*BITS_PER_UNIT)
+/* Override sysv4.h, reset to the default. */
+#undef PREFERRED_STACK_BOUNDARY
+
+/* Enable SPE */
+#undef TARGET_SPE_ABI
+#undef TARGET_SPE
+#undef TARGET_E500
+#undef TARGET_ISEL
+#undef TARGET_FPRS
+
+#define TARGET_SPE_ABI rs6000_spe_abi
+#define TARGET_SPE rs6000_spe
+#define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540)
+#define TARGET_ISEL rs6000_isel
+#define TARGET_FPRS (!rs6000_float_gprs)
+
+/* Make -mcpu=8540 imply SPE. ISEL is automatically enabled, the
+ others must be done by hand. Handle -mrtp. Disable -fPIC
+ for -mrtp - the VxWorks PIC model is not compatible with it. */
+#undef SUBSUBTARGET_OVERRIDE_OPTIONS
+#define SUBSUBTARGET_OVERRIDE_OPTIONS \
+ do { \
+ if (TARGET_E500) \
+ { \
+ rs6000_spe = 1; \
+ rs6000_spe_abi = 1; \
+ rs6000_float_gprs = 1; \
+ } \
+ \
+ if (!g_switch_set) \
+ g_switch_value = SDATA_DEFAULT_SIZE; \
+ VXWORKS_OVERRIDE_OPTIONS; \
+ } while (0)
+
+/* No _mcount profiling on VxWorks. */
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE,LABELNO) VXWORKS_FUNCTION_PROFILER(FILE,LABELNO)