]>
Commit | Line | Data |
---|---|---|
0ea339ea NS |
1 | /* Definitions of target machine for GNU compiler. |
2 | MIPS SDE version. | |
d1583032 | 3 | Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010 |
0ea339ea NS |
4 | Free Software Foundation, Inc. |
5 | ||
6 | This file is part of GCC. | |
7 | ||
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 | |
b486fc0a | 10 | the Free Software Foundation; either version 3, or (at your option) |
0ea339ea NS |
11 | any later version. |
12 | ||
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. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
b486fc0a JM |
19 | along with GCC; see the file COPYING3. If not see |
20 | <http://www.gnu.org/licenses/>. */ | |
0ea339ea | 21 | |
7f75ae86 | 22 | #undef DRIVER_SELF_SPECS |
0ea339ea NS |
23 | #define DRIVER_SELF_SPECS \ |
24 | /* Make sure a -mips option is present. This helps us to pick \ | |
25 | the right multilib, and also makes the later specs easier \ | |
26 | to write. */ \ | |
27 | MIPS_ISA_LEVEL_SPEC, \ | |
28 | \ | |
7d8bed7b RS |
29 | /* Infer the default float setting from -march. */ \ |
30 | MIPS_ARCH_FLOAT_SPEC, \ | |
31 | \ | |
0ea339ea NS |
32 | /* If no ABI option is specified, infer one from the ISA level \ |
33 | or -mgp setting. */ \ | |
34 | "%{!mabi=*: %{" MIPS_32BIT_OPTION_SPEC ": -mabi=32;: -mabi=n32}}", \ | |
35 | \ | |
36 | /* Remove a redundant -mfp64 for -mabi=n32; we want the !mfp64 \ | |
37 | multilibs. There's no need to check whether the architecture \ | |
38 | is 64-bit; cc1 will complain if it isn't. */ \ | |
4bf6c438 | 39 | "%{mabi=n32: %<mfp64}", \ |
0ea339ea NS |
40 | \ |
41 | /* Make sure that an endian option is always present. This makes \ | |
42 | things like LINK_SPEC easier to write. */ \ | |
4bf6c438 RS |
43 | "%{!EB:%{!EL:%(endian_spec)}}", \ |
44 | \ | |
7f75ae86 CM |
45 | /* Configuration-independent MIPS rules. */ \ |
46 | BASE_DRIVER_SELF_SPECS | |
0ea339ea NS |
47 | |
48 | /* Use trap rather than break for all but MIPS I ISA. Force -no-mips16, | |
49 | so that MIPS16 assembler code requires an explicit ".set mips16". | |
50 | Very little hand-written MIPS16 assembler exists, and some build | |
51 | systems expect code to be assembled as non-MIPS16 even if the | |
52 | prevailing compiler flags select -mips16. */ | |
53 | #undef SUBTARGET_ASM_SPEC | |
54 | #define SUBTARGET_ASM_SPEC "\ | |
55 | %{!mips1:--trap} \ | |
0ea339ea NS |
56 | %{mips16:-no-mips16}" |
57 | ||
58 | #undef LINK_SPEC | |
59 | #define LINK_SPEC "\ | |
60 | %(endian_spec) \ | |
0a4a51c7 | 61 | %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32*} %{mips64*} \ |
0ea339ea NS |
62 | %{bestGnum} \ |
63 | %{shared} %{non_shared} %{call_shared} \ | |
64 | %{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \ | |
65 | %{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \ | |
66 | %{mabi=32:-melf32%{EB:b}%{EL:l}tsmip}" | |
67 | ||
68 | #undef DEFAULT_SIGNED_CHAR | |
69 | #define DEFAULT_SIGNED_CHAR 0 | |
70 | ||
2a1ed4fc | 71 | /* SDE-MIPS won't ever support SDB debugging info. */ |
0ea339ea | 72 | #undef SDB_DEBUGGING_INFO |
0ea339ea NS |
73 | |
74 | /* Describe how we implement __builtin_eh_return. */ | |
75 | ||
76 | /* At the moment, nothing appears to use more than 2 EH data registers. | |
77 | The chosen registers must not clash with the return register ($2), | |
78 | EH_RETURN_STACKADJ ($3), or MIPS_EPILOGUE_TEMP ($5), and they must | |
79 | be general MIPS16 registers. Pick $6 and $7. */ | |
80 | #undef EH_RETURN_DATA_REGNO | |
81 | #define EH_RETURN_DATA_REGNO(N) \ | |
82 | ((N) < 2 ? 7 - (N) : INVALID_REGNUM) | |
83 | ||
84 | /* Use $5 as a temporary for both MIPS16 and non-MIPS16. */ | |
85 | #undef MIPS_EPILOGUE_TEMP_REGNUM | |
e19da24c CF |
86 | #define MIPS_EPILOGUE_TEMP_REGNUM \ |
87 | (cfun->machine->interrupt_handler_p ? K0_REG_NUM : GP_REG_FIRST + 5) | |
0ea339ea NS |
88 | |
89 | /* Using long will always be right for size_t and ptrdiff_t, since | |
90 | sizeof(long) must equal sizeof(void *), following from the setting | |
91 | of the -mlong64 option. */ | |
92 | #undef SIZE_TYPE | |
93 | #define SIZE_TYPE "long unsigned int" | |
94 | #undef PTRDIFF_TYPE | |
95 | #define PTRDIFF_TYPE "long int" | |
96 | ||
0ea339ea NS |
97 | /* Use standard ELF-style local labels (not '$' as on early Irix). */ |
98 | #undef LOCAL_LABEL_PREFIX | |
99 | #define LOCAL_LABEL_PREFIX "." | |
100 | ||
101 | /* Use periods rather than dollar signs in special g++ assembler names. */ | |
102 | #define NO_DOLLAR_IN_LABEL | |
103 | ||
104 | /* Attach a special .ident directive to the end of the file to identify | |
105 | the version of GCC which compiled this code. */ | |
106 | #undef IDENT_ASM_OP | |
107 | #define IDENT_ASM_OP "\t.ident\t" | |
108 | ||
109 | /* Output #ident string into the ELF .comment section, so it doesn't | |
110 | form part of the load image, and so that it can be stripped. */ | |
111 | #undef ASM_OUTPUT_IDENT | |
112 | #define ASM_OUTPUT_IDENT(STREAM, STRING) \ | |
113 | fprintf (STREAM, "%s\"%s\"\n", IDENT_ASM_OP, STRING); | |
114 | ||
115 | /* Currently we don't support 128bit long doubles, so for now we force | |
116 | n32 to be 64bit. */ | |
117 | #undef LONG_DOUBLE_TYPE_SIZE | |
118 | #define LONG_DOUBLE_TYPE_SIZE 64 | |
119 | ||
120 | #ifdef IN_LIBGCC2 | |
121 | #undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE | |
122 | #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64 | |
123 | #endif | |
124 | ||
0ea339ea NS |
125 | /* Force all .init and .fini entries to be 32-bit, not mips16, so that |
126 | in a mixed environment they are all the same mode. The crti.asm and | |
127 | crtn.asm files will also be compiled as 32-bit due to the | |
128 | -no-mips16 flag in SUBTARGET_ASM_SPEC above. */ | |
129 | #undef CRT_CALL_STATIC_FUNCTION | |
130 | #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ | |
131 | asm (SECTION_OP "\n\ | |
132 | .set push\n\ | |
133 | .set nomips16\n\ | |
134 | jal " USER_LABEL_PREFIX #FUNC "\n\ | |
135 | .set pop\n\ | |
136 | " TEXT_SECTION_ASM_OP); |