Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to disable NEON extension #3679

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ CCASFLAGS=$(CFLAGS)
STATIC_LDFLAGS=-lstdc++
STRIP ?= strip
USE_STACK_PROTECTOR = Yes
USE_NEON=Yes

SHAREDLIB_MAJORVERSION=7
FULL_VERSION := 2.3.0
Expand Down
4 changes: 4 additions & 0 deletions build/arch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,22 @@ ifneq ($(filter-out arm64 arm64e, $(filter arm%, $(ARCH))),)
ifeq ($(USE_ASM), Yes)
ASM_ARCH = arm
ASMFLAGS += -I$(SRC_PATH)codec/common/arm/
ifeq ($(USE_NEON), Yes)
CFLAGS += -DHAVE_NEON
endif
endif
endif

#for arm64
ifneq ($(filter arm64 aarch64 arm64e, $(ARCH)),)
ifeq ($(USE_ASM), Yes)
ASM_ARCH = arm64
ASMFLAGS += -I$(SRC_PATH)codec/common/arm64/
ifeq ($(USE_NEON), Yes)
CFLAGS += -DHAVE_NEON_AARCH64
endif
endif
endif

#for mips
ifneq ($(filter mips mips64, $(ARCH)),)
Expand Down
10 changes: 8 additions & 2 deletions build/msvc-common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ else
endif
ifeq ($(ASM_ARCH), arm)
CCAS = gas-preprocessor.pl -as-type armasm -force-thumb -- armasm
CCASFLAGS = -nologo -DHAVE_NEON -ignore 4509
CCASFLAGS = -nologo -ignore 4509
ifeq ($(USE_NEON), Yes)
CCASFLAGS += -DHAVE_NEON
endif
endif

CC=cl
Expand All @@ -20,7 +23,10 @@ CXX_O=-Fo$@

ifeq ($(ASM_ARCH), arm64)
CCAS = clang-cl
CCASFLAGS = -nologo -DHAVE_NEON_AARCH64 --target=arm64-windows
CCASFLAGS = -nologo --target=arm64-windows
ifeq ($(USE_NEON), Yes)
CCASFLAGS += -DHAVE_NEON_AARCH64
endif
endif


Expand Down
5 changes: 4 additions & 1 deletion build/platform-mingw_nt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ endif
endif
ifeq ($(ASM_ARCH), arm)
CCAS = gas-preprocessor.pl -as-type clang -force-thumb -- $(CC)
CCASFLAGS = -DHAVE_NEON -mimplicit-it=always
CCASFLAGS = -mimplicit-it=always
ifeq ($(USE_NEON), Yes)
CCASFLAGS += -DHAVE_NEON
endif
endif
EXEEXT = .exe

12 changes: 8 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,17 @@ if ['linux', 'android', 'ios', 'darwin'].contains(system)
asm_inc = join_paths(meson.current_source_dir(), 'codec', 'common', 'x86', '')
elif cpu_family == 'arm'
asm_format = asm_format32
add_project_arguments('-DHAVE_NEON', language: 'c')
add_project_arguments('-DHAVE_NEON', language: 'c')
if get_option('neon').enabled()
add_project_arguments('-DHAVE_NEON', language: 'c')
add_project_arguments('-DHAVE_NEON', language: 'cpp')
endif
casm_inc = include_directories(join_paths('codec', 'common', 'arm'))
elif cpu_family == 'aarch64'
asm_format = asm_format64
add_project_arguments('-DHAVE_NEON_ARM64', language: 'c')
add_project_arguments('-DHAVE_NEON_ARM64', language: 'cpp')
if get_option('neon').enabled()
add_project_arguments('-DHAVE_NEON_ARM64', language: 'c')
add_project_arguments('-DHAVE_NEON_ARM64', language: 'cpp')
endif
casm_inc = include_directories(join_paths('codec', 'common', 'arm64'))
elif cpu_family == 'loongarch32'
asm_format = asm_format32
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
option('tests', type : 'feature', value : 'auto', yield : true)
option('neon', type : 'feature', value : 'enabled')