Merged with mainline at revision 128810.
[official-gcc.git] / gcc / config / mips / sde.h
blob94fd1f587319c67062bb9b2a68b4c01b2956dfa1
1 /* Definitions of target machine for GNU compiler.
2 MIPS SDE version.
3 Copyright (C) 2003, 2004, 2007
4 Free Software Foundation, Inc.
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 3, 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 COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 #define DRIVER_SELF_SPECS \
23 /* Make sure a -mips option is present. This helps us to pick \
24 the right multilib, and also makes the later specs easier \
25 to write. */ \
26 MIPS_ISA_LEVEL_SPEC, \
28 /* Infer the default float setting from -march. */ \
29 MIPS_ARCH_FLOAT_SPEC, \
31 /* If no ABI option is specified, infer one from the ISA level \
32 or -mgp setting. */ \
33 "%{!mabi=*: %{" MIPS_32BIT_OPTION_SPEC ": -mabi=32;: -mabi=n32}}", \
35 /* Remove a redundant -mfp64 for -mabi=n32; we want the !mfp64 \
36 multilibs. There's no need to check whether the architecture \
37 is 64-bit; cc1 will complain if it isn't. */ \
38 "%{mabi=n32: %<mfp64}", \
40 /* Make sure that an endian option is always present. This makes \
41 things like LINK_SPEC easier to write. */ \
42 "%{!EB:%{!EL:%(endian_spec)}}", \
44 /* -mcode-xonly is a traditional alias for -mcode-readable=pcrel and \
45 -mno-data-in-code is a traditional alias for -mcode-readable=no. \
46 The latter trumps the former. */ \
47 "%{mno-data-in-code: -mcode-readable=no}", \
48 "%{!mcode-readable=no: %{mcode-xonly: -mcode-readable=pcrel}}", \
49 "%<mno-data-in-code %<mcode-xonly"
51 /* Use trap rather than break for all but MIPS I ISA. Force -no-mips16,
52 so that MIPS16 assembler code requires an explicit ".set mips16".
53 Very little hand-written MIPS16 assembler exists, and some build
54 systems expect code to be assembled as non-MIPS16 even if the
55 prevailing compiler flags select -mips16. */
56 #undef SUBTARGET_ASM_SPEC
57 #define SUBTARGET_ASM_SPEC "\
58 %{!mips1:--trap} \
59 %{fPIC|fpic|fPIE|fpie:%{!mips16*:-KPIC}} \
60 %{mips16:-no-mips16}"
62 #undef LINK_SPEC
63 #define LINK_SPEC "\
64 %(endian_spec) \
65 %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips32r2} %{mips64} \
66 %{bestGnum} \
67 %{shared} %{non_shared} %{call_shared} \
68 %{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \
69 %{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \
70 %{mabi=32:-melf32%{EB:b}%{EL:l}tsmip}"
72 #undef DEFAULT_SIGNED_CHAR
73 #define DEFAULT_SIGNED_CHAR 0
75 /* SDE-MIPS won't ever support SDB or MIPS debugging info. */
76 #undef SDB_DEBUGGING_INFO
77 #undef MIPS_DEBUGGING_INFO
79 /* Describe how we implement __builtin_eh_return. */
81 /* At the moment, nothing appears to use more than 2 EH data registers.
82 The chosen registers must not clash with the return register ($2),
83 EH_RETURN_STACKADJ ($3), or MIPS_EPILOGUE_TEMP ($5), and they must
84 be general MIPS16 registers. Pick $6 and $7. */
85 #undef EH_RETURN_DATA_REGNO
86 #define EH_RETURN_DATA_REGNO(N) \
87 ((N) < 2 ? 7 - (N) : INVALID_REGNUM)
89 /* Use $5 as a temporary for both MIPS16 and non-MIPS16. */
90 #undef MIPS_EPILOGUE_TEMP_REGNUM
91 #define MIPS_EPILOGUE_TEMP_REGNUM (GP_REG_FIRST + 5)
93 /* Using long will always be right for size_t and ptrdiff_t, since
94 sizeof(long) must equal sizeof(void *), following from the setting
95 of the -mlong64 option. */
96 #undef SIZE_TYPE
97 #define SIZE_TYPE "long unsigned int"
98 #undef PTRDIFF_TYPE
99 #define PTRDIFF_TYPE "long int"
101 /* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */
102 #define HANDLE_PRAGMA_PACK_PUSH_POP 1
104 /* Use standard ELF-style local labels (not '$' as on early Irix). */
105 #undef LOCAL_LABEL_PREFIX
106 #define LOCAL_LABEL_PREFIX "."
108 /* Use periods rather than dollar signs in special g++ assembler names. */
109 #define NO_DOLLAR_IN_LABEL
111 /* Attach a special .ident directive to the end of the file to identify
112 the version of GCC which compiled this code. */
113 #undef IDENT_ASM_OP
114 #define IDENT_ASM_OP "\t.ident\t"
116 /* Output #ident string into the ELF .comment section, so it doesn't
117 form part of the load image, and so that it can be stripped. */
118 #undef ASM_OUTPUT_IDENT
119 #define ASM_OUTPUT_IDENT(STREAM, STRING) \
120 fprintf (STREAM, "%s\"%s\"\n", IDENT_ASM_OP, STRING);
122 /* Currently we don't support 128bit long doubles, so for now we force
123 n32 to be 64bit. */
124 #undef LONG_DOUBLE_TYPE_SIZE
125 #define LONG_DOUBLE_TYPE_SIZE 64
127 #ifdef IN_LIBGCC2
128 #undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
129 #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
130 #endif
132 /* Force all .init and .fini entries to be 32-bit, not mips16, so that
133 in a mixed environment they are all the same mode. The crti.asm and
134 crtn.asm files will also be compiled as 32-bit due to the
135 -no-mips16 flag in SUBTARGET_ASM_SPEC above. */
136 #undef CRT_CALL_STATIC_FUNCTION
137 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
138 asm (SECTION_OP "\n\
139 .set push\n\
140 .set nomips16\n\
141 jal " USER_LABEL_PREFIX #FUNC "\n\
142 .set pop\n\
143 " TEXT_SECTION_ASM_OP);