1 /* Definitions of target machine for GCC, for bi-arch SPARC
2 running Solaris 2 using the system assembler and linker. */
4 /* The default code model used to be CM_MEDANY on Solaris
5 but even Sun eventually found it to be quite wasteful
6 and changed it to CM_MEDMID in the Studio 9 compiler. */
7 #undef SPARC_DEFAULT_CMODEL
8 #define SPARC_DEFAULT_CMODEL CM_MEDMID
10 #define AS_SPARC64_FLAG "-xarch=v9"
12 #undef ASM_CPU32_DEFAULT_SPEC
13 #define ASM_CPU32_DEFAULT_SPEC ""
14 #undef ASM_CPU64_DEFAULT_SPEC
15 #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG
17 #if TARGET_CPU_DEFAULT == TARGET_CPU_v9
18 #undef CPP_CPU64_DEFAULT_SPEC
19 #define CPP_CPU64_DEFAULT_SPEC ""
20 #undef ASM_CPU32_DEFAULT_SPEC
21 #define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plus"
24 #if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc
25 #undef CPP_CPU64_DEFAULT_SPEC
26 #define CPP_CPU64_DEFAULT_SPEC ""
27 #undef ASM_CPU32_DEFAULT_SPEC
28 #define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusa"
29 #undef ASM_CPU64_DEFAULT_SPEC
30 #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG "a"
33 #if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3
34 #undef CPP_CPU64_DEFAULT_SPEC
35 #define CPP_CPU64_DEFAULT_SPEC ""
36 #undef ASM_CPU32_DEFAULT_SPEC
37 #define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusb"
38 #undef ASM_CPU64_DEFAULT_SPEC
39 #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG "b"
42 #if TARGET_CPU_DEFAULT == TARGET_CPU_niagara
43 #undef CPP_CPU64_DEFAULT_SPEC
44 #define CPP_CPU64_DEFAULT_SPEC ""
45 #undef ASM_CPU32_DEFAULT_SPEC
46 #define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusb"
47 #undef ASM_CPU64_DEFAULT_SPEC
48 #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG "b"
52 #define DEF_ARCH32_SPEC(__str) "%{!m64:" __str "}"
53 #define DEF_ARCH64_SPEC(__str) "%{m64:" __str "}"
55 #define DEF_ARCH32_SPEC(__str) "%{m32:" __str "}"
56 #define DEF_ARCH64_SPEC(__str) "%{!m32:" __str "}"
60 #define CPP_CPU_SPEC "\
62 %{msparclite|mf930|mf934:-D__sparclite__} \
63 %{mv8:" DEF_ARCH32_SPEC("-D__sparcv8") "} \
64 %{msupersparc:-D__supersparc__ " DEF_ARCH32_SPEC("-D__sparcv8") "} \
65 %{mcpu=sparclet|mcpu=tsc701:-D__sparclet__} \
66 %{mcpu=sparclite|mcpu-f930|mcpu=f934:-D__sparclite__} \
67 %{mcpu=v8:" DEF_ARCH32_SPEC("-D__sparcv8") "} \
68 %{mcpu=supersparc:-D__supersparc__ " DEF_ARCH32_SPEC("-D__sparcv8") "} \
69 %{mcpu=v9|mcpu=ultrasparc|mcpu=ultrasparc3|mcpu=niagara:" DEF_ARCH32_SPEC("-D__sparcv8") "} \
70 %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:%(cpp_cpu_default)}}}}}}} \
74 #define ASM_CPU_SPEC "\
75 %{mcpu=v9:" DEF_ARCH32_SPEC("-xarch=v8plus") DEF_ARCH64_SPEC(AS_SPARC64_FLAG) "} \
76 %{mcpu=ultrasparc:" DEF_ARCH32_SPEC("-xarch=v8plusa") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "a") "} \
77 %{mcpu=ultrasparc3:" DEF_ARCH32_SPEC("-xarch=v8plusb") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "b") "} \
78 %{mcpu=niagara:" DEF_ARCH32_SPEC("-xarch=v8plusb") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "b") "} \
79 %{!mcpu=niagara:%{!mcpu=ultrasparc3:%{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:" DEF_ARCH32_SPEC("-xarch=v8") DEF_ARCH64_SPEC(AS_SPARC64_FLAG) "}}}}} \
80 %{!mcpu*:%(asm_cpu_default)} \
83 #undef CPP_CPU_DEFAULT_SPEC
84 #define CPP_CPU_DEFAULT_SPEC \
85 (DEFAULT_ARCH32_P ? "\
86 %{m64:" CPP_CPU64_DEFAULT_SPEC "} \
87 %{!m64:" CPP_CPU32_DEFAULT_SPEC "} \
89 %{m32:" CPP_CPU32_DEFAULT_SPEC "} \
90 %{!m32:" CPP_CPU64_DEFAULT_SPEC "} \
93 #undef ASM_CPU_DEFAULT_SPEC
94 #define ASM_CPU_DEFAULT_SPEC \
95 (DEFAULT_ARCH32_P ? "\
96 %{m64:" ASM_CPU64_DEFAULT_SPEC "} \
97 %{!m64:" ASM_CPU32_DEFAULT_SPEC "} \
99 %{m32:" ASM_CPU32_DEFAULT_SPEC "} \
100 %{!m32:" ASM_CPU64_DEFAULT_SPEC "} \
103 /* wchar_t is called differently in <wchar.h> for 32 and 64-bit
104 compilations. This is called for by SCD 2.4.1, p. 6-83, Figure 6-65
105 (32-bit) and p. 6P-10, Figure 6.38 (64-bit). */
108 #define WCHAR_TYPE (TARGET_ARCH64 ? "int" : "long int")
110 #undef WCHAR_TYPE_SIZE
111 #define WCHAR_TYPE_SIZE 32
113 /* Same for wint_t. See SCD 2.4.1, p. 6-83, Figure 6-66 (32-bit). There's
114 no corresponding 64-bit definition, but this is what Solaris 8
115 <iso/wchar_iso.h> uses. */
118 #define WINT_TYPE (TARGET_ARCH64 ? "int" : "long int")
120 #undef WINT_TYPE_SIZE
121 #define WINT_TYPE_SIZE 32
123 #undef CPP_ARCH32_SPEC
124 #define CPP_ARCH32_SPEC ""
125 #undef CPP_ARCH64_SPEC
126 #define CPP_ARCH64_SPEC "-D__arch64__ -D__sparcv9"
129 #define CPP_ARCH_SPEC "\
130 %{m32:%(cpp_arch32)} \
131 %{m64:%(cpp_arch64)} \
132 %{!m32:%{!m64:%(cpp_arch_default)}} \
136 #define ASM_ARCH_SPEC ""
138 #undef ASM_ARCH32_SPEC
139 #define ASM_ARCH32_SPEC ""
141 #undef ASM_ARCH64_SPEC
142 #define ASM_ARCH64_SPEC ""
144 #undef ASM_ARCH_DEFAULT_SPEC
145 #define ASM_ARCH_DEFAULT_SPEC ""
147 #undef SUBTARGET_EXTRA_SPECS
148 #define SUBTARGET_EXTRA_SPECS \
149 { "startfile_arch", STARTFILE_ARCH_SPEC }, \
150 { "link_arch32", LINK_ARCH32_SPEC }, \
151 { "link_arch64", LINK_ARCH64_SPEC }, \
152 { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
153 { "link_arch", LINK_ARCH_SPEC },
156 * This should be the same as in sol2.h, except with "/sparcv9"
157 * appended to the paths and /usr/ccs/lib is no longer necessary
159 #define LINK_ARCH64_SPEC_BASE \
160 "%{mcmodel=medlow:-M /usr/lib/ld/sparcv9/map.below4G} \
165 %{!YP,*:%{p|pg:-Y P,/usr/ucblib/sparcv9:/usr/lib/libp/sparcv9:/usr/lib/sparcv9} \
166 %{!p:%{!pg:-Y P,/usr/ucblib/sparcv9:/usr/lib/sparcv9}}} \
167 -R /usr/ucblib/sparcv9} \
169 %{!YP,*:%{p|pg:-Y P,/usr/lib/libp/sparcv9:/usr/lib/sparcv9} \
170 %{!p:%{!pg:-Y P,/usr/lib/sparcv9}}}}"
172 #define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE
174 #undef LINK_ARCH_SPEC
177 #define LINK_ARCH_SPEC "\
178 %{m32:%(link_arch32)} \
179 %{m64:%edoes not support multilib} \
180 %{!m32:%{!m64:%(link_arch_default)}} \
183 #define LINK_ARCH_SPEC "\
184 %{m32:%edoes not support multilib} \
185 %{m64:%(link_arch64)} \
186 %{!m32:%{!m64:%(link_arch_default)}} \
190 #define LINK_ARCH_SPEC "\
191 %{m32:%(link_arch32)} \
192 %{m64:%(link_arch64)} \
193 %{!m32:%{!m64:%(link_arch_default)}} \
197 #define LINK_ARCH_DEFAULT_SPEC \
198 (DEFAULT_ARCH32_P ? LINK_ARCH32_SPEC : LINK_ARCH64_SPEC)
203 %{sun4:} %{target:} \
204 %{mcypress:-mcpu=cypress} \
205 %{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
206 %{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
207 %{m32:%{m64:%emay not use both -m32 and -m64}} \
208 %{m64:-mptr64 -mstack-bias -mno-v8plus \
209 %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8*:%{!msupersparc:-mcpu=v9}}}}}}}} \
213 %{sun4:} %{target:} \
214 %{mcypress:-mcpu=cypress} \
215 %{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
216 %{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
217 %{m32:%{m64:%emay not use both -m32 and -m64}} \
218 %{m32:-mptr32 -mno-stack-bias \
219 %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8*:%{!msupersparc:-mcpu=cypress}}}}}}}} \
220 %{mv8plus:-m32 -mptr32 -mno-stack-bias \
221 %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:-mcpu=v9}}}}}}}} \
225 /* Support for a compile-time default CPU, et cetera. The rules are:
226 --with-cpu is ignored if -mcpu is specified.
227 --with-tune is ignored if -mtune is specified.
228 --with-float is ignored if -mhard-float, -msoft-float, -mfpu, or -mno-fpu
230 In the SPARC_BI_ARCH compiler we cannot pass %{!mcpu=*:-mcpu=%(VALUE)}
231 here, otherwise say -mcpu=v7 would be passed even when -m64.
232 CC1_SPEC above takes care of this instead. */
233 #undef OPTION_DEFAULT_SPECS
235 #define OPTION_DEFAULT_SPECS \
236 {"cpu", "%{!m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
237 {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
238 {"float", "%{!msoft-float:%{!mhard-float:%{!fpu:%{!no-fpu:-m%(VALUE)-float}}}}" }
240 #define OPTION_DEFAULT_SPECS \
241 {"cpu", "%{!m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
242 {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
243 {"float", "%{!msoft-float:%{!mhard-float:%{!fpu:%{!no-fpu:-m%(VALUE)-float}}}}" }
247 #define MULTILIB_DEFAULTS { "m32" }
249 #define MULTILIB_DEFAULTS { "m64" }