Enable avx for Linux only if also fp16c available.
Allows to compile on i5 2400 und Ubuntu LTS 22.04.
This commit is contained in:
parent
502a400192
commit
2279cd25f7
1 changed files with 6 additions and 6 deletions
12
Makefile
12
Makefile
|
@ -81,8 +81,12 @@ ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686))
|
||||||
endif
|
endif
|
||||||
else ifeq ($(UNAME_S),Linux)
|
else ifeq ($(UNAME_S),Linux)
|
||||||
AVX1_M := $(shell grep "avx " /proc/cpuinfo)
|
AVX1_M := $(shell grep "avx " /proc/cpuinfo)
|
||||||
ifneq (,$(findstring avx,$(AVX1_M)))
|
F16C_M := $(shell grep "f16c " /proc/cpuinfo)
|
||||||
CFLAGS += -mavx
|
ifneq (,$(findstring f16c,$(F16C_M)))
|
||||||
|
CFLAGS += -mf16c
|
||||||
|
ifneq (,$(findstring avx,$(AVX1_M)))
|
||||||
|
CFLAGS += -mavx
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
AVX2_M := $(shell grep "avx2 " /proc/cpuinfo)
|
AVX2_M := $(shell grep "avx2 " /proc/cpuinfo)
|
||||||
ifneq (,$(findstring avx2,$(AVX2_M)))
|
ifneq (,$(findstring avx2,$(AVX2_M)))
|
||||||
|
@ -92,10 +96,6 @@ ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686))
|
||||||
ifneq (,$(findstring fma,$(FMA_M)))
|
ifneq (,$(findstring fma,$(FMA_M)))
|
||||||
CFLAGS += -mfma
|
CFLAGS += -mfma
|
||||||
endif
|
endif
|
||||||
F16C_M := $(shell grep "f16c " /proc/cpuinfo)
|
|
||||||
ifneq (,$(findstring f16c,$(F16C_M)))
|
|
||||||
CFLAGS += -mf16c
|
|
||||||
endif
|
|
||||||
SSE3_M := $(shell grep "sse3 " /proc/cpuinfo)
|
SSE3_M := $(shell grep "sse3 " /proc/cpuinfo)
|
||||||
ifneq (,$(findstring sse3,$(SSE3_M)))
|
ifneq (,$(findstring sse3,$(SSE3_M)))
|
||||||
CFLAGS += -msse3
|
CFLAGS += -msse3
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue