Skip to content

Commit 3832620

Browse files
authored
Merge pull request #2740 from RajalakshmiSR/clang-power
Fix compilation issues with clang on POWER
2 parents 5fa581c + d557584 commit 3832620

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

Makefile.power

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,34 @@ endif
1111

1212
ifeq ($(CORE), POWER10)
1313
ifeq ($(USE_OPENMP), 1)
14-
COMMON_OPT += -Ofast -mcpu=power10 -mtune=power10 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
15-
FCOMMON_OPT += -O2 -frecursive -mcpu=power10 -mtune=power10 -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
14+
COMMON_OPT += -Ofast -mcpu=power10 -mtune=power10 -mvsx -DUSE_OPENMP -fno-fast-math -fopenmp
15+
FCOMMON_OPT += -O2 -frecursive -mcpu=power10 -mtune=power10 -DUSE_OPENMP -fno-fast-math -fopenmp
1616
else
17-
COMMON_OPT += -Ofast -mcpu=power10 -mtune=power10 -mvsx -malign-power -fno-fast-math
18-
FCOMMON_OPT += -O2 -frecursive -mcpu=power10 -mtune=power10 -malign-power -fno-fast-math
17+
COMMON_OPT += -Ofast -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math
18+
FCOMMON_OPT += -O2 -frecursive -mcpu=power10 -mtune=power10 -fno-fast-math
1919
endif
2020
endif
2121

2222
ifeq ($(CORE), POWER9)
2323
ifeq ($(USE_OPENMP), 1)
2424
ifneq ($(C_COMPILER), PGI)
25-
CCOMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
25+
CCOMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -DUSE_OPENMP -fno-fast-math -fopenmp
2626
else
2727
CCOMMON_OPT += -fast -Mvect=simd -Mcache_align -DUSE_OPENMP -mp
2828
endif
2929
ifneq ($(F_COMPILER), PGI)
30-
FCOMMON_OPT += -O2 -frecursive -mcpu=power9 -mtune=power9 -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
30+
FCOMMON_OPT += -O2 -frecursive -mcpu=power9 -mtune=power9 -DUSE_OPENMP -fno-fast-math -fopenmp
3131
else
3232
FCOMMON_OPT += -O2 -Mrecursive -DUSE_OPENMP -mp
3333
endif
3434
else
3535
ifneq ($(C_COMPILER), PGI)
36-
CCOMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -malign-power -fno-fast-math
36+
CCOMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -fno-fast-math
3737
else
3838
CCOMMON_OPT += -fast -Mvect=simd -Mcache_align
3939
endif
4040
ifneq ($(F_COMPILER), PGI)
41-
FCOMMON_OPT += -O2 -frecursive -mcpu=power9 -mtune=power9 -malign-power -fno-fast-math
41+
FCOMMON_OPT += -O2 -frecursive -mcpu=power9 -mtune=power9 -fno-fast-math
4242
else
4343
FCOMMON_OPT += -O2 -Mrecursive
4444
endif
@@ -48,26 +48,26 @@ endif
4848
ifeq ($(CORE), POWER8)
4949
ifeq ($(USE_OPENMP), 1)
5050
ifneq ($(C_COMPILER), PGI)
51-
CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
51+
CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -DUSE_OPENMP -fno-fast-math -fopenmp
5252
else
5353
CCOMMON_OPT += -fast -Mvect=simd -Mcache_align -DUSE_OPENMP -mp
5454
endif
5555
ifneq ($(F_COMPILER), PGI)
56-
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
56+
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -DUSE_OPENMP -fno-fast-math -fopenmp
5757
else
5858
FCOMMON_OPT += -O2 -Mrecursive -DUSE_OPENMP -mp
5959
endif
6060
else
6161
ifneq ($(C_COMPILER), PGI)
62-
CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -fno-fast-math
62+
CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math
6363
else
6464
CCOMMON_OPT += -fast -Mvect=simd -Mcache_align
6565
endif
6666
ifneq ($(F_COMPILER), PGI)
6767
ifeq ($(OSNAME), AIX)
68-
FCOMMON_OPT += -O1 -frecursive -mcpu=power8 -mtune=power8 -malign-power -fno-fast-math
68+
FCOMMON_OPT += -O1 -frecursive -mcpu=power8 -mtune=power8 -fno-fast-math
6969
else
70-
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -fno-fast-math
70+
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -fno-fast-math
7171
endif
7272
else
7373
FCOMMON_OPT += -O2 -Mrecursive

kernel/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ ifeq ($(C_COMPILER), GCC)
1010
GCCVERSIONGTEQ9 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 9)
1111
endif
1212

13+
ifeq ($(ARCH), power)
14+
ifeq ($(C_COMPILER), CLANG)
15+
override CFLAGS += -fno-integrated-as
16+
endif
17+
endif
1318
AVX2OPT =
1419
ifeq ($(C_COMPILER), GCC)
1520
# AVX2 support was added in 4.7.0

kernel/power/dgemv_t.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ static void dgemv_kernel_4x8(BLASLONG n, BLASLONG lda, double *ap, double *x, do
359359
"stxvd2x 39, %[off], %[y] \n\t"
360360
"stxvd2x 40, %[off2], %[y] \n\t"
361361

362-
: [memy] "+m" (*(const double (*)[8])y),
362+
: [memy] "+m" (*(double (*)[8])y),
363363
[n] "+&r" (n),
364364
[a0] "=b" (a0),
365365
[a1] "=&b" (a1),
@@ -373,7 +373,7 @@ static void dgemv_kernel_4x8(BLASLONG n, BLASLONG lda, double *ap, double *x, do
373373
[off2]"=&b" (off2),
374374
[temp] "=&b" (tempR)
375375
: [memx] "m" (*(const double (*)[n])x),
376-
[mem_ap] "m" (*(const double (*)[]) ap),
376+
[mem_ap] "m" (*(const double (*)[n*8]) ap),
377377
[alpha] "d" (alpha),
378378
"[a0]" (ap),
379379
[x] "b" (x),

0 commit comments

Comments
 (0)