Replace occurrences of #elif with #if...#endif.
[official-gcc.git] / gcc / config / mips / isa3264.h
blob61686445072ac5c66326222a9c67b1dcd54aa9d3
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)
10 any later version.
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
24 #endif
26 #ifndef MIPS_ABI_DEFAULT
27 #define MIPS_ABI_DEFAULT ABI_MEABI
28 #endif
30 #ifndef MIPS_ENABLE_EMBEDDED_O32
31 #define MIPS_ENABLE_EMBEDDED_O32 1
32 #endif
34 #ifndef PREFERRED_DEBUGGING_TYPE
35 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
36 #endif
38 #include "mips/elf.h"
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 "\
46 %{mabi=eabi|!mabi=*:\
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}}}}} \
49 %{mabi=o64:\
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 #endif
56 #if MIPS_ABI_DEFAULT == ABI_O64
57 #undef SUBTARGET_CPP_SIZE_SPEC
58 #define SUBTARGET_CPP_SIZE_SPEC "\
59 %{mabi=eabi:\
60 %{mips1|mips2|mips32|mlong32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
61 %{!mips1:%{!mips2:%{!mips32:%{!mlong32:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int}}}}} \
62 %{mabi=o64|!mabi=*:\
63 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
64 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}} \
65 %{mabi=32:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
67 #endif
69 #if MIPS_ABI_DEFAULT == ABI_32
70 #if MIPS_ISA_DEFAULT == 3 || MIPS_ISA_DEFAULT == 4 || MIPS_ISA_DEFAULT == 5 || MIPS_ISA_DEFAULT == 64
71 #undef SUBTARGET_CPP_SIZE_SPEC
72 #define SUBTARGET_CPP_SIZE_SPEC "\
73 %{mabi=eabi:\
74 %{mips1|mips2|mips32|mlong32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
75 %{!mips1:%{!mips2:%{!mips32:%{!mlong32:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int}}}}} \
76 %{mabi=o64|!!mabi=*:\
77 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
78 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}} \
79 %{mabi=32:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
81 #else /* not a 64bit default ISA */
82 #undef SUBTARGET_CPP_SIZE_SPEC
83 #define SUBTARGET_CPP_SIZE_SPEC "\
84 %{mabi=eabi:\
85 %{mips3|mips4|mips5|mips64|mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
86 %{!mips3:%{!mips4:%{!mips5:%{!mips64:%{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}}}}}} \
87 %{mabi=o64:\
88 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
89 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}} \
90 %{mabi=32:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
91 %{!mabi=*:\
92 %{mips3|mips4|mips5|mips64:\
93 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
94 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}} \
95 %{!mips3:%{!mips4:%{!mips5:%{!mips64:\
96 -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}}}}} \
98 #endif /* ISA */
99 #endif
101 #if MIPS_ABI_DEFAULT == ABI_MEABI
102 /* For MEABI, don't link with crt0 files, let the linker start files specify
103 the appropriate crt0 file. */
104 #undef STARTFILE_SPEC
105 #define STARTFILE_SPEC "crti%O%s crtbegin%O%s %{!mno-crt0: }"
108 The MIPS_ISA_DEFAULT test is for EABI, in which the size of longs depends on
109 the ISA.
111 For MEABI the size of longs is always 32bits. If long64 is specified then
112 we honor that. The errors for long64 & long32 is because while CC1 can
113 handle overriding mlong32 with mlong64 and vise-versa, the specs cannot. */
115 #if MIPS_ISA_DEFAULT == 3 || MIPS_ISA_DEFAULT == 4 || MIPS_ISA_DEFAULT == 5 || MIPS_ISA_DEFAULT == 64
116 #undef SUBTARGET_CPP_SIZE_SPEC
117 #define SUBTARGET_CPP_SIZE_SPEC "\
118 %{mabi=meabi:\
119 %{mips1|mips2|mips32|mlong32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
120 %{!mips1:%{!mips2:%{!mips32:%{!mlong32:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int}}}}} \
121 %{mabi=o64:\
122 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
123 %{mlong32:%e-mlong32 and -mlong64 can not both be specified.}} \
124 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int }} \
125 %{mabi=32:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
126 %{mabi=meabi|!mabi=*:\
127 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
128 %{mlong32:%e-mlong32 and -mlong64 can not both be specified.}} \
129 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int }} \
132 #else /* not a 64bit default ISA */
133 #undef SUBTARGET_CPP_SIZE_SPEC
134 #define SUBTARGET_CPP_SIZE_SPEC "\
135 %{mabi=meabi:\
136 %{mips3|mips4|mips5|mips64|mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
137 %{!mips3:%{!mips4:%{!mips5:%{!mips64:%{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}}}}}} \
138 %{mabi=o64:\
139 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
140 %{mlong32:%e-mlong32 and -mlong64 can not both be specified.}} \
141 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int }} \
142 %{mabi=32:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
143 %{mabi=meabi|!mabi=*:\
144 %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
145 %{mlong32:%e-mlong32 and -mlong64 can not both be specified.}} \
146 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int }} \
148 #endif /* ISA */
149 #endif