]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/sparc/sol2.h
gcc/
[thirdparty/gcc.git] / gcc / config / sparc / sol2.h
CommitLineData
aea155fd 1/* Definitions of target machine for GCC, for SPARC running Solaris 2
6dbce0cb 2 Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005,
3 2006 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
aea155fd 7This file is part of GCC.
1ada9a86 8
aea155fd 9GCC is free software; you can redistribute it and/or modify
1ada9a86 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
aea155fd 14GCC is distributed in the hope that it will be useful,
1ada9a86 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
aea155fd 20along with GCC; see the file COPYING. If not, write to
dbddc6c4 21the Free Software Foundation, 51 Franklin Street, Fifth Floor,
22Boston, MA 02110-1301, USA. */
1ada9a86 23
e3225e4c 24/* Supposedly the same as vanilla sparc svr4, except for the stuff below: */
1ada9a86 25
91eaedd6 26/* This is here rather than in sparc.h because it's not known what
27 other assemblers will accept. */
1711184f 28
adf09a2f 29#if TARGET_CPU_DEFAULT == TARGET_CPU_v9
30#undef ASM_CPU_DEFAULT_SPEC
31#define ASM_CPU_DEFAULT_SPEC "-xarch=v8plus"
32#endif
1711184f 33
adf09a2f 34#if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc
35#undef ASM_CPU_DEFAULT_SPEC
36#define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusa"
91eaedd6 37#endif
1711184f 38
b97ba337 39#if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3
40#undef ASM_CPU_DEFAULT_SPEC
41#define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusb"
42#endif
43
6dbce0cb 44#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara
45#undef ASM_CPU_DEFAULT_SPEC
46#define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusb"
47#endif
48
91eaedd6 49#undef ASM_CPU_SPEC
50#define ASM_CPU_SPEC "\
1711184f 51%{mcpu=v9:-xarch=v8plus} \
adf09a2f 52%{mcpu=ultrasparc:-xarch=v8plusa} \
b97ba337 53%{mcpu=ultrasparc3:-xarch=v8plusb} \
6dbce0cb 54%{mcpu=niagara:-xarch=v8plusb} \
adf09a2f 55%{!mcpu*:%(asm_cpu_default)} \
91eaedd6 56"
e3225e4c 57
ee371cff 58#undef SUBTARGET_EXTRA_SPECS
59#define SUBTARGET_EXTRA_SPECS \
60 { "startfile_arch", STARTFILE_ARCH_SPEC }, \
61 { "link_arch", LINK_ARCH_SPEC }
62
e3225e4c 63/* However it appears that Solaris 2.0 uses the same reg numbering as
8eba0400 64 the old BSD-style system did. */
e3225e4c 65
8eba0400 66/* The Solaris 2 assembler uses .skip, not .zero, so put this back. */
e3225e4c 67#undef ASM_OUTPUT_SKIP
68#define ASM_OUTPUT_SKIP(FILE,SIZE) \
d716c068 69 fprintf (FILE, "\t.skip %u\n", (int)(SIZE))
e3225e4c 70
ea81ed57 71#undef LOCAL_LABEL_PREFIX
72#define LOCAL_LABEL_PREFIX "."
73
e3225e4c 74/* This is how to store into the string LABEL
75 the symbol_ref name of an internal numbered label where
76 PREFIX is the class of label and NUM is the number within the class.
77 This is suitable for output with `assemble_name'. */
78
79#undef ASM_GENERATE_INTERNAL_LABEL
80#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
2bae62b6 81 sprintf ((LABEL), "*.L%s%lu", (PREFIX), (unsigned long)(NUM))
e3225e4c 82
07a23b4e 83/* The native TLS-enabled assembler requires the directive #tls_object
84 to be put on objects in TLS sections (as of v7.1). This is not
85 required by the GNU assembler but supported on SPARC. */
86#undef ASM_DECLARE_OBJECT_NAME
87#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
88 do \
89 { \
90 HOST_WIDE_INT size; \
91 \
2551f8e0 92 if (targetm.have_tls && DECL_THREAD_LOCAL_P (DECL)) \
07a23b4e 93 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "tls_object"); \
94 else \
95 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
96 \
97 size_directive_output = 0; \
98 if (!flag_inhibit_size_directive \
99 && (DECL) && DECL_SIZE (DECL)) \
100 { \
101 size_directive_output = 1; \
102 size = int_size_in_bytes (TREE_TYPE (DECL)); \
103 ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
104 } \
105 \
106 ASM_OUTPUT_LABEL (FILE, NAME); \
107 } \
108 while (0)
109
7d6171f2 110/* The Solaris assembler cannot grok .stabd directives. */
111#undef NO_DBX_BNSYM_ENSYM
112#define NO_DBX_BNSYM_ENSYM 1
e3225e4c 113\f
b7c87ff2 114
115#undef ENDFILE_SPEC
f24facde 116#define ENDFILE_SPEC \
117 "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
118 crtend.o%s crtn.o%s"
cab4c139 119
66e333b1 120/* Select a format to encode pointers in exception handling data. CODE
121 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
122 true if the symbol may be affected by dynamic relocations.
123
124 Some Solaris dynamic linkers don't handle unaligned section relative
125 relocs properly, so force them to be aligned. */
126#ifndef HAVE_AS_SPARC_UA_PCREL
127#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
128 ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr)
129#endif
c5ddfe19 130
1a6b65bc 131\f
4268f174 132/* Define for support of TFmode long double.
f25a48be 133 SPARC ABI says that long double is 4 words. */
1a6b65bc 134#define LONG_DOUBLE_TYPE_SIZE 128
0dbd1c74 135
136/* But indicate that it isn't supported by the hardware. */
137#define WIDEST_HARDWARE_FP_SIZE 64
138
3044c70d 139/* Solaris's _Qp_* library routine implementation clobbers the output
140 memory before the inputs are fully consumed. */
141
142#undef TARGET_BUGGY_QP_LIB
143#define TARGET_BUGGY_QP_LIB 1
144
233a3ba7 145#undef SUN_CONVERSION_LIBFUNCS
146#define SUN_CONVERSION_LIBFUNCS 1
147
148#undef DITF_CONVERSION_LIBFUNCS
149#define DITF_CONVERSION_LIBFUNCS 1
f2f543a3 150
151#undef SUN_INTEGER_MULTIPLY_64
152#define SUN_INTEGER_MULTIPLY_64 1
aaf02cb6 153
367242d3 154/* Solaris allows 64 bit out and global registers in 32 bit mode.
155 sparc_override_options will disable V8+ if not generating V9 code. */
156#undef TARGET_DEFAULT
1456900f 157#define TARGET_DEFAULT (MASK_V8PLUS + MASK_APP_REGS + MASK_FPU \
158 + MASK_LONG_DOUBLE_128)
e02a1225 159
160/* Solaris-specific #pragmas are implemented on top of attributes. Hook in
161 the bits from config/sol2.c. */
162#define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes
163#define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE
164
165/* Output a simple call for .init/.fini. */
d960da42 166#define ASM_OUTPUT_CALL(FILE, FN) \
167 do \
168 { \
169 fprintf (FILE, "\tcall\t"); \
170 print_operand (FILE, XEXP (DECL_RTL (FN), 0), 0); \
171 fprintf (FILE, "\n\tnop\n"); \
172 } \
173 while (0)