Use hard_regno_nregs instead of HARD_REGNO_NREGS
[official-gcc.git] / gcc / config / s390 / tpf.h
blobe41d7ba6f84fffd0d2875401a2d5e1b301cde83e
1 /* Definitions for target OS TPF for GNU compiler, for IBM S/390 hardware
2 Copyright (C) 2003-2017 Free Software Foundation, Inc.
3 Contributed by P.J. Darcy (darcypj@us.ibm.com),
4 Hartmut Penner (hpenner@de.ibm.com), and
5 Ulrich Weigand (uweigand@de.ibm.com).
7 This file is part of GCC.
9 GCC is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 3, or (at your option) any later
12 version.
14 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 for more details.
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING3. If not see
21 <http://www.gnu.org/licenses/>. */
23 #ifndef _TPF_H
24 #define _TPF_H
26 /* TPF wants the following macros defined/undefined as follows. */
27 #undef TARGET_TPF
28 #define TARGET_TPF 1
29 #undef ASM_APP_ON
30 #define ASM_APP_ON "#APP\n"
31 #undef ASM_APP_OFF
32 #define ASM_APP_OFF "#NO_APP\n"
33 #define NO_IMPLICIT_EXTERN_C
34 #define TARGET_POSIX_IO
36 #undef SIZE_TYPE
37 #define SIZE_TYPE ("long unsigned int")
38 #undef PTRDIFF_TYPE
39 #define PTRDIFF_TYPE ("long int")
40 #undef WCHAR_TYPE
41 #define WCHAR_TYPE "int"
42 #undef WCHAR_TYPE_SIZE
43 #define WCHAR_TYPE_SIZE 32
46 /* TPF OS specific stack-pointer offset. */
47 #undef STACK_POINTER_OFFSET
48 #define STACK_POINTER_OFFSET 448
50 /* When building for TPF, set a generic default target that is 64 bits. Also
51 enable TPF profiling support and the standard backchain by default. */
52 #undef TARGET_DEFAULT
53 #define TARGET_DEFAULT (MASK_TPF_PROFILING | MASK_64BIT | MASK_ZARCH \
54 | MASK_HARD_DFP | MASK_BACKCHAIN)
56 /* Exception handling. */
58 /* Select a format to encode pointers in exception handling data. */
59 #undef ASM_PREFERRED_EH_DATA_FORMAT
60 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) DW_EH_PE_absptr
62 /* TPF OS specific compiler settings. */
63 #undef TARGET_OS_CPP_BUILTINS
64 #define TARGET_OS_CPP_BUILTINS() \
65 do \
66 { \
67 builtin_define_std ("tpf"); \
68 builtin_assert ("system=tpf"); \
69 builtin_define ("__ELF__"); \
70 } \
71 while (0)
74 #define EXTRA_SPECS \
75 { "entry_spec", ENTRY_SPEC }
77 /* Make TPF specific spec file settings here. */
79 #undef STARTFILE_SPEC
80 #define STARTFILE_SPEC \
81 "%{mmain:crt0%O%s} crtbeginS%O%s crt3%O%s"
83 #undef ENDFILE_SPEC
84 #define ENDFILE_SPEC "crtendS%O%s"
86 #undef CC1_SPEC
87 #define CC1_SPEC "%{!fverbose-asm: -fverbose-asm}"
89 /* The GNU C++ standard library requires that these macros be defined. */
90 #undef CPLUSPLUS_CPP_SPEC
91 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
93 /* Rewrite -march=arch* options to the original CPU name in order to
94 make it work with older binutils. */
95 #undef ASM_SPEC
96 #define ASM_SPEC \
97 "%{m31&m64}%{mesa&mzarch}%{march=z*}" \
98 "%{march=arch3:-march=g5}" \
99 "%{march=arch5:-march=z900}" \
100 "%{march=arch6:-march=z990}" \
101 "%{march=arch7:-march=z9-ec}" \
102 "%{march=arch8:-march=z10}" \
103 "%{march=arch9:-march=z196}" \
104 "%{march=arch10:-march=zEC12}" \
105 "%{march=arch11:-march=z13}" \
106 " -alshd=%b.lst"
108 #undef LIB_SPEC
109 #define LIB_SPEC "-lCTIS -lCISO -lCLBM -lCTAL -lCFVS -lCTBX -lCTXO \
110 -lCJ00 -lCTDF -lCOMX -lCOMS -lCTHD -lCTAD -lTPFSTUB"
112 #define ENTRY_SPEC "%{mmain:-entry=_start} \
113 %{!mmain:-entry=0}"
115 /* All linking is done shared on TPF-OS. */
116 /* FIXME: When binutils patch for new emulation is committed
117 then change emulation to elf64_s390_tpf. */
118 #undef LINK_SPEC
119 #define LINK_SPEC \
120 "-m elf64_s390 \
121 %{static:%estatic is not supported on TPF-OS} \
122 %{shared: -shared} \
123 %{!shared:-shared} \
124 %(entry_spec)"
126 /* IBM copies these libraries over with these names. */
127 #define MATH_LIBRARY "CLBM"
128 #define LIBSTDCXX "CPP1"
130 #undef TARGET_LIBC_HAS_FUNCTION
131 #define TARGET_LIBC_HAS_FUNCTION gnu_libc_has_function
133 /* GAS supports it, but the debuggers don't, so avoid it. */
134 #define SUPPORTS_DISCRIMINATOR 0
136 #endif /* ! _TPF_H */