1
# DP: Implements D CPU version conditions.
3
This implements the following versions:
7
for all supported architectures. And these where appropriate:
46
--- a/src/gcc/config/aarch64/aarch64.h
47
+++ b/src/gcc/config/aarch64/aarch64.h
52
+/* Target CPU builtins for D. */
53
+#define TARGET_CPU_D_BUILTINS() \
56
+ builtin_define ("AArch64"); \
57
+ builtin_define ("D_HardFloat"); \
62
/* Target machine storage layout. */
63
--- a/src/gcc/config/alpha/alpha.h
64
+++ b/src/gcc/config/alpha/alpha.h
65
@@ -72,6 +72,23 @@ along with GCC; see the file COPYING3.
66
SUBTARGET_LANGUAGE_CPP_BUILTINS(); \
69
+/* Target CPU builtins for D. */
70
+#define TARGET_CPU_D_BUILTINS() \
73
+ builtin_define ("Alpha"); \
74
+ if (TARGET_SOFT_FP) \
76
+ builtin_define ("D_SoftFloat"); \
77
+ builtin_define ("Alpha_SoftFloat"); \
81
+ builtin_define ("D_HardFloat"); \
82
+ builtin_define ("Alpha_HardFloat"); \
86
#ifndef SUBTARGET_LANGUAGE_CPP_BUILTINS
87
#define SUBTARGET_LANGUAGE_CPP_BUILTINS() \
89
--- a/src/gcc/config/arm/arm.h
90
+++ b/src/gcc/config/arm/arm.h
91
@@ -158,6 +158,31 @@ extern char arm_arch_name[];
92
builtin_define ("__ARM_ARCH_EXT_IDIV__"); \
95
+/* Target CPU builtins for D. */
96
+#define TARGET_CPU_D_BUILTINS() \
99
+ builtin_define ("ARM"); \
101
+ if (TARGET_THUMB || TARGET_THUMB2) \
102
+ builtin_define ("ARM_Thumb"); \
104
+ if (TARGET_HARD_FLOAT_ABI) \
105
+ builtin_define ("ARM_HardFloat"); \
108
+ if(TARGET_SOFT_FLOAT) \
109
+ builtin_define ("ARM_SoftFloat"); \
110
+ else if(TARGET_HARD_FLOAT) \
111
+ builtin_define ("ARM_SoftFP"); \
114
+ if(TARGET_SOFT_FLOAT) \
115
+ builtin_define ("D_SoftFloat"); \
116
+ else if(TARGET_HARD_FLOAT) \
117
+ builtin_define ("D_HardFloat"); \
120
#include "config/arm/arm-opts.h"
123
--- a/src/gcc/config/i386/i386.h
124
+++ b/src/gcc/config/i386/i386.h
125
@@ -588,6 +588,24 @@ extern const char *host_detect_local_cpu
126
/* Target CPU builtins. */
127
#define TARGET_CPU_CPP_BUILTINS() ix86_target_macros ()
129
+/* Target CPU builtins for D. */
130
+#define TARGET_CPU_D_BUILTINS() \
132
+ if (TARGET_64BIT) \
134
+ builtin_define("X86_64"); \
136
+ builtin_define("D_X32"); \
139
+ builtin_define("X86"); \
141
+ if (TARGET_80387) \
142
+ builtin_define("D_HardFloat"); \
144
+ builtin_define("D_SoftFloat"); \
147
/* Target Pragmas. */
148
#define REGISTER_TARGET_PRAGMAS() ix86_register_pragmas ()
150
--- a/src/gcc/config/ia64/ia64.h
151
+++ b/src/gcc/config/ia64/ia64.h
152
@@ -40,6 +40,13 @@ do { \
153
builtin_define("__BIG_ENDIAN__"); \
156
+/* Target CPU builtins for D. */
157
+#define TARGET_CPU_D_BUILTINS() \
159
+ builtin_define ("IA64"); \
160
+ builtin_define ("D_HardFloat"); \
163
#ifndef SUBTARGET_EXTRA_SPECS
164
#define SUBTARGET_EXTRA_SPECS
166
--- a/src/gcc/config/mips/mips.h
167
+++ b/src/gcc/config/mips/mips.h
168
@@ -551,6 +551,54 @@ struct mips_cpu_info {
172
+/* Target CPU builtins for D. */
173
+#define TARGET_CPU_D_BUILTINS() \
176
+ if (TARGET_64BIT) \
177
+ builtin_define("MIPS64"); \
179
+ builtin_define("MIPS32"); \
181
+ switch (mips_abi) \
184
+ builtin_define("MIPS_O32"); \
188
+ builtin_define("MIPS_O64"); \
192
+ builtin_define("MIPS_N32"); \
196
+ builtin_define("MIPS_N64"); \
200
+ builtin_define("MIPS_EABI"); \
204
+ gcc_unreachable(); \
207
+ if (TARGET_HARD_FLOAT_ABI) \
209
+ builtin_define("MIPS_HardFloat"); \
210
+ builtin_define("D_HardFloat"); \
212
+ else if (TARGET_SOFT_FLOAT_ABI) \
214
+ builtin_define("MIPS_SoftFloat"); \
215
+ builtin_define("D_SoftFloat"); \
220
/* Default target_flags if no switches are specified */
222
#ifndef TARGET_DEFAULT
223
--- a/src/gcc/config/pa/pa.h
224
+++ b/src/gcc/config/pa/pa.h
225
@@ -185,6 +185,20 @@ do { \
226
builtin_define("_PA_RISC1_0"); \
229
+/* Target CPU builtins for D. */
230
+#define TARGET_CPU_D_BUILTINS() \
233
+ builtin_define("HPPA64"); \
235
+ builtin_define("HPPA"); \
237
+ if(TARGET_SOFT_FLOAT) \
238
+ builtin_define ("D_SoftFloat"); \
240
+ builtin_define ("D_HardFloat"); \
243
/* An old set of OS defines for various BSD-like systems. */
244
#define TARGET_OS_CPP_BUILTINS() \
246
--- a/src/gcc/config/rs6000/rs6000.h
247
+++ b/src/gcc/config/rs6000/rs6000.h
248
@@ -613,6 +613,28 @@ extern unsigned char rs6000_recip_bits[]
249
#define TARGET_CPU_CPP_BUILTINS() \
250
rs6000_cpu_cpp_builtins (pfile)
252
+/* Target CPU builtins for D. */
253
+#define TARGET_CPU_D_BUILTINS() \
256
+ if (TARGET_64BIT) \
257
+ builtin_define ("PPC64"); \
259
+ builtin_define ("PPC"); \
261
+ if (TARGET_HARD_FLOAT) \
263
+ builtin_define ("PPC_HardFloat"); \
264
+ builtin_define ("D_HardFloat"); \
266
+ else if (TARGET_SOFT_FLOAT) \
268
+ builtin_define ("PPC_SoftFloat"); \
269
+ builtin_define ("D_SoftFloat"); \
274
/* This is used by rs6000_cpu_cpp_builtins to indicate the byte order
275
we're compiling for. Some configurations may need to override it. */
276
#define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
277
--- a/src/gcc/config/s390/s390.h
278
+++ b/src/gcc/config/s390/s390.h
279
@@ -108,6 +108,22 @@ enum processor_flags
283
+/* Target CPU builtins for D. */
284
+#define TARGET_CPU_D_BUILTINS() \
287
+ if (TARGET_64BIT) \
288
+ builtin_define ("S390X"); \
290
+ builtin_define ("S390"); \
292
+ if(TARGET_SOFT_FLOAT) \
293
+ builtin_define ("D_SoftFloat"); \
294
+ else if(TARGET_HARD_FLOAT) \
295
+ builtin_define ("D_HardFloat"); \
299
#ifdef DEFAULT_TARGET_64BIT
300
#define TARGET_DEFAULT (MASK_64BIT | MASK_ZARCH | MASK_HARD_DFP)
302
--- a/src/gcc/config/sh/sh.h
303
+++ b/src/gcc/config/sh/sh.h
304
@@ -31,6 +31,22 @@ extern int code_for_indirect_jump_scratc
306
#define TARGET_CPU_CPP_BUILTINS() sh_cpu_cpp_builtins (pfile)
308
+/* Target CPU builtins for D. */
309
+#define TARGET_CPU_D_BUILTINS() \
312
+ if (TARGET_SHMEDIA64) \
313
+ builtin_define ("SH64"); \
315
+ builtin_define ("SH"); \
317
+ if (TARGET_FPU_ANY) \
318
+ builtin_define ("D_HardFloat"); \
320
+ builtin_define ("D_SoftFloat"); \
324
/* Value should be nonzero if functions must have frame pointers.
325
Zero means the frame pointer need not be set up (and parms may be accessed
326
via the stack pointer) in functions that seem suitable. */
327
--- a/src/gcc/config/sparc/sparc.h
328
+++ b/src/gcc/config/sparc/sparc.h
329
@@ -27,6 +27,31 @@ along with GCC; see the file COPYING3.
331
#define TARGET_CPU_CPP_BUILTINS() sparc_target_macros ()
333
+/* Target CPU builtins for D. */
334
+#define TARGET_CPU_D_BUILTINS() \
337
+ if (TARGET_64BIT) \
338
+ builtin_define ("SPARC64"); \
340
+ builtin_define ("SPARC"); \
342
+ if(TARGET_V8PLUS) \
343
+ builtin_define ("SPARC_V8Plus"); \
347
+ builtin_define ("D_HardFloat"); \
348
+ builtin_define ("SPARC_HardFloat"); \
352
+ builtin_define ("D_SoftFloat"); \
353
+ builtin_define ("SPARC_SoftFloat"); \
358
/* Specify this in a cover file to provide bi-architecture (32/64) support. */
359
/* #define SPARC_BI_ARCH */