]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/sparc/sol2.h
Merge basic-improvements-branch to trunk
[thirdparty/gcc.git] / gcc / config / sparc / sol2.h
CommitLineData
e3225e4c 1/* Definitions of target machine for GNU compiler, for SPARC running Solaris 2
d5a614bc 2 Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
3 Free Software Foundation, Inc.
6c7a614f 4 Contributed by Ron Guilmette (rfg@netcom.com).
2554c338 5 Additional changes by David V. Henkel-Wallace (gumby@cygnus.com).
1ada9a86 6
7This file is part of GNU CC.
8
9GNU CC is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2, or (at your option)
12any later version.
13
14GNU CC is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with GNU CC; see the file COPYING. If not, write to
9b754436 21the Free Software Foundation, 59 Temple Place - Suite 330,
22Boston, MA 02111-1307, USA. */
1ada9a86 23
e3225e4c 24/* Supposedly the same as vanilla sparc svr4, except for the stuff below: */
1ada9a86 25
e3225e4c 26#undef CPP_PREDEFINES
0307caef 27#define CPP_PREDEFINES "-Dsparc"
91eaedd6 28
29/* This is here rather than in sparc.h because it's not known what
30 other assemblers will accept. */
1711184f 31
adf09a2f 32#if TARGET_CPU_DEFAULT == TARGET_CPU_v9
33#undef ASM_CPU_DEFAULT_SPEC
34#define ASM_CPU_DEFAULT_SPEC "-xarch=v8plus"
35#endif
1711184f 36
adf09a2f 37#if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc
38#undef ASM_CPU_DEFAULT_SPEC
39#define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusa"
91eaedd6 40#endif
1711184f 41
91eaedd6 42#undef ASM_CPU_SPEC
43#define ASM_CPU_SPEC "\
322c331f 44%{mcpu=v8plus:-xarch=v8plus} \
1711184f 45%{mcpu=v9:-xarch=v8plus} \
adf09a2f 46%{mcpu=ultrasparc:-xarch=v8plusa} \
47%{!mcpu*:%(asm_cpu_default)} \
91eaedd6 48"
e3225e4c 49
ee371cff 50#undef SUBTARGET_EXTRA_SPECS
51#define SUBTARGET_EXTRA_SPECS \
52 { "startfile_arch", STARTFILE_ARCH_SPEC }, \
53 { "link_arch", LINK_ARCH_SPEC }
54
e3225e4c 55/* However it appears that Solaris 2.0 uses the same reg numbering as
8eba0400 56 the old BSD-style system did. */
e3225e4c 57
e3225e4c 58/* Same as sparc.h */
d5a614bc 59#undef DBX_REGISTER_NUMBER
4ad3f9b3 60#define DBX_REGISTER_NUMBER(REGNO) \
04a917bf 61 (TARGET_FLAT && (REGNO) == HARD_FRAME_POINTER_REGNUM ? 31 : REGNO)
e3225e4c 62
8eba0400 63/* The Solaris 2 assembler uses .skip, not .zero, so put this back. */
e3225e4c 64#undef ASM_OUTPUT_SKIP
65#define ASM_OUTPUT_SKIP(FILE,SIZE) \
66 fprintf (FILE, "\t.skip %u\n", (SIZE))
67
ea81ed57 68#undef LOCAL_LABEL_PREFIX
69#define LOCAL_LABEL_PREFIX "."
70
e3225e4c 71/* This is how to output a reference to an internal numbered label where
72 PREFIX is the class of label and NUM is the number within the class. */
73
74#undef ASM_OUTPUT_INTERNAL_LABELREF
75#define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \
76 fprintf (FILE, ".L%s%d", PREFIX, NUM)
77
78/* This is how to store into the string LABEL
79 the symbol_ref name of an internal numbered label where
80 PREFIX is the class of label and NUM is the number within the class.
81 This is suitable for output with `assemble_name'. */
82
83#undef ASM_GENERATE_INTERNAL_LABEL
84#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
02da6382 85 sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM))
e3225e4c 86
e3225e4c 87\f
b7c87ff2 88
89#undef ENDFILE_SPEC
f24facde 90#define ENDFILE_SPEC \
91 "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
92 crtend.o%s crtn.o%s"
cab4c139 93
66e333b1 94/* Select a format to encode pointers in exception handling data. CODE
95 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
96 true if the symbol may be affected by dynamic relocations.
97
98 Some Solaris dynamic linkers don't handle unaligned section relative
99 relocs properly, so force them to be aligned. */
100#ifndef HAVE_AS_SPARC_UA_PCREL
101#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
102 ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr)
103#endif
1a6b65bc 104\f
105/* ??? This does not work in SunOS 4.x, so it is not enabled in sparc.h.
106 Instead, it is enabled here, because it does work under Solaris. */
4268f174 107/* Define for support of TFmode long double.
f25a48be 108 SPARC ABI says that long double is 4 words. */
1a6b65bc 109#define LONG_DOUBLE_TYPE_SIZE 128
0dbd1c74 110
111/* But indicate that it isn't supported by the hardware. */
112#define WIDEST_HARDWARE_FP_SIZE 64
113
9d479c1b 114#define MULDI3_LIBCALL "__mul64"
115#define DIVDI3_LIBCALL "__div64"
116#define UDIVDI3_LIBCALL "__udiv64"
117#define MODDI3_LIBCALL "__rem64"
118#define UMODDI3_LIBCALL "__urem64"
119
3044c70d 120/* Solaris's _Qp_* library routine implementation clobbers the output
121 memory before the inputs are fully consumed. */
122
123#undef TARGET_BUGGY_QP_LIB
124#define TARGET_BUGGY_QP_LIB 1
125
aaf02cb6 126#undef INIT_SUBTARGET_OPTABS
2c8daaf1 127#define INIT_SUBTARGET_OPTABS \
128 fixsfdi_libfunc \
129 = init_one_libfunc (TARGET_ARCH64 ? "__ftol" : "__ftoll"); \
130 fixunssfdi_libfunc \
131 = init_one_libfunc (TARGET_ARCH64 ? "__ftoul" : "__ftoull"); \
132 fixdfdi_libfunc \
133 = init_one_libfunc (TARGET_ARCH64 ? "__dtol" : "__dtoll"); \
134 fixunsdfdi_libfunc \
135 = init_one_libfunc (TARGET_ARCH64 ? "__dtoul" : "__dtoull")
aaf02cb6 136
367242d3 137/* Solaris allows 64 bit out and global registers in 32 bit mode.
138 sparc_override_options will disable V8+ if not generating V9 code. */
139#undef TARGET_DEFAULT
0307caef 140#define TARGET_DEFAULT (MASK_V8PLUS + MASK_FPU + MASK_LONG_DOUBLE_128)