diff --git a/client/deps/hardnested.cmake b/client/deps/hardnested.cmake index 78f763039..524d4c939 100644 --- a/client/deps/hardnested.cmake +++ b/client/deps/hardnested.cmake @@ -17,6 +17,7 @@ target_compile_definitions(pm3rrg_rdv4_hardnested_nosimd PRIVATE NOSIMD_BUILD) ## Mingw platforms: AMD64 set(X86_CPUS x86 x86_64 i686 AMD64) set(ARM64_CPUS arm64 aarch64) +set(ARM32_CPUS armel armhf) message(STATUS "CMAKE_SYSTEM_PROCESSOR := ${CMAKE_SYSTEM_PROCESSOR}") @@ -118,6 +119,26 @@ elseif ("${CMAKE_SYSTEM_PROCESSOR}" IN_LIST ARM64_CPUS) target_compile_options(pm3rrg_rdv4_hardnested_neon PRIVATE -Wall -Werror -O3) set_property(TARGET pm3rrg_rdv4_hardnested_neon PROPERTY POSITION_INDEPENDENT_CODE ON) + target_include_directories(pm3rrg_rdv4_hardnested_neon PRIVATE + ../../common + ../../include + ../src) + + set(SIMD_TARGETS + $) +elseif ("${CMAKE_SYSTEM_PROCESSOR}" IN_LIST ARM32_CPUS) + message(STATUS "Building optimised arm binaries") + + ## arm64 / NEON + add_library(pm3rrg_rdv4_hardnested_neon OBJECT + hardnested/hardnested_bf_core.c + hardnested/hardnested_bitarray_core.c) + + target_compile_options(pm3rrg_rdv4_hardnested_neon PRIVATE -Wall -Werror -O3) + target_compile_options(pm3rrg_rdv4_hardnested_neon BEFORE PRIVATE + -mfpu=neon) + set_property(TARGET pm3rrg_rdv4_hardnested_neon PROPERTY POSITION_INDEPENDENT_CODE ON) + target_include_directories(pm3rrg_rdv4_hardnested_neon PRIVATE ../../common ../../include diff --git a/client/deps/hardnested/Makefile b/client/deps/hardnested/Makefile index a7512ec91..1667e036f 100644 --- a/client/deps/hardnested/Makefile +++ b/client/deps/hardnested/Makefile @@ -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