]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/i386/vxworks.h
Update copyright years.
[thirdparty/gcc.git] / gcc / config / i386 / vxworks.h
CommitLineData
d442d7d9 1/* IA32 VxWorks target definitions for GNU compiler.
83ffe9cd 2 Copyright (C) 2003-2023 Free Software Foundation, Inc.
d442d7d9 3 Updated by CodeSourcery, LLC.
55047c9d
PE
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
2f83c7d6 9the Free Software Foundation; either version 3, or (at your option)
55047c9d
PE
10any later version.
11
12GCC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
2f83c7d6
NC
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
55047c9d 20
9a835ba4
OH
21/* VxWorks after 7 SR0600 use the ELF ABI and the system environment is llvm
22 based. Earlier versions have GNU based environment components and use the
23 same ABI as Solaris 2. */
24
25#if TARGET_VXWORKS7
26
27#undef VXWORKS_PERSONALITY
28#define VXWORKS_PERSONALITY "llvm"
29
30#else
31
e57f3ae8 32#undef ASM_OUTPUT_ALIGNED_BSS
4ce351de
OH
33#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
34 asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
35
4ce351de
OH
36#undef TARGET_SUBTARGET_DEFAULT
37#define TARGET_SUBTARGET_DEFAULT \
38 (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_VECT8_RETURNS)
39
88f4e766
OH
40#undef PTRDIFF_TYPE
41#define PTRDIFF_TYPE (TARGET_LP64 ? "long int" : "int")
42
43#undef SIZE_TYPE
44#define SIZE_TYPE (TARGET_LP64 ? "long unsigned int" : "unsigned int")
45
9a835ba4
OH
46/* We cannot use PC-relative accesses for VxWorks PIC because there is no
47 fixed gap between segments. */
48#undef ASM_PREFERRED_EH_DATA_FORMAT
49
88f4e766
OH
50#if TARGET_64BIT_DEFAULT
51#undef VXWORKS_SYSCALL_LIBS_RTP
52#define VXWORKS_SYSCALL_LIBS_RTP "-lsyscall"
53#endif
54
9a835ba4
OH
55#endif
56
ca60bd93 57/* Provide our target specific DEBUGGER_REGNO. VxWorks relies on
9aed32cc
AO
58 the SVR4 numbering. */
59
ca60bd93
ML
60#undef DEBUGGER_REGNO
61#define DEBUGGER_REGNO(n) \
62 (TARGET_64BIT ? debugger64_register_map[n] : svr4_debugger_register_map[n])
9aed32cc 63
9a835ba4
OH
64/* CPU macro definitions, ordered to account for VxWorks 7 not
65 supporting CPUs older than PENTIUM4 since SR0650. */
66
67#define VX_CPUDEF(CPU) builtin_define(VX_CPU_PREFIX "CPU=" #CPU)
68#define VX_CPUVDEF(CPU) builtin_define(VX_CPU_PREFIX "CPU_VARIANT=" #CPU)
69
cb717c40 70#define TARGET_OS_CPP_BUILTINS() \
d442d7d9
PE
71 do \
72 { \
cb717c40 73 VXWORKS_OS_CPP_BUILTINS (); \
9a835ba4
OH
74 if (TARGET_64BIT) \
75 VX_CPUDEF (X86_64); \
7bdf5155 76 else if (TARGET_CPU_P (PENTIUM4)) \
9a835ba4
OH
77 { \
78 VX_CPUDEF (PENTIUM4); \
79 VX_CPUVDEF (PENTIUM4); \
80 } \
7bdf5155 81 else if (TARGET_CPU_P (CORE2)) \
9a835ba4 82 VX_CPUDEF (CORE2); \
7bdf5155 83 else if (TARGET_CPU_P (NEHALEM)) \
9a835ba4 84 VX_CPUDEF (NEHALEM); \
7bdf5155 85 else if (TARGET_CPU_P (SANDYBRIDGE)) \
9a835ba4 86 VX_CPUDEF (SANDYBRIDGE); \
7bdf5155 87 else if (TARGET_CPU_P (HASWELL)) \
9a835ba4 88 VX_CPUDEF (HASWELL); \
7bdf5155 89 else if (TARGET_CPU_P (SILVERMONT)) \
9a835ba4 90 VX_CPUDEF (SILVERMONT); \
7bdf5155 91 else if (TARGET_CPU_P (SKYLAKE) || TARGET_CPU_P (SKYLAKE_AVX512)) \
9a835ba4 92 VX_CPUDEF (SKYLAKE); \
7bdf5155 93 else if (TARGET_CPU_P (GOLDMONT)) \
9a835ba4
OH
94 VX_CPUDEF (GOLDMONT); \
95 else if (TARGET_VXWORKS7) \
96 VX_CPUDEF (PENTIUM4); \
7bdf5155 97 else if (TARGET_CPU_P (I386)) \
9a835ba4 98 VX_CPUDEF (I80386); \
7bdf5155 99 else if (TARGET_CPU_P (I486)) \
9a835ba4 100 VX_CPUDEF (I80486); \
7bdf5155 101 else if (TARGET_CPU_P (PENTIUM)) \
9a835ba4
OH
102 { \
103 VX_CPUDEF (PENTIUM); \
104 VX_CPUVDEF (PENTIUM); \
105 } \
7bdf5155 106 else if (TARGET_CPU_P (PENTIUMPRO)) \
9a835ba4
OH
107 { \
108 VX_CPUDEF (PENTIUM2); \
109 VX_CPUVDEF (PENTIUMPRO); \
110 } \
580536aa 111 else \
9a835ba4
OH
112 VX_CPUDEF (I80386); \
113 } \
d442d7d9 114 while (0)
55047c9d 115
d442d7d9
PE
116#undef CPP_SPEC
117#define CPP_SPEC VXWORKS_ADDITIONAL_CPP_SPEC
9a835ba4
OH
118#undef CC1_SPEC
119#define CC1_SPEC VXWORKS_CC1_SPEC
d442d7d9
PE
120#undef LIB_SPEC
121#define LIB_SPEC VXWORKS_LIB_SPEC
122#undef STARTFILE_SPEC
123#define STARTFILE_SPEC VXWORKS_STARTFILE_SPEC
124#undef ENDFILE_SPEC
125#define ENDFILE_SPEC VXWORKS_ENDFILE_SPEC
126#undef LINK_SPEC
127#define LINK_SPEC VXWORKS_LINK_SPEC
128
129#undef SUBTARGET_SWITCHES
130#define SUBTARGET_SWITCHES EXTRA_SUBTARGET_SWITCHES
131
132#undef SUBTARGET_OVERRIDE_OPTIONS
133#define SUBTARGET_OVERRIDE_OPTIONS VXWORKS_OVERRIDE_OPTIONS
134
135/* No _mcount profiling on VxWorks. */
136#undef FUNCTION_PROFILER
137#define FUNCTION_PROFILER(FILE,LABELNO) VXWORKS_FUNCTION_PROFILER(FILE,LABELNO)
10d7f5f3 138
3488bd6b
EB
139/* Define this to be nonzero if static stack checking is supported. */
140#define STACK_CHECK_STATIC_BUILTIN 1
141
142/* This platform supports the probing method of stack checking (RTP mode).
9a835ba4 143 8K is reserved in the stack to propagate exceptions in case of overflow.
580536aa 144 On 64-bit targets, we double that size. */
9a835ba4
OH
145
146#define STACK_CHECK_PROTECT (TARGET_64BIT_DEFAULT ? 16 * 1024 : 8 * 1024)