Skip to content

Commit

Permalink
treewide: Enable VFP/NEON optimizations for aarch64
Browse files Browse the repository at this point in the history
For speexdsp, support for NEON on aarch64 was added in 1.2.0[1].

[1]: xiph/speexdsp#8

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
  • Loading branch information
jefferyto authored and 1715173329 committed May 16, 2020
1 parent 5c6ee40 commit dce5809
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 18 deletions.
5 changes: 3 additions & 2 deletions libs/libpng/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=libpng
PKG_VERSION:=1.6.37
PKG_RELEASE:=2
PKG_RELEASE:=4

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@SF/libpng
Expand Down Expand Up @@ -40,7 +40,8 @@ TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
--enable-shared \
--enable-static \
$(if $(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),--enable-hardware-optimizations=yes --enable-arm-neon=yes)
$(if $(findstring neon,$(CONFIG_CPU_TYPE))$(findstring aarch64,$(CONFIG_ARCH)), \
--enable-hardware-optimizations=yes --enable-arm-neon=yes)

define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/bin
Expand Down
4 changes: 2 additions & 2 deletions libs/opus/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=opus
PKG_VERSION:=1.3.1
PKG_RELEASE:=1
PKG_RELEASE:=3

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://archive.mozilla.org/pub/opus
Expand Down Expand Up @@ -47,7 +47,7 @@ ifeq ($(CONFIG_SOFT_FLOAT),y)
--enable-fixed-point
endif

ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
ifneq ($(findstring neon,$(CONFIG_CPU_TYPE))$(findstring aarch64,$(CONFIG_ARCH)),)
CONFIGURE_ARGS+= \
--enable-fixed-point
endif
Expand Down
3 changes: 1 addition & 2 deletions libs/speexdsp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=speexdsp
PKG_VERSION:=1.2.0
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.us.xiph.org/releases/speex/
Expand Down Expand Up @@ -60,7 +60,6 @@ CONFIGURE_ARGS += \
--enable-shared \
--enable-static \
--disable-examples \
$(if $(CONFIG_aarch64),--disable-neon) \
$(if $(CONFIG_SOFT_FLOAT),--enable-fixed-point --disable-float-api)

$(eval $(call BuildPackage,libspeexdsp))
19 changes: 13 additions & 6 deletions multimedia/ffmpeg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=ffmpeg
PKG_VERSION:=4.2.2
PKG_RELEASE:=1
PKG_RELEASE:=3

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://ffmpeg.org/releases/
Expand Down Expand Up @@ -246,7 +246,7 @@ $(call Package/ffmpeg/Default)
SECTION:=multimedia
CATEGORY:=Multimedia
TITLE+= program
DEPENDS+= +libffmpeg-full +openssl-util
DEPENDS+= +libffmpeg-full
VARIANT:=full
endef

Expand Down Expand Up @@ -391,8 +391,8 @@ FFMPEG_CONFIGURE:= \
--enable-shared \
--enable-static \
--enable-pthreads \
--enable-zlib \
--enable-protocol=rtmp,rtmps \
--enable-zlib \
--disable-doc \
--disable-debug \
\
Expand All @@ -412,7 +412,7 @@ FFMPEG_CONFIGURE+= \
--disable-fast-unaligned \
--disable-runtime-cpudetect

else ifneq ($(findstring arm,$(CONFIG_ARCH)),)
else ifneq ($(findstring arm,$(CONFIG_ARCH))$(findstring aarch64,$(CONFIG_ARCH)),)
FFMPEG_CONFIGURE+= \
--disable-runtime-cpudetect
# XXX: GitHub issue 3320 ppc cpu with fpu but no altivec (WNDR4700)
Expand All @@ -425,12 +425,12 @@ endif
ifneq ($(findstring arm,$(CONFIG_ARCH)),)
FFMPEG_CONFIGURE+= --enable-lto

ifneq ($(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)),)
ifneq ($(findstring vfp,$(CONFIG_CPU_TYPE)),)
FFMPEG_CONFIGURE+= --enable-vfp
else
FFMPEG_CONFIGURE+= --disable-vfp
endif
ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
ifneq ($(findstring neon,$(CONFIG_CPU_TYPE)),)
FFMPEG_CONFIGURE+= \
--enable-neon \
--enable-vfp
Expand All @@ -439,6 +439,13 @@ ifneq ($(findstring arm,$(CONFIG_ARCH)),)
endif
endif

ifneq ($(findstring aarch64,$(CONFIG_ARCH)),)
FFMPEG_CONFIGURE+= \
--enable-lto \
--enable-neon \
--enable-vfp
endif

ifeq ($(ARCH),x86_64)
FFMPEG_CONFIGURE+= --enable-lto
endif
Expand Down
13 changes: 7 additions & 6 deletions sound/mpg123/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=mpg123
PKG_VERSION:=1.25.13
PKG_RELEASE:=1
PKG_RELEASE:=3

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/mpg123
Expand Down Expand Up @@ -67,16 +67,17 @@ ifeq ($(CONFIG_SOFT_FLOAT),y)
CONFIGURE_ARGS+= \
--with-cpu=generic_nofpu \
--enable-int-quality=yes
else ifneq ($(findstring neon,$(CONFIG_CPU_TYPE)),)
CONFIGURE_ARGS+= \
--with-cpu=arm_fpu
else ifneq ($(findstring aarch64,$(CONFIG_ARCH)),)
CONFIGURE_ARGS+= \
--with-cpu=aarch64
else
CONFIGURE_ARGS+= \
--with-cpu=generic_fpu
endif

ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
CONFIGURE_ARGS+= \
--with-cpu=arm_fpu
endif

define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DATA) \
Expand Down

0 comments on commit dce5809

Please sign in to comment.