1
# DP: Implements D CPU version conditions.
3
This implements the following versions:
7
for all supported architectures. And these where appropriate:
46
Index: b/src/gcc/config/aarch64/aarch64.h
47
===================================================================
48
--- a/src/gcc/config/aarch64/aarch64.h
49
+++ b/src/gcc/config/aarch64/aarch64.h
54
+/* Target CPU builtins for D. */
55
+#define TARGET_CPU_D_BUILTINS() \
58
+ builtin_define ("AArch64"); \
59
+ builtin_define ("D_HardFloat"); \
64
/* Target machine storage layout. */
65
Index: b/src/gcc/config/alpha/alpha.h
66
===================================================================
67
--- a/src/gcc/config/alpha/alpha.h
68
+++ b/src/gcc/config/alpha/alpha.h
69
@@ -72,6 +72,23 @@ along with GCC; see the file COPYING3.
70
SUBTARGET_LANGUAGE_CPP_BUILTINS(); \
73
+/* Target CPU builtins for D. */
74
+#define TARGET_CPU_D_BUILTINS() \
77
+ builtin_define ("Alpha"); \
78
+ if (TARGET_SOFT_FP) \
80
+ builtin_define ("D_SoftFloat"); \
81
+ builtin_define ("Alpha_SoftFloat"); \
85
+ builtin_define ("D_HardFloat"); \
86
+ builtin_define ("Alpha_HardFloat"); \
90
#ifndef SUBTARGET_LANGUAGE_CPP_BUILTINS
91
#define SUBTARGET_LANGUAGE_CPP_BUILTINS() \
93
Index: b/src/gcc/config/arm/arm.h
94
===================================================================
95
--- a/src/gcc/config/arm/arm.h
96
+++ b/src/gcc/config/arm/arm.h
97
@@ -158,6 +158,31 @@ extern char arm_arch_name[];
98
builtin_define ("__ARM_ARCH_EXT_IDIV__"); \
101
+/* Target CPU builtins for D. */
102
+#define TARGET_CPU_D_BUILTINS() \
105
+ builtin_define ("ARM"); \
107
+ if (TARGET_THUMB || TARGET_THUMB2) \
108
+ builtin_define ("ARM_Thumb"); \
110
+ if (TARGET_HARD_FLOAT_ABI) \
111
+ builtin_define ("ARM_HardFloat"); \
114
+ if(TARGET_SOFT_FLOAT) \
115
+ builtin_define ("ARM_SoftFloat"); \
116
+ else if(TARGET_HARD_FLOAT) \
117
+ builtin_define ("ARM_SoftFP"); \
120
+ if(TARGET_SOFT_FLOAT) \
121
+ builtin_define ("D_SoftFloat"); \
122
+ else if(TARGET_HARD_FLOAT) \
123
+ builtin_define ("D_HardFloat"); \
126
#include "config/arm/arm-opts.h"
129
Index: b/src/gcc/config/i386/i386.h
130
===================================================================
131
--- a/src/gcc/config/i386/i386.h
132
+++ b/src/gcc/config/i386/i386.h
133
@@ -588,6 +588,24 @@ extern const char *host_detect_local_cpu
134
/* Target CPU builtins. */
135
#define TARGET_CPU_CPP_BUILTINS() ix86_target_macros ()
137
+/* Target CPU builtins for D. */
138
+#define TARGET_CPU_D_BUILTINS() \
140
+ if (TARGET_64BIT) \
142
+ builtin_define("X86_64"); \
144
+ builtin_define("D_X32"); \
147
+ builtin_define("X86"); \
149
+ if (TARGET_80387) \
150
+ builtin_define("D_HardFloat"); \
152
+ builtin_define("D_SoftFloat"); \
155
/* Target Pragmas. */
156
#define REGISTER_TARGET_PRAGMAS() ix86_register_pragmas ()
158
Index: b/src/gcc/config/ia64/ia64.h
159
===================================================================
160
--- a/src/gcc/config/ia64/ia64.h
161
+++ b/src/gcc/config/ia64/ia64.h
162
@@ -40,6 +40,13 @@ do { \
163
builtin_define("__BIG_ENDIAN__"); \
166
+/* Target CPU builtins for D. */
167
+#define TARGET_CPU_D_BUILTINS() \
169
+ builtin_define ("IA64"); \
170
+ builtin_define ("D_HardFloat"); \
173
#ifndef SUBTARGET_EXTRA_SPECS
174
#define SUBTARGET_EXTRA_SPECS
176
Index: b/src/gcc/config/mips/mips.h
177
===================================================================
178
--- a/src/gcc/config/mips/mips.h
179
+++ b/src/gcc/config/mips/mips.h
180
@@ -551,6 +551,54 @@ struct mips_cpu_info {
184
+/* Target CPU builtins for D. */
185
+#define TARGET_CPU_D_BUILTINS() \
188
+ if (TARGET_64BIT) \
189
+ builtin_define("MIPS64"); \
191
+ builtin_define("MIPS32"); \
193
+ switch (mips_abi) \
196
+ builtin_define("MIPS_O32"); \
200
+ builtin_define("MIPS_O64"); \
204
+ builtin_define("MIPS_N32"); \
208
+ builtin_define("MIPS_N64"); \
212
+ builtin_define("MIPS_EABI"); \
216
+ gcc_unreachable(); \
219
+ if (TARGET_HARD_FLOAT_ABI) \
221
+ builtin_define("MIPS_HardFloat"); \
222
+ builtin_define("D_HardFloat"); \
224
+ else if (TARGET_SOFT_FLOAT_ABI) \
226
+ builtin_define("MIPS_SoftFloat"); \
227
+ builtin_define("D_SoftFloat"); \
232
/* Default target_flags if no switches are specified */
234
#ifndef TARGET_DEFAULT
235
Index: b/src/gcc/config/pa/pa.h
236
===================================================================
237
--- a/src/gcc/config/pa/pa.h
238
+++ b/src/gcc/config/pa/pa.h
239
@@ -185,6 +185,20 @@ do { \
240
builtin_define("_PA_RISC1_0"); \
243
+/* Target CPU builtins for D. */
244
+#define TARGET_CPU_D_BUILTINS() \
247
+ builtin_define("HPPA64"); \
249
+ builtin_define("HPPA"); \
251
+ if(TARGET_SOFT_FLOAT) \
252
+ builtin_define ("D_SoftFloat"); \
254
+ builtin_define ("D_HardFloat"); \
257
/* An old set of OS defines for various BSD-like systems. */
258
#define TARGET_OS_CPP_BUILTINS() \
260
Index: b/src/gcc/config/rs6000/rs6000.h
261
===================================================================
262
--- a/src/gcc/config/rs6000/rs6000.h
263
+++ b/src/gcc/config/rs6000/rs6000.h
264
@@ -702,6 +702,28 @@ extern unsigned char rs6000_recip_bits[]
265
#define TARGET_CPU_CPP_BUILTINS() \
266
rs6000_cpu_cpp_builtins (pfile)
268
+/* Target CPU builtins for D. */
269
+#define TARGET_CPU_D_BUILTINS() \
272
+ if (TARGET_64BIT) \
273
+ builtin_define ("PPC64"); \
275
+ builtin_define ("PPC"); \
277
+ if (TARGET_HARD_FLOAT) \
279
+ builtin_define ("PPC_HardFloat"); \
280
+ builtin_define ("D_HardFloat"); \
282
+ else if (TARGET_SOFT_FLOAT) \
284
+ builtin_define ("PPC_SoftFloat"); \
285
+ builtin_define ("D_SoftFloat"); \
290
/* This is used by rs6000_cpu_cpp_builtins to indicate the byte order
291
we're compiling for. Some configurations may need to override it. */
292
#define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
293
Index: b/src/gcc/config/s390/s390.h
294
===================================================================
295
--- a/src/gcc/config/s390/s390.h
296
+++ b/src/gcc/config/s390/s390.h
297
@@ -114,6 +114,22 @@ enum processor_flags
301
+/* Target CPU builtins for D. */
302
+#define TARGET_CPU_D_BUILTINS() \
305
+ if (TARGET_64BIT) \
306
+ builtin_define ("S390X"); \
308
+ builtin_define ("S390"); \
310
+ if(TARGET_SOFT_FLOAT) \
311
+ builtin_define ("D_SoftFloat"); \
312
+ else if(TARGET_HARD_FLOAT) \
313
+ builtin_define ("D_HardFloat"); \
317
#ifdef DEFAULT_TARGET_64BIT
318
#define TARGET_DEFAULT (MASK_64BIT | MASK_ZARCH | MASK_HARD_DFP | MASK_OPT_HTM)
320
Index: b/src/gcc/config/sh/sh.h
321
===================================================================
322
--- a/src/gcc/config/sh/sh.h
323
+++ b/src/gcc/config/sh/sh.h
324
@@ -31,6 +31,22 @@ extern int code_for_indirect_jump_scratc
326
#define TARGET_CPU_CPP_BUILTINS() sh_cpu_cpp_builtins (pfile)
328
+/* Target CPU builtins for D. */
329
+#define TARGET_CPU_D_BUILTINS() \
332
+ if (TARGET_SHMEDIA64) \
333
+ builtin_define ("SH64"); \
335
+ builtin_define ("SH"); \
337
+ if (TARGET_FPU_ANY) \
338
+ builtin_define ("D_HardFloat"); \
340
+ builtin_define ("D_SoftFloat"); \
344
/* Value should be nonzero if functions must have frame pointers.
345
Zero means the frame pointer need not be set up (and parms may be accessed
346
via the stack pointer) in functions that seem suitable. */
347
Index: b/src/gcc/config/sparc/sparc.h
348
===================================================================
349
--- a/src/gcc/config/sparc/sparc.h
350
+++ b/src/gcc/config/sparc/sparc.h
351
@@ -27,6 +27,31 @@ along with GCC; see the file COPYING3.
353
#define TARGET_CPU_CPP_BUILTINS() sparc_target_macros ()
355
+/* Target CPU builtins for D. */
356
+#define TARGET_CPU_D_BUILTINS() \
359
+ if (TARGET_64BIT) \
360
+ builtin_define ("SPARC64"); \
362
+ builtin_define ("SPARC"); \
364
+ if(TARGET_V8PLUS) \
365
+ builtin_define ("SPARC_V8Plus"); \
369
+ builtin_define ("D_HardFloat"); \
370
+ builtin_define ("SPARC_HardFloat"); \
374
+ builtin_define ("D_SoftFloat"); \
375
+ builtin_define ("SPARC_SoftFloat"); \
380
/* Specify this in a cover file to provide bi-architecture (32/64) support. */
381
/* #define SPARC_BI_ARCH */