netbsd64.h revision 1.1.1.6 1 /* Definitions of target machine for GNU compiler,
2 for 64 bit PowerPC NetBSD.
3 Copyright (C) 2006 Free Software Foundation, Inc.
4 Contributed by Matthew Green (mrg (at) eterna.com.au).
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published
10 by the Free Software Foundation; either version 2, or (at your
11 option) any later version.
12
13 GCC is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to the
20 Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
21 MA 02110-1301, USA. */
22
23 #ifndef RS6000_BI_ARCH
24
25 #undef DEFAULT_ABI
26 #define DEFAULT_ABI ABI_AIX
27
28 #undef TARGET_64BIT
29 #define TARGET_64BIT 1
30
31 #define DEFAULT_ARCH64_P 1
32 #define RS6000_BI_ARCH_P 0
33
34 #else
35
36 #define DEFAULT_ARCH64_P (TARGET_DEFAULT & MASK_64BIT)
37 #define RS6000_BI_ARCH_P 1
38
39 #endif
40
41 #ifdef IN_LIBGCC2
42 #undef TARGET_64BIT
43 #ifdef __powerpc64__
44 #define TARGET_64BIT 1
45 #else
46 #define TARGET_64BIT 0
47 #endif
48 #endif
49
50 #undef TARGET_AIX
51 #define TARGET_AIX TARGET_64BIT
52
53 #ifdef HAVE_LD_NO_DOT_SYMS
54 /* New ABI uses a local sym for the function entry point. */
55 extern int dot_symbols;
56 #undef DOT_SYMBOLS
57 #define DOT_SYMBOLS dot_symbols
58 #endif
59
60 #define TARGET_PROFILE_KERNEL profile_kernel
61
62 #define TARGET_USES_LINUX64_OPT 1
63 #ifdef HAVE_LD_LARGE_TOC
64 #undef TARGET_CMODEL
65 #define TARGET_CMODEL rs6000_current_cmodel
66 #define SET_CMODEL(opt) rs6000_current_cmodel = opt
67 #else
68 #define SET_CMODEL(opt) do {} while (0)
69 #endif
70
71 #undef PROCESSOR_DEFAULT
72 #define PROCESSOR_DEFAULT PROCESSOR_POWER4
73 #undef PROCESSOR_DEFAULT64
74 #define PROCESSOR_DEFAULT64 PROCESSOR_POWER4
75
76 /* We don't need to generate entries in .fixup, except when
77 -mrelocatable or -mrelocatable-lib is given. */
78 #undef RELOCATABLE_NEEDS_FIXUP
79 #define RELOCATABLE_NEEDS_FIXUP \
80 (rs6000_isa_flags & rs6000_isa_flags_explicit & OPTION_MASK_RELOCATABLE)
81
82 #undef RS6000_ABI_NAME
83 #define RS6000_ABI_NAME "netbsd"
84
85 #define INVALID_64BIT "-m%s not supported in this configuration"
86 #define INVALID_32BIT INVALID_64BIT
87
88 #define ELFv2_ABI_CHECK (rs6000_elf_abi == 2)
89
90 #undef SUBSUBTARGET_OVERRIDE_OPTIONS
91 #define SUBSUBTARGET_OVERRIDE_OPTIONS \
92 do \
93 { \
94 if (!global_options_set.x_rs6000_alignment_flags) \
95 rs6000_alignment_flags = MASK_ALIGN_NATURAL; \
96 if (TARGET_64BIT) \
97 { \
98 if (DEFAULT_ABI != ABI_AIX) \
99 { \
100 rs6000_current_abi = ABI_AIX; \
101 error (INVALID_64BIT, "call"); \
102 } \
103 dot_symbols = !strcmp (rs6000_abi_name, "aixdesc"); \
104 if (ELFv2_ABI_CHECK) \
105 { \
106 rs6000_current_abi = ABI_ELFv2; \
107 if (dot_symbols) \
108 error ("-mcall-aixdesc incompatible with -mabi=elfv2"); \
109 } \
110 if (rs6000_isa_flags & OPTION_MASK_RELOCATABLE) \
111 { \
112 rs6000_isa_flags &= ~OPTION_MASK_RELOCATABLE; \
113 error (INVALID_64BIT, "relocatable"); \
114 } \
115 if (ELFv2_ABI_CHECK) \
116 { \
117 rs6000_current_abi = ABI_ELFv2; \
118 if (dot_symbols) \
119 error ("-mcall-aixdesc incompatible with -mabi=elfv2"); \
120 } \
121 if (rs6000_isa_flags & OPTION_MASK_EABI) \
122 { \
123 rs6000_isa_flags &= ~OPTION_MASK_EABI; \
124 error (INVALID_64BIT, "eabi"); \
125 } \
126 if (TARGET_PROTOTYPE) \
127 { \
128 target_prototype = 0; \
129 error (INVALID_64BIT, "prototype"); \
130 } \
131 if ((rs6000_isa_flags & OPTION_MASK_POWERPC64) == 0) \
132 { \
133 rs6000_isa_flags |= OPTION_MASK_POWERPC64; \
134 error ("-m64 requires a PowerPC64 cpu"); \
135 } \
136 if ((rs6000_isa_flags_explicit \
137 & OPTION_MASK_MINIMAL_TOC) != 0) \
138 { \
139 if (global_options_set.x_rs6000_current_cmodel \
140 && rs6000_current_cmodel != CMODEL_SMALL) \
141 error ("-mcmodel incompatible with other toc options"); \
142 SET_CMODEL (CMODEL_SMALL); \
143 } \
144 else \
145 { \
146 if (!global_options_set.x_rs6000_current_cmodel) \
147 SET_CMODEL (CMODEL_MEDIUM); \
148 if (rs6000_current_cmodel != CMODEL_SMALL) \
149 { \
150 TARGET_NO_FP_IN_TOC = 0; \
151 TARGET_NO_SUM_IN_TOC = 0; \
152 } \
153 } \
154 } \
155 else \
156 { \
157 if (!RS6000_BI_ARCH_P) \
158 error (INVALID_32BIT, "32"); \
159 if (TARGET_PROFILE_KERNEL) \
160 { \
161 TARGET_PROFILE_KERNEL = 0; \
162 error (INVALID_32BIT, "profile-kernel"); \
163 } \
164 if (global_options_set.x_rs6000_current_cmodel) \
165 { \
166 SET_CMODEL (CMODEL_SMALL); \
167 error (INVALID_32BIT, "cmodel"); \
168 } \
169 } \
170 } \
171 while (0)
172
173 #undef ASM_DEFAULT_SPEC
174 #undef ASM_SPEC
175 #undef LINK_OS_NETBSD_SPEC
176 #undef LINK_SECURE_PLT_SPEC
177
178 #ifndef RS6000_BI_ARCH
179 #define ASM_DEFAULT_SPEC "-mppc64"
180 #define ASM_SPEC "%(asm_spec64) %(asm_spec_common)"
181 #define LINK_OS_NETBSD_SPEC "%(link_os_netbsd_spec64)"
182 #define LINK_SECURE_PLT_SPEC ""
183 #else
184 #if DEFAULT_ARCH64_P
185 #define ASM_DEFAULT_SPEC "-mppc%{!m32:64}"
186 #define ASM_SPEC "%{m32:%(asm_spec32)}%{!m32:%(asm_spec64)} %(asm_spec_common)"
187 #define LINK_OS_NETBSD_SPEC "%{m32:%(link_os_netbsd_spec32)}%{!m32:%(link_os_netbsd_spec64)}"
188 #define LINK_SECURE_PLT_SPEC "%{m32: " LINK_SECURE_PLT_DEFAULT_SPEC "}"
189 #else
190 #define ASM_DEFAULT_SPEC "-mppc%{m64:64}"
191 #define ASM_SPEC "%{!m64:%(asm_spec32)}%{m64:%(asm_spec64)} %(asm_spec_common)"
192 #define LINK_OS_NETBSD_SPEC "%{!m64:%(link_os_netbsd_spec32)}%{m64:%(link_os_netbsd_spec64)}"
193 #define LINK_SECURE_PLT_SPEC "%{!m64: " LINK_SECURE_PLT_DEFAULT_SPEC "}"
194 #endif
195 #endif
196
197 #define ASM_SPEC32 "-a32 \
198 %{mrelocatable} %{mrelocatable-lib} %{" FPIE_OR_FPIC_SPEC ":-K PIC} \
199 %{memb|msdata=eabi: -memb}"
200
201 #define ASM_SPEC64 "-a64"
202
203 #define ASM_SPEC_COMMON "%(asm_cpu) \
204 %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}}" \
205 ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
206
207 #undef SUBSUBTARGET_EXTRA_SPECS
208 #define SUBSUBTARGET_EXTRA_SPECS \
209 { "asm_spec_common", ASM_SPEC_COMMON }, \
210 { "asm_spec32", ASM_SPEC32 }, \
211 { "asm_spec64", ASM_SPEC64 }, \
212 { "link_os_netbsd_spec32", LINK_OS_NETBSD_SPEC32 }, \
213 { "link_os_netbsd_spec64", LINK_OS_NETBSD_SPEC64 },
214
215 #undef MULTILIB_DEFAULTS
216 #if DEFAULT_ARCH64_P
217 #define MULTILIB_DEFAULTS { "m64" }
218 #else
219 #define MULTILIB_DEFAULTS { "m32" }
220 #endif
221
222 #ifndef RS6000_BI_ARCH
223
224 /* 64-bit PowerPC NetBSD is always big-endian. */
225 #undef TARGET_LITTLE_ENDIAN
226 #define TARGET_LITTLE_ENDIAN 0
227
228 /* 64-bit PowerPC NetBSD always has a TOC. */
229 #undef TARGET_TOC
230 #define TARGET_TOC 1
231
232 /* Some things from sysv4.h we don't do when 64 bit. */
233 #undef TARGET_RELOCATABLE
234 #define TARGET_RELOCATABLE 0
235 #undef TARGET_EABI
236 #define TARGET_EABI 0
237 #undef TARGET_PROTOTYPE
238 #define TARGET_PROTOTYPE 0
239 #undef RELOCATABLE_NEEDS_FIXUP
240 #define RELOCATABLE_NEEDS_FIXUP 0
241
242 #endif
243
244 /* We use NetBSD libc _mcount for profiling. */
245 #define NO_PROFILE_COUNTERS 1
246 #define PROFILE_HOOK(LABEL) \
247 do { if (TARGET_64BIT) output_profile_hook (LABEL); } while (0)
248
249 /* PowerPC64 NetBSD word-aligns FP doubles when -malign-power is given. */
250 #undef ADJUST_FIELD_ALIGN
251 #define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \
252 (rs6000_special_adjust_field_align_p ((TYPE), (COMPUTED)) \
253 ? 128 \
254 : (TARGET_64BIT \
255 && TARGET_ALIGN_NATURAL == 0 \
256 && TYPE_MODE (strip_array_types (TYPE)) == DFmode) \
257 ? MIN ((COMPUTED), 32) \
258 : (COMPUTED))
259
260 /* PowerPC64 NetBSD increases natural record alignment to doubleword if
261 the first field is an FP double, only if in power alignment mode. */
262 #undef ROUND_TYPE_ALIGN
263 #define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
264 ((TARGET_64BIT \
265 && (TREE_CODE (STRUCT) == RECORD_TYPE \
266 || TREE_CODE (STRUCT) == UNION_TYPE \
267 || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
268 && TARGET_ALIGN_NATURAL == 0) \
269 ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
270 : MAX ((COMPUTED), (SPECIFIED)))
271
272 /* Use the default for compiling target libs. */
273 #ifdef IN_TARGET_LIBS
274 #undef TARGET_ALIGN_NATURAL
275 #define TARGET_ALIGN_NATURAL 1
276 #endif
277
278 /* Indicate that jump tables go in the text section. */
279 #undef JUMP_TABLES_IN_TEXT_SECTION
280 #define JUMP_TABLES_IN_TEXT_SECTION TARGET_64BIT
281
282 /* The linux ppc64 ABI isn't explicit on whether aggregates smaller
283 than a doubleword should be padded upward or downward. You could
284 reasonably assume that they follow the normal rules for structure
285 layout treating the parameter area as any other block of memory,
286 then map the reg param area to registers. i.e. pad upward.
287 Setting both of the following defines results in this behavior.
288 Setting just the first one will result in aggregates that fit in a
289 doubleword being padded downward, and others being padded upward.
290 Not a bad idea as this results in struct { int x; } being passed
291 the same way as an int. */
292 #define AGGREGATE_PADDING_FIXED TARGET_64BIT
293 #define AGGREGATES_PAD_UPWARD_ALWAYS 0
294
295 /* Specify padding for the last element of a block move between
296 registers and memory. FIRST is nonzero if this is the only
297 element. */
298 #define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \
299 (!(FIRST) ? PAD_UPWARD : targetm.calls.function_arg_padding (MODE, TYPE))
300
301 /* NetBSD doesn't support saving and restoring 64-bit regs in a 32-bit
302 process. */
303 #define OS_MISSING_POWERPC64 (!TARGET_64BIT)
304
305 #undef TARGET_OS_CPP_BUILTINS
306 #define TARGET_OS_CPP_BUILTINS() \
307 do \
308 { \
309 NETBSD_OS_CPP_BUILTINS_ELF(); \
310 builtin_define ("__PPC__"); \
311 builtin_define ("__ppc__"); \
312 builtin_define ("__powerpc__"); \
313 if (TARGET_ISEL) \
314 builtin_define ("__PPC_ISEL__"); \
315 if (TARGET_64BIT) \
316 { \
317 builtin_define ("__arch64__"); \
318 builtin_define ("__PPC64__"); \
319 builtin_define ("__powerpc64__"); \
320 builtin_define_with_int_value ("__PIC__", 2); \
321 builtin_assert ("cpu=powerpc64"); \
322 builtin_assert ("machine=powerpc64"); \
323 } \
324 else \
325 { \
326 builtin_define_std ("PPC"); \
327 builtin_define_std ("powerpc"); \
328 builtin_assert ("cpu=powerpc"); \
329 builtin_assert ("machine=powerpc"); \
330 TARGET_OS_SYSV_CPP_BUILTINS (); \
331 } \
332 } \
333 while (0)
334
335 /* Override the default from rs6000.h to avoid conflicts with macros
336 defined in NetBSD header files. */
337
338 #undef RS6000_CPU_CPP_ENDIAN_BUILTINS
339 #define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
340 do \
341 { \
342 builtin_define ("__BIG_ENDIAN__"); \
343 builtin_assert ("machine=bigendian"); \
344 } \
345 while (0)
346
347 #undef CC1_OS_NETBSD_SPEC
348 #define CC1_OS_NETBSD_SPEC \
349 NETBSD_CC1_AND_CC1PLUS_SPEC \
350 "%{!m32: %{!mrelocatable: %{!fno-pie: %{!fno-pic: \
351 %{!fpie: %{!fpic: \
352 %{!fPIE: %{!fPIC:-fPIC}}}}}}}}"
353 /* %{!m32: %{!mcmodel*: -mcmodel=medium}}" */
354
355 #undef CC1PLUS_SPEC
356 #define CC1PLUS_SPEC CC1_OS_NETBSD_SPEC
357
358 #undef CPP_OS_DEFAULT_SPEC
359 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_netbsd)"
360
361 #undef LINK_SHLIB_SPEC
362 #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}"
363
364 #undef LIB_DEFAULT_SPEC
365 #define LIB_DEFAULT_SPEC "%(lib_netbsd)"
366
367 #undef STARTFILE_DEFAULT_SPEC
368 #define STARTFILE_DEFAULT_SPEC "%(startfile_netbsd)"
369
370 #undef ENDFILE_DEFAULT_SPEC
371 #define ENDFILE_DEFAULT_SPEC "%(endfile_netbsd)"
372
373 #undef LINK_START_DEFAULT_SPEC
374 #define LINK_START_DEFAULT_SPEC "%(link_start_netbsd)"
375
376 #undef LINK_OS_DEFAULT_SPEC
377 #define LINK_OS_DEFAULT_SPEC "%(link_os_netbsd)"
378
379 #define LINK_OS_NETBSD_SPEC32 "-m elf32ppc %{!shared: %{!static: \
380 %{rdynamic:-export-dynamic} \
381 %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}"
382
383 #define LINK_OS_NETBSD_SPEC64 "-m elf64ppc %{!shared: %{!static: \
384 %{rdynamic:-export-dynamic} \
385 %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}"
386
387 /* Use standard DWARF numbering for DWARF debugging information. */
388 #define RS6000_USE_DWARF_NUMBERING
389
390 #undef TOC_SECTION_ASM_OP
391 #define TOC_SECTION_ASM_OP \
392 (TARGET_64BIT \
393 ? "\t.section\t\".toc\",\"aw\"" \
394 : "\t.section\t\".got\",\"aw\"")
395
396 #undef MINIMAL_TOC_SECTION_ASM_OP
397 #define MINIMAL_TOC_SECTION_ASM_OP \
398 (TARGET_64BIT \
399 ? "\t.section\t\".toc1\",\"aw\"" \
400 : (flag_pic \
401 ? "\t.section\t\".got2\",\"aw\"" \
402 : "\t.section\t\".got1\",\"aw\""))
403
404 /* This is how to declare the size of a function. */
405 #undef ASM_DECLARE_FUNCTION_SIZE
406 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
407 do \
408 { \
409 if (!flag_inhibit_size_directive) \
410 { \
411 fputs ("\t.size\t", (FILE)); \
412 if (TARGET_64BIT && DOT_SYMBOLS) \
413 putc ('.', (FILE)); \
414 assemble_name ((FILE), (FNAME)); \
415 fputs (",.-", (FILE)); \
416 rs6000_output_function_entry (FILE, FNAME); \
417 putc ('\n', (FILE)); \
418 } \
419 } \
420 while (0)
421
422 #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
423 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \
424 (TARGET_TOC \
425 && (GET_CODE (X) == SYMBOL_REF \
426 || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
427 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
428 || GET_CODE (X) == LABEL_REF \
429 || (GET_CODE (X) == CONST_INT \
430 && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \
431 || (GET_CODE (X) == CONST_DOUBLE \
432 && ((TARGET_64BIT \
433 && (TARGET_MINIMAL_TOC \
434 || (SCALAR_FLOAT_MODE_P (GET_MODE (X)) \
435 && ! TARGET_NO_FP_IN_TOC))) \
436 || (!TARGET_64BIT \
437 && !TARGET_NO_FP_IN_TOC \
438 && SCALAR_FLOAT_MODE_P (GET_MODE (X)) \
439 && BITS_PER_WORD == HOST_BITS_PER_INT)))))
440
441 /* Make GCC agree with <machine/ansi.h>. */
442
443 #undef SIZE_TYPE
444 #define SIZE_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int")
445
446 #undef PTRDIFF_TYPE
447 #define PTRDIFF_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
448
449 #undef INTPTR_TYPE
450 #define INTPTR_TYPE PTRDIFF_TYPE
451
452 #undef UINTPTR_TYPE
453 #define UINTPTR_TYPE SIZE_TYPE
454
455 #undef WCHAR_TYPE
456 #define WCHAR_TYPE "int"
457
458 #undef INT8_TYPE
459 #define INT8_TYPE "signed char"
460
461 #undef INT16_TYPE
462 #define INT16_TYPE "short int"
463
464 #undef INT32_TYPE
465 #define INT32_TYPE "int"
466
467 #undef INT64_TYPE
468 #define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int")
469
470 #undef UINT8_TYPE
471 #define UINT8_TYPE "unsigned char"
472
473 #undef UINT16_TYPE
474 #define UINT16_TYPE "short unsigned int"
475
476 #undef UINT32_TYPE
477 #define UINT32_TYPE "unsigned int"
478
479 #undef UINT64_TYPE
480 #define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
481
482 #undef INT_FAST8_TYPE
483 #define INT_FAST8_TYPE "int"
484
485 #undef INT_FAST16_TYPE
486 #define INT_FAST16_TYPE "int"
487
488 #undef INT_FAST32_TYPE
489 #define INT_FAST32_TYPE "int"
490
491 #undef INT_FAST64_TYPE
492 #define INT_FAST64_TYPE INT64_TYPE
493
494 #undef UINT_FAST8_TYPE
495 #define UINT_FAST8_TYPE "unsigned int"
496
497 #undef UINT_FAST16_TYPE
498 #define UINT_FAST16_TYPE "unsigned int"
499
500 #undef UINT_FAST32_TYPE
501 #define UINT_FAST32_TYPE "unsigned int"
502
503 #undef UINT_FAST8_TYPE
504 #define UINT_FAST8_TYPE "unsigned int"
505
506 #undef UINT_FAST16_TYPE
507 #define UINT_FAST16_TYPE "unsigned int"
508
509 #undef UINT_FAST32_TYPE
510 #define UINT_FAST32_TYPE "unsigned int"
511
512 #undef UINT_FAST64_TYPE
513 #define UINT_FAST64_TYPE UINT64_TYPE
514
515 #undef INT_LEAST8_TYPE
516 #define INT_LEAST8_TYPE INT8_TYPE
517
518 #undef INT_LEAST16_TYPE
519 #define INT_LEAST16_TYPE INT16_TYPE
520
521 #undef INT_LEAST32_TYPE
522 #define INT_LEAST32_TYPE "int"
523
524 #undef INT_LEAST64_TYPE
525 #define INT_LEAST64_TYPE INT64_TYPE
526
527 #undef UINT_LEAST8_TYPE
528 #define UINT_LEAST8_TYPE UINT8_TYPE
529
530 #undef UINT_LEAST16_TYPE
531 #define UINT_LEAST16_TYPE UINT16_TYPE
532
533 #undef UINT_LEAST32_TYPE
534 #define UINT_LEAST32_TYPE "unsigned int"
535
536 #undef UINT_LEAST64_TYPE
537 #define UINT_LEAST64_TYPE UINT64_TYPE
538
539 #undef INTMAX_TYPE
540 #define INTMAX_TYPE INT64_TYPE
541
542 #undef UINTMAX_TYPE
543 #define UINTMAX_TYPE UINT64_TYPE
544
545 /* Override rs6000.h definition. */
546 #undef ASM_APP_ON
547 #define ASM_APP_ON "#APP\n"
548
549 /* Override rs6000.h definition. */
550 #undef ASM_APP_OFF
551 #define ASM_APP_OFF "#NO_APP\n"
552
553 #undef RS6000_MCOUNT
554 #define RS6000_MCOUNT "_mcount"
555
556 #ifdef __powerpc64__
557 /* _init and _fini functions are built from bits spread across many
558 object files, each potentially with a different TOC pointer. For
559 that reason, place a nop after the call so that the linker can
560 restore the TOC pointer if a TOC adjusting call stub is needed. */
561 #if DOT_SYMBOLS
562 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
563 asm (SECTION_OP "\n" \
564 " bl ." #FUNC "\n" \
565 " nop\n" \
566 " .previous");
567 #else
568 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
569 asm (SECTION_OP "\n" \
570 " bl " #FUNC "\n" \
571 " nop\n" \
572 " .previous");
573 #endif
574 #endif
575
576 /* FP save and restore routines. */
577 #undef SAVE_FP_PREFIX
578 #define SAVE_FP_PREFIX (TARGET_64BIT ? "._savef" : "_savefpr_")
579 #undef RESTORE_FP_PREFIX
580 #define RESTORE_FP_PREFIX (TARGET_64BIT ? "._restf" : "_restfpr_")
581
582 /* For backward compatibility, we must continue to use the AIX
583 structure return convention. */
584 #undef DRAFT_V4_STRUCT_RET
585 #define DRAFT_V4_STRUCT_RET (!TARGET_64BIT)
586
587 #define LINK_GCC_C_SEQUENCE_SPEC \
588 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
589
590 /* Use --as-needed -lgcc_s for eh support. */
591 #ifdef HAVE_LD_AS_NEEDED
592 #define USE_LD_AS_NEEDED 1
593 #endif
594
595 /*
596 * NetBSD ppc64 used to have 128-bit long double support.
597 * But it does not work anymore:
598 * (insn 23 22 24 5 (set (reg:CCFP 179)
599 * (compare:CCFP (reg/v:TF 171 [ a ])
600 * (reg:TF 177)))
601 * "/usr/src/sys/external/bsd/compiler_rt/dist/lib/builtins/fixxfti.c":43 -1
602 */
603 #undef RS6000_DEFAULT_LONG_DOUBLE_SIZE
604 #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 64
605
606 #define POWERPC_NETBSD
607
608 /* The IEEE 128-bit emulator is only built on Linux systems. Flag that we
609 should enable the type handling for KFmode on VSX systems even if we are not
610 enabling the __float128 keyword. */
611 #undef TARGET_FLOAT128_ENABLE_TYPE
612 #define TARGET_FLOAT128_ENABLE_TYPE 1
613