1 /* Definitions of target machine for GNU compiler.
2 MIPS 32 and MIPS 64 version.
3 Copyright (C) 1999, 2000 Free Software Foundation, Inc.
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 #ifndef MIPS_ISA_DEFAULT
23 #define MIPS_ISA_DEFAULT 32
26 #ifndef MIPS_ABI_DEFAULT
27 #define MIPS_ABI_DEFAULT ABI_MEABI
30 #ifndef MIPS_ENABLE_EMBEDDED_O32
31 #define MIPS_ENABLE_EMBEDDED_O32 1
34 #ifndef PREFERRED_DEBUGGING_TYPE
35 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
40 /* This must be done after including mips.h so that the
41 ABI_{EABI,O64,O32,...} are #defined. */
43 #if MIPS_ABI_DEFAULT == ABI_EABI
44 #undef SUBTARGET_CPP_SIZE_SPEC
45 #define SUBTARGET_CPP_SIZE_SPEC "\
47 %{mips1|mips2|mips32|mlong32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
48 %{!mips1:%{!mips2:%{!mips32:%{!mlong32:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int}}}}} \
50 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
51 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}} \
52 %{mabi=32:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
54 #elif MIPS_ABI_DEFAULT == ABI_O64
55 #undef SUBTARGET_CPP_SIZE_SPEC
56 #define SUBTARGET_CPP_SIZE_SPEC "\
58 %{mips1|mips2|mips32|mlong32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
59 %{!mips1:%{!mips2:%{!mips32:%{!mlong32:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int}}}}} \
61 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
62 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}} \
63 %{mabi=32:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
66 #elif MIPS_ABI_DEFAULT == ABI_32
67 #if MIPS_ISA_DEFAULT == 3 || MIPS_ISA_DEFAULT == 4 || MIPS_ISA_DEFAULT == 5 || MIPS_ISA_DEFAULT == 64
68 #undef SUBTARGET_CPP_SIZE_SPEC
69 #define SUBTARGET_CPP_SIZE_SPEC "\
71 %{mips1|mips2|mips32|mlong32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
72 %{!mips1:%{!mips2:%{!mips32:%{!mlong32:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int}}}}} \
74 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
75 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}} \
76 %{mabi=32:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
78 #else /* not a 64bit default ISA */
79 #undef SUBTARGET_CPP_SIZE_SPEC
80 #define SUBTARGET_CPP_SIZE_SPEC "\
82 %{mips3|mips4|mips5|mips64|mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
83 %{!mips3:%{!mips4:%{!mips5:%{!mips64:%{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}}}}}} \
85 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
86 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}} \
87 %{mabi=32:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
89 %{mips3|mips4|mips5|mips64:\
90 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
91 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}} \
92 %{!mips3:%{!mips4:%{!mips5:%{!mips64:\
93 -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}}}}} \
97 #elif MIPS_ABI_DEFAULT == ABI_MEABI
98 /* For MEABI, don't link with crt0 files, let the linker start files specify
99 the appropriate crt0 file. */
100 #undef STARTFILE_SPEC
101 #define STARTFILE_SPEC "crti%O%s crtbegin%O%s %{!mno-crt0: }"
104 The MIPS_ISA_DEFAULT test is for EABI, in which the size of longs depends on
107 For MEABI the size of longs is always 32bits. If long64 is specified then
108 we honor that. The errors for long64 & long32 is because while CC1 can
109 handle overriding mlong32 with mlong64 and vise-versa, the specs cannot. */
111 #if MIPS_ISA_DEFAULT == 3 || MIPS_ISA_DEFAULT == 4 || MIPS_ISA_DEFAULT == 5 || MIPS_ISA_DEFAULT == 64
112 #undef SUBTARGET_CPP_SIZE_SPEC
113 #define SUBTARGET_CPP_SIZE_SPEC "\
115 %{mips1|mips2|mips32|mlong32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
116 %{!mips1:%{!mips2:%{!mips32:%{!mlong32:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int}}}}} \
118 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
119 %{mlong32:%e-mlong32 and -mlong64 can not both be specified.}} \
120 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int }} \
121 %{mabi=32:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
122 %{mabi=meabi|!mabi=*:\
123 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
124 %{mlong32:%e-mlong32 and -mlong64 can not both be specified.}} \
125 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int }} \
128 #else /* not a 64bit default ISA */
129 #undef SUBTARGET_CPP_SIZE_SPEC
130 #define SUBTARGET_CPP_SIZE_SPEC "\
132 %{mips3|mips4|mips5|mips64|mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
133 %{!mips3:%{!mips4:%{!mips5:%{!mips64:%{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}}}}}} \
135 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
136 %{mlong32:%e-mlong32 and -mlong64 can not both be specified.}} \
137 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int }} \
138 %{mabi=32:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
139 %{mabi=meabi|!mabi=*:\
140 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
141 %{mlong32:%e-mlong32 and -mlong64 can not both be specified.}} \
142 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int }} \