File tree Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change 11
11
12
12
ifeq ($(CORE), POWER10)
13
13
ifneq ($(C_COMPILER), PGI)
14
+ ifeq ($(C_COMPILER), GCC))
15
+ ifeq ($(GCCVERSIONGTEQ10), 1)
14
16
CCOMMON_OPT += -Ofast -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math
17
+ else ifneq ($(GCCVERSIONGT4), 1)
18
+ $(warning your compiler is too old to fully support POWER9, getting a newer version of gcc is recommended)
19
+ CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math
20
+ else
21
+ $(warning your compiler is too old to fully support POWER10, getting a newer version of gcc is recommended)
22
+ CCOMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -fno-fast-math
23
+ endif
24
+ else
25
+ CCOMMON_OPT += -Ofast -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math
26
+ endif
15
27
ifeq ($(F_COMPILER), IBM)
16
28
FCOMMON_OPT += -O2 -qrecur -qnosave -qarch=pwr10 -qtune=pwr10 -qfloat=nomaf -qzerosize
17
29
else
Original file line number Diff line number Diff line change @@ -66,8 +66,7 @@ static int cpuid(void)
66
66
#endif
67
67
return CPU_UNKNOWN ;
68
68
}
69
- #else
70
- #if defined(C_PGI ) || defined(__clang__ )
69
+ #elif defined(C_PGI ) || defined(__clang__ )
71
70
/*
72
71
* NV HPC compilers do not yet implement __builtin_cpu_is().
73
72
* Fake a version here for use in the CPU detection code below.
@@ -196,13 +195,21 @@ static int cpuid(void)
196
195
cpu_type = pvrPOWER [i ].cpu_type ;
197
196
return (int )(cpu_type );
198
197
}
199
- #endif /* C_PGI */
198
+ #elif !defined(__BUILTIN_CPU_SUPPORTS__ )
199
+ static int cpuid (void )
200
+ {
201
+ return CPU_UNKNOWN ;
202
+ }
200
203
#endif /* _AIX */
201
204
202
205
#ifndef __BUILTIN_CPU_SUPPORTS__
203
206
#include <string.h>
204
207
205
- #if defined(_AIX ) || (defined(__has_builtin ) && !__has_builtin (__builtin_cpu_is ))
208
+ #ifndef __has_builtin
209
+ #define __has_builtin (x ) 0
210
+ #endif
211
+
212
+ #if defined(_AIX ) || !__has_builtin (__builtin_cpu_is )
206
213
static int __builtin_cpu_is (const char * arg )
207
214
{
208
215
static int ipinfo = -1 ;
@@ -227,7 +234,7 @@ static int __builtin_cpu_is(const char *arg)
227
234
}
228
235
#endif
229
236
230
- #if defined(_AIX ) || (defined( __has_builtin ) && !__has_builtin (__builtin_cpu_supports ) )
237
+ #if defined(_AIX ) || !__has_builtin (__builtin_cpu_supports )
231
238
static int __builtin_cpu_supports (const char * arg )
232
239
{
233
240
return 0 ;
You can’t perform that action at this time.
0 commit comments