xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/config/ia64/hpux.h (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1 /* Definitions of target machine GNU compiler.  IA-64 version.
2    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
3    Free Software Foundation, Inc.
4    Contributed by Steve Ellcey <sje@cup.hp.com> and
5                   Reva Cuthbertson <reva@cup.hp.com>
6 
7 This file is part of GCC.
8 
9 GCC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
12 any later version.
13 
14 GCC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18 
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/>.  */
22 
23 /* This macro is a C statement to print on `stderr' a string describing the
24    particular machine description choice.  */
25 
26 #define TARGET_VERSION fprintf (stderr, " (IA-64) HP-UX");
27 
28 /* Enable HPUX ABI quirks.  */
29 #undef  TARGET_HPUX
30 #define TARGET_HPUX 1
31 
32 #undef WCHAR_TYPE
33 #define WCHAR_TYPE "unsigned int"
34 
35 #undef WCHAR_TYPE_SIZE
36 #define WCHAR_TYPE_SIZE 32
37 
38 /* Target OS builtins.  */
39 #define TARGET_OS_CPP_BUILTINS()			\
40 do {							\
41 	builtin_assert("system=hpux");			\
42 	builtin_assert("system=posix");			\
43 	builtin_assert("system=unix");			\
44 	builtin_define_std("hpux");			\
45 	builtin_define_std("unix");			\
46 	builtin_define("__IA64__");			\
47 	builtin_define("_LONGLONG");			\
48 	builtin_define("_INCLUDE_LONGLONG");		\
49 	builtin_define("__STDC_EXT__");			\
50 	builtin_define("_UINT128_T");			\
51 	if (c_dialect_cxx () || !flag_iso)		\
52 	  {						\
53 	    builtin_define("_HPUX_SOURCE");		\
54 	    builtin_define("__STDCPP__");		\
55 	    builtin_define("_INCLUDE__STDC_A1_SOURCE");	\
56 	  }						\
57 	if (TARGET_ILP32)				\
58 	  builtin_define("_ILP32");			\
59 } while (0)
60 
61 #undef CPP_SPEC
62 #define CPP_SPEC \
63   "%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}"
64 /* aCC defines also -DRWSTD_MULTI_THREAD, -DRW_MULTI_THREAD.  These
65    affect only aCC's C++ library (Rogue Wave-derived) which we do not
66    use, and they violate the user's name space.  */
67 
68 #undef  ASM_EXTRA_SPEC
69 #define ASM_EXTRA_SPEC "%{milp32:-milp32} %{mlp64:-mlp64}"
70 
71 #undef ENDFILE_SPEC
72 
73 #undef STARTFILE_SPEC
74 #define STARTFILE_SPEC "%{!shared:%{static:crt0%O%s} \
75 			  %{mlp64:/usr/lib/hpux64/unix98%O%s} \
76 			  %{!mlp64:/usr/lib/hpux32/unix98%O%s}}"
77 
78 #undef LINK_SPEC
79 #define LINK_SPEC \
80   "-z +Accept TypeMismatch \
81    %{shared:-b} \
82    %{!shared: \
83      -u main \
84      %{static:-noshared}}"
85 
86 #undef  LIB_SPEC
87 #define LIB_SPEC \
88   "%{!shared: \
89      %{mt|pthread:%{fopenmp:-lrt} -lpthread} \
90      %{p:%{!mlp64:-L/usr/lib/hpux32/libp} \
91 	 %{mlp64:-L/usr/lib/hpux64/libp} -lprof} \
92      %{pg:%{!mlp64:-L/usr/lib/hpux32/libp} \
93 	  %{mlp64:-L/usr/lib/hpux64/libp} -lgprof} \
94      %{!symbolic:-lc}}"
95 
96 #define MULTILIB_DEFAULTS { "milp32" }
97 
98 /* A C expression whose value is zero if pointers that need to be extended
99    from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and
100    greater then zero if they are zero-extended and less then zero if the
101    ptr_extend instruction should be used.  */
102 
103 #define POINTERS_EXTEND_UNSIGNED -1
104 
105 #define JMP_BUF_SIZE  (8 * 76)
106 
107 #undef TARGET_DEFAULT
108 #define TARGET_DEFAULT \
109   (MASK_DWARF2_ASM | MASK_BIG_ENDIAN | MASK_ILP32 | MASK_FUSED_MADD)
110 
111 /* ??? Might not be needed anymore.  */
112 #define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) ((MODE) == TFmode)
113 
114 /* ASM_OUTPUT_EXTERNAL_LIBCALL defaults to just a globalize_label call,
115    but that doesn't put out the @function type information which causes
116    shared library problems.  */
117 
118 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
119 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN)			\
120 do {								\
121   (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0));	\
122   ASM_OUTPUT_TYPE_DIRECTIVE (FILE, XSTR (FUN, 0), "function");	\
123 } while (0)
124 
125 #undef FUNCTION_ARG_PADDING
126 #define FUNCTION_ARG_PADDING(MODE, TYPE) \
127 	ia64_hpux_function_arg_padding ((MODE), (TYPE))
128 
129 #undef PAD_VARARGS_DOWN
130 #define PAD_VARARGS_DOWN (!AGGREGATE_TYPE_P (type))
131 
132 #define REGISTER_TARGET_PRAGMAS() \
133   c_register_pragma (0, "builtin", ia64_hpux_handle_builtin_pragma)
134 
135 /* Tell ia64.c that we are using the HP linker and we should delay output of
136    function extern declarations so that we don't output them for functions
137    which are never used (and may not be defined).  */
138 
139 #undef TARGET_HPUX_LD
140 #define TARGET_HPUX_LD	1
141 
142 /* The HPUX dynamic linker objects to weak symbols with no
143    definitions, so do not use them in gthr-posix.h.  */
144 #define GTHREAD_USE_WEAK 0
145 
146 #undef CTORS_SECTION_ASM_OP
147 #define CTORS_SECTION_ASM_OP  "\t.section\t.init_array,\t\"aw\",\"init_array\""
148 
149 #undef DTORS_SECTION_ASM_OP
150 #define DTORS_SECTION_ASM_OP  "\t.section\t.fini_array,\t\"aw\",\"fini_array\""
151 
152 /* The init_array/fini_array technique does not permit the use of
153    initialization priorities.  */
154 #define SUPPORTS_INIT_PRIORITY 0
155 
156 #undef READONLY_DATA_SECTION_ASM_OP
157 #define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata,\t\"a\",\t\"progbits\""
158 
159 #undef DATA_SECTION_ASM_OP
160 #define DATA_SECTION_ASM_OP "\t.section\t.data,\t\"aw\",\t\"progbits\""
161 
162 #undef SDATA_SECTION_ASM_OP
163 #define SDATA_SECTION_ASM_OP "\t.section\t.sdata,\t\"asw\",\t\"progbits\""
164 
165 #undef BSS_SECTION_ASM_OP
166 #define BSS_SECTION_ASM_OP "\t.section\t.bss,\t\"aw\",\t\"nobits\""
167 
168 #undef SBSS_SECTION_ASM_OP
169 #define SBSS_SECTION_ASM_OP "\t.section\t.sbss,\t\"asw\",\t\"nobits\""
170 
171 #undef TEXT_SECTION_ASM_OP
172 #define TEXT_SECTION_ASM_OP "\t.section\t.text,\t\"ax\",\t\"progbits\""
173 
174 /* It is illegal to have relocations in shared segments on HPUX.
175    Pretend flag_pic is always set.  */
176 #undef  TARGET_ASM_RELOC_RW_MASK
177 #define TARGET_ASM_RELOC_RW_MASK  ia64_hpux_reloc_rw_mask
178 
179 /* ia64 HPUX has the float and long double forms of math functions.  */
180 #undef TARGET_C99_FUNCTIONS
181 #define TARGET_C99_FUNCTIONS  1
182 
183 #undef TARGET_INIT_LIBFUNCS
184 #define TARGET_INIT_LIBFUNCS ia64_hpux_init_libfuncs
185 
186 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode)
187 
188 /* Put all *xf routines in libgcc, regardless of long double size.  */
189 #undef LIBGCC2_HAS_XF_MODE
190 #define LIBGCC2_HAS_XF_MODE 1
191 #define XF_SIZE 64
192 
193 /* Put all *tf routines in libgcc, regardless of long double size.  */
194 #undef LIBGCC2_HAS_TF_MODE
195 #define LIBGCC2_HAS_TF_MODE 1
196 #define TF_SIZE 113
197 
198 /* HP-UX headers are C++-compatible.  */
199 #define NO_IMPLICIT_EXTERN_C
200 
201 /* HP-UX uses PROFILE_HOOK instead of FUNCTION_PROFILER but we need a
202    FUNCTION_PROFILER defined because its use is not ifdefed.  When using
203    PROFILE_HOOK, the profile call comes after the prologue.  */
204 
205 #undef FUNCTION_PROFILER
206 #define FUNCTION_PROFILER(FILE, LABELNO) do { } while (0)
207 
208 #undef PROFILE_HOOK
209 #define PROFILE_HOOK(LABEL) ia64_profile_hook (LABEL)
210 
211 #undef  PROFILE_BEFORE_PROLOGUE
212 
213 #undef NO_PROFILE_COUNTERS
214 #define NO_PROFILE_COUNTERS 0
215 
216 #undef HANDLE_PRAGMA_PACK_PUSH_POP
217 #define HANDLE_PRAGMA_PACK_PUSH_POP
218