File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 5
5
TOPDIR = ..
6
6
include $(TOPDIR ) /Makefile.system
7
7
8
+ AVX2OPT =
9
+ ifeq ($(C_COMPILER ) , GCC)
10
+ # AVX2 support was added in 4.7.0
11
+ GCCVERSIONGTEQ4 := $(shell expr `$(CC ) -dumpversion | cut -f1 -d.` \>= 4)
12
+ GCCMINORVERSIONGTEQ7 := $(shell expr `$(CC ) -dumpversion | cut -f2 -d.` \>= 7)
13
+ ifeq ($(GCCVERSIONGTEQ4)$(GCCMINORVERSIONGTEQ7), 11)
14
+ AVX2OPT = -mavx2
15
+ endif
16
+ endif
17
+ ifeq ($(C_COMPILER ) , CLANG)
18
+ # Any clang posing as gcc 4.2 should be new enough (3.4 or later)
19
+ GCCVERSIONGTEQ4 := $(shell expr `$(CC ) -dumpversion | cut -f1 -d.` \>= 4)
20
+ GCCMINORVERSIONGTEQ2 := $(shell expr `$(CC ) -dumpversion | cut -f2 -d.` \>= 2)
21
+ ifeq ($(GCCVERSIONGTEQ4)$(GCCMINORVERSIONGTEQ2), 11)
22
+ AVX2OPT -mavx2
23
+ endif
24
+ endif
25
+ ifdef NO_AVX2
26
+ AVX2OPT =
27
+ endif
28
+
8
29
ifdef TARGET_CORE
9
30
ifeq ($(TARGET_CORE ) , SKYLAKEX)
10
31
override CFLAGS += -DBUILD_KERNEL -DTABLE_NAME=gotoblas_$(TARGET_CORE ) -march=skylake-avx512
@@ -17,9 +38,9 @@ ifeq ($(TARGET_CORE), SKYLAKEX)
17
38
endif
18
39
endif
19
40
else ifeq($(TARGET_CORE), HASWELL)
20
- override CFLAGS += -DBUILD_KERNEL -DTABLE_NAME=gotoblas_$(TARGET_CORE ) -mavx2
41
+ override CFLAGS += -DBUILD_KERNEL -DTABLE_NAME=gotoblas_$(TARGET_CORE ) $( AVX2OPT )
21
42
else
22
- override CFLAGS += -DBUILD_KERNEL -DTABLE_NAME=gotoblas_$(TARGET_CORE )
43
+ override CFLAGS += -DBUILD_KERNEL -DTABLE_NAME=gotoblas_$(TARGET_CORE )
23
44
endif
24
45
BUILD_KERNEL = 1
25
46
KDIR =
You can’t perform that action at this time.
0 commit comments