Make NEON build detection a bit more robust

This commit is contained in:
Mark Dietzer 2022-03-31 18:18:18 -07:00
commit 4f345be6e8
2 changed files with 31 additions and 1 deletions

View file

@ -13,6 +13,9 @@ endif
ifneq ($(findstring amd64, $(cpu_arch)), )
IS_SIMD_ARCH=x86
endif
ifneq ($(findstring arm, $(cpu_arch)), )
IS_SIMD_ARCH=arm
endif
ifneq ($(findstring arm64, $(cpu_arch)), )
IS_SIMD_ARCH=arm64
endif
@ -24,13 +27,14 @@ ifneq ($(IS_SIMD_ARCH), )
MULTIARCHSRCS = hardnested_bf_core.c hardnested_bitarray_core.c
endif
ifeq ($(MULTIARCHSRCS), )
MYCFLAGS += -DNOSIMD_BUILD
MYSRCS += hardnested_bf_core.c hardnested_bitarray_core.c
endif
LIB_A = libhardnested.a
MYOBJS = $(MYSRCS:%.c=$(OBJDIR)/%.o)
ifeq ($(IS_SIMD_ARCH), arm64)
ifneq ($(findstring arm, $(IS_SIMD_ARCH)), )
MYOBJS += $(MULTIARCHSRCS:%.c=$(OBJDIR)/%_NOSIMD.o) \
$(MULTIARCHSRCS:%.c=$(OBJDIR)/%_NEON.o)
else
@ -54,6 +58,11 @@ ifeq ($(IS_SIMD_ARCH), arm64)
SUPPORTS_AVX512=False
HARD_SWITCH_NOSIMD = -DNOSIMD_BUILD
endif
ifeq ($(IS_SIMD_ARCH), arm)
SUPPORTS_AVX512=False
HARD_SWITCH_NEON = -mfpu=neon
HARD_SWITCH_NOSIMD = -DNOSIMD_BUILD
endif
ifeq "$(SUPPORTS_AVX512)" "True"
HARD_SWITCH_NOSIMD += -mno-avx512f
HARD_SWITCH_MMX += -mno-avx512f