Skip to content

Commit 2afc074

Browse files
author
Rajalakshmi Srinivasaraghavan
committed
Fix DYNAMIC_ARCH build for POWER9
Setting DYNAMIC_ARCH=1 on POWER9 does not build POWER9 files due to some compiler version checks. This patch fixes some of the macros that are used to check compiler version. On fixing those checks, there are some new make failures related to icamin, icamax, isamin, isamax and caxpy files on POWER9. This patch fixes those failures as well.
1 parent 59243d4 commit 2afc074

7 files changed

Lines changed: 37 additions & 5 deletions

File tree

Makefile.system

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ ifeq ($(C_COMPILER), GCC)
327327
#Version tests for supporting specific features (MS_ABI, POWER9 intrinsics)
328328
GCCVERSIONGTEQ4 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 4)
329329
GCCVERSIONGT4 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \> 4)
330-
GCCVERSIONGT5 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \> 5)
331330
GCCVERSIONGTEQ7 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 7)
332331
GCCVERSIONGTEQ9 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 9)
333332
GCCMINORVERSIONGTEQ7 := $(shell expr `$(CC) -dumpversion | cut -f2 -d.` \>= 7)
@@ -575,6 +574,7 @@ ifneq ($(C_COMPILER), GCC)
575574
DYNAMIC_CORE += POWER9
576575
endif
577576
ifeq ($(C_COMPILER), GCC)
577+
GCCVERSIONGT5 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \> 5)
578578
ifeq ($(GCCVERSIONGT5), 1)
579579
DYNAMIC_CORE += POWER9
580580
else

driver/others/dynamic_power.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
extern gotoblas_t gotoblas_POWER6;
55
extern gotoblas_t gotoblas_POWER8;
6-
#if (!defined C_GCC) || (GCC_VERSION >= 60000)
6+
#if (!defined __GNUC__) || ( __GNUC__ >= 6)
77
extern gotoblas_t gotoblas_POWER9;
88
#endif
99

@@ -21,7 +21,7 @@ static char *corename[] = {
2121
char *gotoblas_corename(void) {
2222
if (gotoblas == &gotoblas_POWER6) return corename[1];
2323
if (gotoblas == &gotoblas_POWER8) return corename[2];
24-
#if (!defined C_GCC) || (GCC_VERSION >= 60000)
24+
#if (!defined __GNUC__) || ( __GNUC__ >= 6)
2525
if (gotoblas == &gotoblas_POWER9) return corename[3];
2626
#endif
2727
return corename[0];
@@ -33,7 +33,7 @@ static gotoblas_t *get_coretype(void) {
3333
return &gotoblas_POWER6;
3434
if (__builtin_cpu_is("power8"))
3535
return &gotoblas_POWER8;
36-
#if (!defined C_GCC) || (GCC_VERSION >= 60000)
36+
#if (!defined __GNUC__) || ( __GNUC__ >= 6)
3737
if (__builtin_cpu_is("power9"))
3838
return &gotoblas_POWER9;
3939
#endif
@@ -59,7 +59,7 @@ static gotoblas_t *force_coretype(char * coretype) {
5959
{
6060
case 1: return (&gotoblas_POWER6);
6161
case 2: return (&gotoblas_POWER8);
62-
#if (!defined C_GCC) || (GCC_VERSION >= 60000)
62+
#if (!defined __GNUC__) || ( __GNUC__ >= 6)
6363
case 3: return (&gotoblas_POWER9);
6464
#endif
6565
default: return NULL;

kernel/power/caxpy_power9.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313

1414
PROLOGUE
1515

16+
#ifdef CONJ
17+
caxpyc_k:
18+
#else
1619
caxpy_k:
20+
#endif
1721
.LCF0:
1822
0: addis 2,12,.TOC.-.LCF0@ha
1923
addi 2,2,.TOC.-.LCF0@l

kernel/power/icamax_power9.S

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
/*
12
.file "icamax.c"
23
.abiversion 2
34
.section ".text"
45
.align 2
56
.p2align 4,,15
67
.globl icamax_k
78
.type icamax_k, @function
9+
*/
10+
#define ASSEMBLER
11+
#include "common.h"
12+
13+
PROLOGUE
14+
815
icamax_k:
916
.LCF0:
1017
0: addis 2,12,.TOC.-.LCF0@ha

kernel/power/icamin_power9.S

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
/*
12
.file "icamin.c"
23
.abiversion 2
34
.section ".text"
45
.align 2
56
.p2align 4,,15
67
.globl icamin_k
78
.type icamin_k, @function
9+
*/
10+
#define ASSEMBLER
11+
#include "common.h"
12+
13+
PROLOGUE
14+
815
icamin_k:
916
.LCF0:
1017
0: addis 2,12,.TOC.-.LCF0@ha

kernel/power/isamax_power9.S

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
/*
12
.file "isamax.c"
23
.abiversion 2
34
.section ".text"
45
.align 2
56
.p2align 4,,15
67
.globl isamax_k
78
.type isamax_k, @function
9+
*/
10+
#define ASSEMBLER
11+
#include "common.h"
12+
13+
PROLOGUE
14+
815
isamax_k:
916
.LCF0:
1017
0: addis 2,12,.TOC.-.LCF0@ha

kernel/power/isamin_power9.S

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
/*
12
.file "isamin.c"
23
.abiversion 2
34
.section ".text"
45
.align 2
56
.p2align 4,,15
67
.globl isamin_k
78
.type isamin_k, @function
9+
*/
10+
#define ASSEMBLER
11+
#include "common.h"
12+
13+
PROLOGUE
14+
815
isamin_k:
916
.LCF0:
1017
0: addis 2,12,.TOC.-.LCF0@ha

0 commit comments

Comments
 (0)