X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=Makefile.x86_64;h=f14a8a8ffe410c66349307dd579ed18461da11be;hb=refs%2Fheads%2Faccepted%2Ftizen_unified;hp=00967bcb6892684c33ccfbafdd12e30576958ffb;hpb=3331ca492d6da1466b96a363a62aac790d945376;p=platform%2Fupstream%2Fopenblas.git diff --git a/Makefile.x86_64 b/Makefile.x86_64 index 00967bc..f14a8a8 100644 --- a/Makefile.x86_64 +++ b/Makefile.x86_64 @@ -8,42 +8,57 @@ endif endif endif + +ifneq ($(DYNAMIC_ARCH),1) +ADD_CPUFLAGS = 1 +else +ifdef TARGET_CORE +ADD_CPUFLAGS = 1 +endif +endif + +ifdef ADD_CPUFLAGS ifdef HAVE_SSE3 CCOMMON_OPT += -msse3 +ifneq ($(F_COMPILER), NAG) FCOMMON_OPT += -msse3 endif +endif ifdef HAVE_SSSE3 CCOMMON_OPT += -mssse3 +ifneq ($(F_COMPILER), NAG) FCOMMON_OPT += -mssse3 endif +endif ifdef HAVE_SSE4_1 CCOMMON_OPT += -msse4.1 +ifneq ($(F_COMPILER), NAG) FCOMMON_OPT += -msse4.1 endif +endif ifndef OLDGCC ifdef HAVE_AVX CCOMMON_OPT += -mavx +ifneq ($(F_COMPILER), NAG) FCOMMON_OPT += -mavx endif endif +endif ifndef NO_AVX2 ifdef HAVE_AVX2 CCOMMON_OPT += -mavx2 +ifneq ($(F_COMPILER), NAG) FCOMMON_OPT += -mavx2 endif endif -ifndef OLDGCC -ifdef HAVE_FMA3 -CCOMMON_OPT += -mfma -FCOMMON_OPT += -mfma -endif endif ifeq ($(CORE), SKYLAKEX) -ifndef DYNAMIC_ARCH ifndef NO_AVX512 CCOMMON_OPT += -march=skylake-avx512 +ifneq ($(F_COMPILER), NAG) FCOMMON_OPT += -march=skylake-avx512 +endif ifeq ($(OSNAME), CYGWIN_NT) CCOMMON_OPT += -fno-asynchronous-unwind-tables FCOMMON_OPT += -fno-asynchronous-unwind-tables @@ -56,17 +71,22 @@ endif endif endif endif -endif ifeq ($(CORE), COOPERLAKE) -ifndef DYNAMIC_ARCH ifndef NO_AVX512 ifeq ($(C_COMPILER), GCC) # cooperlake support was added in 10.1 ifeq ($(GCCVERSIONGTEQ10)$(GCCMINORVERSIONGTEQ1), 11) CCOMMON_OPT += -march=cooperlake +ifneq ($(F_COMPILER), NAG) FCOMMON_OPT += -march=cooperlake endif +else # gcc not support, fallback to avx512 +CCOMMON_OPT += -march=skylake-avx512 +ifneq ($(F_COMPILER), NAG) +FCOMMON_OPT += -march=skylake-avx512 +endif +endif endif ifeq ($(OSNAME), CYGWIN_NT) CCOMMON_OPT += -fno-asynchronous-unwind-tables @@ -80,6 +100,34 @@ endif endif endif endif + +ifeq ($(CORE), SAPPHIRERAPIDS) +ifndef NO_AVX512 +ifeq ($(C_COMPILER), GCC) +# sapphire rapids support was added in 11 +ifeq ($(GCCVERSIONGTEQ11), 1) +CCOMMON_OPT += -march=sapphirerapids +ifneq ($(F_COMPILER), NAG) +FCOMMON_OPT += -march=sapphirerapids +endif +else # gcc not support, fallback to avx512 +CCOMMON_OPT += -march=skylake-avx512 +ifneq ($(F_COMPILER), NAG) +FCOMMON_OPT += -march=skylake-avx512 +endif +endif +endif +ifeq ($(OSNAME), CYGWIN_NT) +CCOMMON_OPT += -fno-asynchronous-unwind-tables +FCOMMON_OPT += -fno-asynchronous-unwind-tables +endif +ifeq ($(OSNAME), WINNT) +ifeq ($(C_COMPILER), GCC) +CCOMMON_OPT += -fno-asynchronous-unwind-tables +FCOMMON_OPT += -fno-asynchronous-unwind-tables +endif +endif +endif endif ifdef HAVE_AVX2 @@ -112,6 +160,7 @@ endif endif endif +endif ifeq ($(OSNAME), Interix)