Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / config / sparc / sp64-elf.h
blobe75a5f53bf65d1e5b00b4f99b663a44836d37f75
1 /* Definitions of target machine for GCC, for SPARC64, ELF.
2 Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2004, 2005
3 Free Software Foundation, Inc.
4 Contributed by Doug Evans, dje@cygnus.com.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
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
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 #undef TARGET_VERSION
24 #define TARGET_VERSION fprintf (stderr, " (sparc64-elf)")
26 /* A 64 bit v9 compiler in a Medium/Anywhere code model environment. */
27 #undef TARGET_DEFAULT
28 #define TARGET_DEFAULT \
29 (MASK_V9 + MASK_PTR64 + MASK_64BIT + MASK_HARD_QUAD \
30 + MASK_APP_REGS + MASK_FPU + MASK_STACK_BIAS + MASK_LONG_DOUBLE_128)
32 #undef SPARC_DEFAULT_CMODEL
33 #define SPARC_DEFAULT_CMODEL CM_EMBMEDANY
35 /* Don't assume anything about the header files. */
36 #define NO_IMPLICIT_EXTERN_C
38 /* __svr4__ is used by the C library (FIXME) */
39 #undef CPP_SUBTARGET_SPEC
40 #define CPP_SUBTARGET_SPEC "-D__svr4__"
42 #undef MD_EXEC_PREFIX
43 #undef MD_STARTFILE_PREFIX
45 #undef ASM_SPEC
46 #define ASM_SPEC "\
47 %{v:-V} -s %{fpic|fPIC|fpie|fPIE:-K PIC} \
48 %{mlittle-endian:-EL} \
49 %(asm_cpu) %(asm_arch) \
52 /* This is taken from sol2.h. */
53 #undef LINK_SPEC
54 #define LINK_SPEC "\
55 %{v:-V} \
56 %{mlittle-endian:-EL} \
59 /* We need something a little simpler for the embedded environment.
60 Profiling doesn't really work yet so we just copy the default. */
61 #undef STARTFILE_SPEC
62 #define STARTFILE_SPEC "\
63 %{!shared:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}} \
64 crtbegin.o%s \
67 #undef ENDFILE_SPEC
68 #define ENDFILE_SPEC \
69 "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
70 crtend.o%s"
72 /* Use the default (for now). */
73 #undef LIB_SPEC
75 /* This defines which switch letters take arguments.
76 It is as in svr4.h but with -R added. */
77 #undef SWITCH_TAKES_ARG
78 #define SWITCH_TAKES_ARG(CHAR) \
79 (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
80 || (CHAR) == 'R' \
81 || (CHAR) == 'h' \
82 || (CHAR) == 'z')
84 /* V9 chips can handle either endianness. */
85 #undef SUBTARGET_SWITCHES
86 #define SUBTARGET_SWITCHES \
87 {"big-endian", -MASK_LITTLE_ENDIAN, N_("Generate code for big endian") }, \
88 {"little-endian", MASK_LITTLE_ENDIAN, N_("Generate code for little endian") },
90 #undef BYTES_BIG_ENDIAN
91 #define BYTES_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN)
93 #undef WORDS_BIG_ENDIAN
94 #define WORDS_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN)
96 #undef LOCAL_LABEL_PREFIX
97 #define LOCAL_LABEL_PREFIX "."
99 /* This is how to store into the string LABEL
100 the symbol_ref name of an internal numbered label where
101 PREFIX is the class of label and NUM is the number within the class.
102 This is suitable for output with `assemble_name'. */
104 #undef ASM_GENERATE_INTERNAL_LABEL
105 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
106 sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM))
108 /* ??? This should be 32 bits for v9 but what can we do? */
109 #undef WCHAR_TYPE
110 #define WCHAR_TYPE "short unsigned int"
112 #undef WCHAR_TYPE_SIZE
113 #define WCHAR_TYPE_SIZE 16
115 #undef LONG_DOUBLE_TYPE_SIZE
116 #define LONG_DOUBLE_TYPE_SIZE 128
118 /* The medium/anywhere code model practically requires us to put jump tables
119 in the text section as gcc is unable to distinguish LABEL_REF's of jump
120 tables from other label refs (when we need to). */
121 /* But we now defer the tables to the end of the function, so we make
122 this 0 to not confuse the branch shortening code. */
123 #undef JUMP_TABLES_IN_TEXT_SECTION
124 #define JUMP_TABLES_IN_TEXT_SECTION 0