diff options
author | Eric Wong <normalperson@yhbt.net> | 2006-09-01 02:49:49 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2006-09-09 18:57:40 -0700 |
commit | 3df8e38af6da6c0699da8ef040ffc80cf7dab810 (patch) | |
tree | f931e7aa499850db2992262f38aa3c1ccbd9d332 /configure.in | |
parent | f345a3435dde249874fde205ef4b793184e1e7c4 (diff) | |
download | flac-arm-1.1.3-3df8e38af6da6c0699da8ef040ffc80cf7dab810.tar.gz |
Add ARM assembly optimizations
This was my first time writing ARM assembly, so it may not be the best; but they're still significantly faster than the optimized C versions[1] of the functions replace. An knowledgable ARM coder should be able to make better optimizations, but nobody has done so for FLAC yet (at least not publicly, to my knowledge), so I decided to take a stab at it. Also tweaked configure.in a bit to better support cross-compilation. no longer enable 3dnow, sse, or altivec optimizations unless our CPU supports them. (note: sse and 3dnow are supported by 64-bit chips, but the code is currently only optimized for 32-bit sse and 3dnow). FLAC__fixed_restore_signal_asm_arm and FLAC__lpc_restore_signal_asm_arm are pretty well-tested from tracks in my music collection. I do not think I have any music that can exersises FLAC__lpc_restore_signal_asm_arm_wide (especially the 64-bit ASR macro). These optimizations changes result in an approximately 20% reduction in decoding time on my 3rd generation ipod (running ipodlinux). [1] - I still have them at hand, but they're not probably not worth it for the non-ASM optimized architectures.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/configure.in b/configure.in index 7dce4e77..bf48c4d7 100644 --- a/configure.in +++ b/configure.in @@ -61,6 +61,11 @@ case "$host_cpu" in AC_DEFINE(FLAC__CPU_PPC) AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC]) ;; + arm) + cpu_arm=true + AC_DEFINE(FLAC__CPU_ARM) + AH_TEMPLATE(FLAC__CPU_ARM, [define if building for ARM]) + ;; sparc) cpu_sparc=true AC_DEFINE(FLAC__CPU_SPARC) @@ -69,6 +74,7 @@ case "$host_cpu" in esac AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue) AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue) +AM_CONDITIONAL(FLaC__CPU_ARM, test "x$cpu_arm" = xtrue) AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue) case "$host" in i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;; @@ -119,8 +125,8 @@ AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supp no) sse_os=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;; esac],[sse_os=false]) -AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue) -if test "x$sse_os" = xtrue ; then +AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue && test "x$cpu_ia32" = xtrue) +if test "x$sse_os" = xtrue && test "x$cpu_ia32" = xtrue; then AC_DEFINE(FLAC__SSE_OS) AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions]) fi @@ -132,8 +138,8 @@ AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]), no) use_3dnow=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;; esac],[use_3dnow=true]) -AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue) -if test "x$use_3dnow" = xtrue ; then +AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue && test "x$cpu_ia32" = xtrue) +if test "x$use_3dnow" = xtrue && test "x$cpu_ia32" = xtrue; then AC_DEFINE(FLAC__USE_3DNOW) AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions]) fi @@ -145,8 +151,8 @@ AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]), no) use_altivec=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;; esac],[use_altivec=true]) -AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue) -if test "x$use_altivec" = xtrue ; then +AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue && test "x$cpu_ppc" = xtrue) +if test "x$use_altivec" = xtrue && test "x$cpu_ppc" = xtrue; then AC_DEFINE(FLAC__USE_ALTIVEC) AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions]) fi @@ -281,6 +287,7 @@ AC_CONFIG_FILES([ \ Makefile \ src/Makefile \ src/libFLAC/Makefile \ + src/libFLAC/arm/Makefile \ src/libFLAC/ia32/Makefile \ src/libFLAC/ppc/Makefile \ src/libFLAC/ppc/as/Makefile \ |