2018-02-09 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / gcc / config / powerpcspe / vxworks.h
blob054c974e58797e9b9ad37a5a8098a36f1b2a53c7
1 /* Definitions of target machine for GNU compiler. Vxworks PowerPC version.
2 Copyright (C) 1996-2018 Free Software Foundation, Inc.
3 Contributed by CodeSourcery, LLC.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
10 version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 /* Note to future editors: VxWorks is mostly an EABI target. We do
22 not use rs6000/eabi.h because we would have to override most of
23 it anyway. However, if you change that file, consider making
24 analogous changes here too. */
26 /* CPP predefined macros. */
28 #undef TARGET_OS_CPP_BUILTINS
29 #define TARGET_OS_CPP_BUILTINS() \
30 do \
31 { \
32 builtin_define ("__ppc"); \
33 builtin_define ("__PPC__"); \
34 builtin_define ("__EABI__"); \
35 builtin_define ("__ELF__"); \
36 if (!TARGET_SOFT_FLOAT) \
37 builtin_define ("__hardfp"); \
39 /* C89 namespace violation! */ \
40 builtin_define ("CPU_FAMILY=PPC"); \
42 VXWORKS_OS_CPP_BUILTINS (); \
43 } \
44 while (0)
46 /* Only big endian PPC is supported by VxWorks. */
47 #undef BYTES_BIG_ENDIAN
48 #define BYTES_BIG_ENDIAN 1
49 #undef WORDS_BIG_ENDIAN
50 #define WORDS_BIG_ENDIAN 1
52 /* We have to kill off the entire specs set created by rs6000/sysv4.h
53 and substitute our own set. The top level vxworks.h has done some
54 of this for us. */
56 #undef SUBTARGET_EXTRA_SPECS
57 #undef CPP_SPEC
58 #undef CC1_SPEC
59 #undef ASM_SPEC
61 #define SUBTARGET_EXTRA_SPECS /* none needed */
63 /* Arrange to infer -DCPU, which VxWorks headers require, from -mcpu. */
65 /* Different flavors of VxWorks expect different CPU values to designate SPE
66 on 8548. We define a dedicated macro for the base VxWorks here, which the
67 AE configuration might also override. */
69 #if TARGET_VXWORKS7
70 #define VXCPU_FOR_8548 "PPCE500V2"
71 #else
72 #define VXCPU_FOR_8548 "PPC85XX"
73 #endif
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=464 : -DCPU=PPC464 ; \
83 mcpu=476 : -DCPU=PPC476 ; \
84 mcpu=603 : -DCPU=PPC603 ; \
85 mcpu=604 : -DCPU=PPC604 ; \
86 mcpu=860 : -DCPU=PPC860 ; \
87 mcpu=8540: -DCPU=PPC85XX ; \
88 mcpu=8548: -DCPU=" VXCPU_FOR_8548 "; \
89 : -DCPU=PPC604 }}" \
90 VXWORKS_ADDITIONAL_CPP_SPEC
92 #define CC1_SPEC \
93 "%{G*} %{mno-sdata:-msdata=none} %{msdata:-msdata=default} \
94 %{mlittle|mlittle-endian:-mstrict-align}"
96 #define ASM_SPEC \
97 "%(asm_cpu) \
98 %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
99 %{mrelocatable} %{mrelocatable-lib} %{" FPIC_SPEC ":-K PIC} -mbig"
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
110 /* There is no default multilib. */
111 #undef MULTILIB_DEFAULTS
113 #undef TARGET_DEFAULT
114 #define TARGET_DEFAULT (MASK_EABI | MASK_STRICT_ALIGN)
116 #undef PROCESSOR_DEFAULT
117 #define PROCESSOR_DEFAULT PROCESSOR_PPC604
119 /* Nor sdata, for kernel mode. We use this in
120 SUBSUBTARGET_INITIALIZE_OPTIONS, after rs6000_rtp has been initialized. */
121 #undef SDATA_DEFAULT_SIZE
122 #define SDATA_DEFAULT_SIZE (TARGET_VXWORKS_RTP ? 8 : 0)
124 /* Enforce 16bytes alignment for the stack pointer, to permit general
125 compliance with e.g. Altivec instructions requirements. Make sure
126 this isn't overruled by the EABI constraints. */
128 #undef STACK_BOUNDARY
129 #define STACK_BOUNDARY (16*BITS_PER_UNIT)
131 #undef PREFERRED_STACK_BOUNDARY
132 #define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY
134 #undef ABI_STACK_BOUNDARY
136 #undef SUBSUBTARGET_OVERRIDE_OPTIONS
137 #define SUBSUBTARGET_OVERRIDE_OPTIONS \
138 do { \
139 if (!global_options_set.x_g_switch_value) \
140 g_switch_value = SDATA_DEFAULT_SIZE; \
141 VXWORKS_OVERRIDE_OPTIONS; \
142 } while (0)
144 /* No _mcount profiling on VxWorks. */
145 #undef FUNCTION_PROFILER
146 #define FUNCTION_PROFILER(FILE,LABELNO) VXWORKS_FUNCTION_PROFILER(FILE,LABELNO)
148 /* Define this to be nonzero if static stack checking is supported. */
149 #define STACK_CHECK_STATIC_BUILTIN 1
151 /* This platform supports the probing method of stack checking (RTP mode).
152 8K is reserved in the stack to propagate exceptions in case of overflow. */
153 #define STACK_CHECK_PROTECT 8192