* config/sparc/sol2-bi.h: Handle TARGET_CPU_ultrasparc3.
[official-gcc.git] / gcc / config / sparc / sol2.h
blob113894199008152b3b170b081177226635795ec0
1 /* Definitions of target machine for GCC, for SPARC running Solaris 2
2 Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004
3 Free Software Foundation, Inc.
4 Contributed by Ron Guilmette (rfg@netcom.com).
5 Additional changes by David V. Henkel-Wallace (gumby@cygnus.com).
7 This file is part of GCC.
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 2, or (at your option)
12 any later version.
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.
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING. If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
24 /* Supposedly the same as vanilla sparc svr4, except for the stuff below: */
26 /* This is here rather than in sparc.h because it's not known what
27 other assemblers will accept. */
29 #if TARGET_CPU_DEFAULT == TARGET_CPU_v9
30 #undef ASM_CPU_DEFAULT_SPEC
31 #define ASM_CPU_DEFAULT_SPEC "-xarch=v8plus"
32 #endif
34 #if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc
35 #undef ASM_CPU_DEFAULT_SPEC
36 #define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusa"
37 #endif
39 #if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3
40 #undef ASM_CPU_DEFAULT_SPEC
41 #define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusb"
42 #endif
44 #undef ASM_CPU_SPEC
45 #define ASM_CPU_SPEC "\
46 %{mcpu=v9:-xarch=v8plus} \
47 %{mcpu=ultrasparc:-xarch=v8plusa} \
48 %{mcpu=ultrasparc3:-xarch=v8plusb} \
49 %{!mcpu*:%(asm_cpu_default)} \
52 #undef SUBTARGET_EXTRA_SPECS
53 #define SUBTARGET_EXTRA_SPECS \
54 { "startfile_arch", STARTFILE_ARCH_SPEC }, \
55 { "link_arch", LINK_ARCH_SPEC }
57 /* However it appears that Solaris 2.0 uses the same reg numbering as
58 the old BSD-style system did. */
60 /* Same as sparc.h */
61 #undef DBX_REGISTER_NUMBER
62 #define DBX_REGISTER_NUMBER(REGNO) \
63 (TARGET_FLAT && (REGNO) == HARD_FRAME_POINTER_REGNUM ? 31 : REGNO)
65 /* The Solaris 2 assembler uses .skip, not .zero, so put this back. */
66 #undef ASM_OUTPUT_SKIP
67 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
68 fprintf (FILE, "\t.skip %u\n", (int)(SIZE))
70 #undef LOCAL_LABEL_PREFIX
71 #define LOCAL_LABEL_PREFIX "."
73 /* This is how to output a reference to an internal numbered label where
74 PREFIX is the class of label and NUM is the number within the class. */
76 #undef ASM_OUTPUT_INTERNAL_LABELREF
77 #define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \
78 fprintf (FILE, ".L%s%d", PREFIX, NUM)
80 /* This is how to store into the string LABEL
81 the symbol_ref name of an internal numbered label where
82 PREFIX is the class of label and NUM is the number within the class.
83 This is suitable for output with `assemble_name'. */
85 #undef ASM_GENERATE_INTERNAL_LABEL
86 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
87 sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM))
89 /* The native TLS-enabled assembler requires the directive #tls_object
90 to be put on objects in TLS sections (as of v7.1). This is not
91 required by the GNU assembler but supported on SPARC. */
92 #undef ASM_DECLARE_OBJECT_NAME
93 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
94 do \
95 { \
96 HOST_WIDE_INT size; \
98 if (DECL_THREAD_LOCAL (DECL)) \
99 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "tls_object"); \
100 else \
101 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
103 size_directive_output = 0; \
104 if (!flag_inhibit_size_directive \
105 && (DECL) && DECL_SIZE (DECL)) \
107 size_directive_output = 1; \
108 size = int_size_in_bytes (TREE_TYPE (DECL)); \
109 ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
112 ASM_OUTPUT_LABEL (FILE, NAME); \
114 while (0)
118 #undef ENDFILE_SPEC
119 #define ENDFILE_SPEC \
120 "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
121 crtend.o%s crtn.o%s"
123 /* Select a format to encode pointers in exception handling data. CODE
124 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
125 true if the symbol may be affected by dynamic relocations.
127 Some Solaris dynamic linkers don't handle unaligned section relative
128 relocs properly, so force them to be aligned. */
129 #ifndef HAVE_AS_SPARC_UA_PCREL
130 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
131 ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr)
132 #endif
134 /* The Solaris linker doesn't understand constructor priorities. */
135 #undef SUPPORTS_INIT_PRIORITY
136 #define SUPPORTS_INIT_PRIORITY 0
138 /* ??? This does not work in SunOS 4.x, so it is not enabled in sparc.h.
139 Instead, it is enabled here, because it does work under Solaris. */
140 /* Define for support of TFmode long double.
141 SPARC ABI says that long double is 4 words. */
142 #define LONG_DOUBLE_TYPE_SIZE 128
144 /* But indicate that it isn't supported by the hardware. */
145 #define WIDEST_HARDWARE_FP_SIZE 64
147 /* Solaris's _Qp_* library routine implementation clobbers the output
148 memory before the inputs are fully consumed. */
150 #undef TARGET_BUGGY_QP_LIB
151 #define TARGET_BUGGY_QP_LIB 1
153 #undef SOLARIS_CONVERSION_LIBFUNCS
154 #define SOLARIS_CONVERSION_LIBFUNCS 1
156 #undef SUN_INTEGER_MULTIPLY_64
157 #define SUN_INTEGER_MULTIPLY_64 1
159 /* Solaris allows 64 bit out and global registers in 32 bit mode.
160 sparc_override_options will disable V8+ if not generating V9 code. */
161 #undef TARGET_DEFAULT
162 #define TARGET_DEFAULT (MASK_V8PLUS + MASK_FPU + MASK_LONG_DOUBLE_128)