summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kroeker <martin@ruby.chemie.uni-freiburg.de>2019-07-03 19:16:30 +0200
committerGitHub <noreply@github.com>2019-07-03 19:16:30 +0200
commitabea977ded8729c6dcfcfbee51a18eceef8d8440 (patch)
tree127417a44fde3940e8e1318464f80c14175fa970
parent6b6c9b1441e231e229658d8d3331b0f683375635 (diff)
parent7684c4f8f8f979ec4d8a563e9b9cb442d9b04a80 (diff)
downloadopenblas-abea977ded8729c6dcfcfbee51a18eceef8d8440.tar.gz
openblas-abea977ded8729c6dcfcfbee51a18eceef8d8440.tar.bz2
openblas-abea977ded8729c6dcfcfbee51a18eceef8d8440.zip
Merge pull request #2162 from martin-frbg/pgi
Fixes for PGI compiler
-rw-r--r--Makefile.system3
-rw-r--r--Makefile.x86_644
-rw-r--r--common_x86_64.h5
3 files changed, 9 insertions, 3 deletions
diff --git a/Makefile.system b/Makefile.system
index c24647d62..16791bcc2 100644
--- a/Makefile.system
+++ b/Makefile.system
@@ -144,9 +144,10 @@ endif
# On x86_64 build getarch with march=native. This is required to detect AVX512 support in getarch.
ifeq ($(ARCH), x86_64)
+ifneq ($(C_COMPILER), PGI)
GETARCH_FLAGS += -march=native
endif
-
+endif
ifdef INTERFACE64
ifneq ($(INTERFACE64), 0)
diff --git a/Makefile.x86_64 b/Makefile.x86_64
index 1b7fe3ef4..99364752f 100644
--- a/Makefile.x86_64
+++ b/Makefile.x86_64
@@ -28,11 +28,15 @@ endif
ifeq ($(CORE), HASWELL)
ifndef DYNAMIC_ARCH
ifndef NO_AVX2
+ifeq ($(C_COMPILER), GCC)
CCOMMON_OPT += -mavx2
+endif
+ifeq ($(F_COMPILER), GFORTRAN)
FCOMMON_OPT += -mavx2
endif
endif
endif
+endif
diff --git a/common_x86_64.h b/common_x86_64.h
index f59ff6627..c05998d58 100644
--- a/common_x86_64.h
+++ b/common_x86_64.h
@@ -129,12 +129,13 @@ static __inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx){
*ecx=cpuinfo[2];
*edx=cpuinfo[3];
#else
- __asm__ __volatile__("cpuid"
+ __asm__ __volatile__("mov $0, %%ecx;"
+ "cpuid"
: "=a" (*eax),
"=b" (*ebx),
"=c" (*ecx),
"=d" (*edx)
- : "0" (op), "c"(0));
+ : "0" (op));
#endif
}