File tree Expand file tree Collapse file tree 4 files changed +35
-1
lines changed
Expand file tree Collapse file tree 4 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,9 @@ NO_AFFINITY = 1
9999# and OS. However, the performance is low.
100100# NO_AVX = 1
101101
102+ # Don't use Haswell optimizations if binutils is too old (e.g. RHEL6)
103+ # NO_AVX2 = 1
104+
102105# Don't use parallel make.
103106# NO_PARALLEL_MAKE = 1
104107
Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ ifeq ($(BINARY), 32)
109109GETARCH_FLAGS += -DNO_AVX
110110endif
111111
112+ ifeq ($(NO_AVX2), 1)
113+ GETARCH_FLAGS += -DNO_AVX2
114+ endif
115+
112116ifeq ($(DEBUG), 1)
113117GETARCH_FLAGS += -g
114118endif
@@ -385,7 +389,10 @@ endif
385389ifeq ($(ARCH), x86_64)
386390DYNAMIC_CORE = PRESCOTT CORE2 PENRYN DUNNINGTON NEHALEM OPTERON OPTERON_SSE3 BARCELONA BOBCAT ATOM NANO
387391ifneq ($(NO_AVX), 1)
388- DYNAMIC_CORE += SANDYBRIDGE BULLDOZER PILEDRIVER HASWELL
392+ DYNAMIC_CORE += SANDYBRIDGE BULLDOZER PILEDRIVER
393+ endif
394+ ifneq ($(NO_AVX2), 1)
395+ DYNAMIC_CORE += HASWELL
389396endif
390397endif
391398
@@ -777,6 +784,10 @@ ifeq ($(BINARY), 32)
777784CCOMMON_OPT += -DNO_AVX
778785endif
779786
787+ ifeq ($(NO_AVX2), 1)
788+ CCOMMON_OPT += -DNO_AVX2
789+ endif
790+
780791ifdef SMP
781792CCOMMON_OPT += -DSMP_SERVER
782793
Original file line number Diff line number Diff line change @@ -1062,7 +1062,11 @@ int get_cpuname(void){
10621062 case 12 :
10631063 case 15 :
10641064 if (support_avx ())
1065+ #ifndef NO_AVX2
10651066 return CPUTYPE_HASWELL ;
1067+ #else
1068+ return CPUTYPE_SANDYBRIDGE ;
1069+ #endif
10661070 else
10671071 return CPUTYPE_NEHALEM ;
10681072 }
@@ -1072,7 +1076,11 @@ int get_cpuname(void){
10721076 case 5 :
10731077 case 6 :
10741078 if (support_avx ())
1079+ #ifndef NO_AVX2
10751080 return CPUTYPE_HASWELL ;
1081+ #else
1082+ return CPUTYPE_SANDYBRIDGE ;
1083+ #endif
10761084 else
10771085 return CPUTYPE_NEHALEM ;
10781086 }
@@ -1471,7 +1479,11 @@ int get_coretype(void){
14711479 case 12 :
14721480 case 15 :
14731481 if (support_avx ())
1482+ #ifndef NO_AVX2
14741483 return CORE_HASWELL ;
1484+ #else
1485+ return CORE_SANDYBRIDGE ;
1486+ #endif
14751487 else
14761488 return CORE_NEHALEM ;
14771489 }
@@ -1481,7 +1493,11 @@ int get_coretype(void){
14811493 case 5 :
14821494 case 6 :
14831495 if (support_avx ())
1496+ #ifndef NO_AVX2
14841497 return CORE_HASWELL ;
1498+ #else
1499+ return CORE_SANDYBRIDGE ;
1500+ #endif
14851501 else
14861502 return CORE_NEHALEM ;
14871503 }
Original file line number Diff line number Diff line change @@ -66,7 +66,11 @@ extern gotoblas_t gotoblas_BOBCAT;
6666extern gotoblas_t gotoblas_SANDYBRIDGE ;
6767extern gotoblas_t gotoblas_BULLDOZER ;
6868extern gotoblas_t gotoblas_PILEDRIVER ;
69+ #ifdef NO_AVX2
70+ #define gotoblas_HASWELL gotoblas_SANDYBRIDGE
71+ #else
6972extern gotoblas_t gotoblas_HASWELL ;
73+ #endif
7074#else
7175//Use NEHALEM kernels for sandy bridge
7276#define gotoblas_SANDYBRIDGE gotoblas_NEHALEM
You can’t perform that action at this time.
0 commit comments