Skip to contentSkip to conversation

mpg123: use code optimized for ARM NEON SIMD engine if available

PATCH New Thomas Petazzoni 2 participants 2 messages Jun 1, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mpg123: use code optimized for ARM NEON SIMD engine if available

From: Sven Neumann <[email protected]>

[Thomas: as suggested by Peter, enable NEON as soon as NEON is available, not necessarily when NEON is used as the default FPU. Note that this requires passing -mfpu=neon to build mpg123, so that for this specific package, the NEON unit is used as the FPU.]

---
 package/mpg123/mpg123.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/mpg123/mpg123.mk +7 -0
index d66592c..98fdc3e 100644
@@ -13,10 +13,16 @@ MPG123_LICENSE = LGPLv2.1
 MPG123_LICENSE_FILES = COPYING
 
 MPG123_CPU = $(if $(BR2_SOFT_FLOAT),generic_nofpu,generic_fpu)
+MPG123_CFLAGS = $(TARGET_CFLAGS)
 
 ifeq ($(BR2_arm),y)
+ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
+MPG123_CPU = neon
+MPG123_CFLAGS += -mfpu=neon
+else
 MPG123_CPU = arm_nofpu
 endif
+endif
 
 ifeq ($(BR2_i386),y)
 MPG123_CPU = x86
@@ -34,6 +40,7 @@ MPG123_CPU = x86-64
 endif
 
 MPG123_CONF_OPT += --with-cpu=$(MPG123_CPU)
+MPG123_CONF_ENV += CFLAGS="$(MPG123_CFLAGS)"
 
 MPG123_AUDIO = dummy oss
 
Signature · 1 line
1.9.3
#1 lore raw

PATCH v2 1/1 mpg123: use code optimized for ARM NEON SIMD engine if available

Quoted 9 lines · Thomas Petazzoni

From: Sven Neumann <[email protected]>

[Thomas: as suggested by Peter, enable NEON as soon as NEON is available, not necessarily when NEON is used as the default FPU. Note that this requires passing -mfpu=neon to build mpg123, so that for this specific package, the NEON unit is used as the FPU.]

It might be better to look at the new mpg123 release that does ARM optimizations in a different (and possibly incompatible) way. 1.20.0 for Aarch64, 1.19.0 for ARM (--with-cpu for configure). Regards.