From 8cc8bb9bde265959ad69b3fc5cc84201461af1fb Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Wed, 28 Jul 2010 18:15:53 +0000 Subject: Submit next part of FS#11498. Unroll loop for minor speedup of libwmapro on ARM (1%). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27595 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libwmapro/wmapro_math.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'apps/codecs') diff --git a/apps/codecs/libwmapro/wmapro_math.h b/apps/codecs/libwmapro/wmapro_math.h index ba6421c9f5..6f8d6dbe0f 100644 --- a/apps/codecs/libwmapro/wmapro_math.h +++ b/apps/codecs/libwmapro/wmapro_math.h @@ -218,13 +218,13 @@ static inline void vector_fixmul_window(int32_t *dst, const int32_t *src0, dst += len; win += len; src0+= len; - for(i=-len, j=len-1; i<0; i++, j--) { - int32_t s0 = src0[i]; - int32_t s1 = src1[j]; - int32_t wi = -win[i]; - int32_t wj = -win[j]; - dst[i] = fixmul31(s0, wj) - fixmul31(s1, wi); - dst[j] = fixmul31(s0, wi) + fixmul31(s1, wj); + for(i=-len, j=len-1; i<0; i++, j--) { + int32_t s0 = src0[i]; /* s0 = src0[ 0 ... len-1] */ + int32_t s1 = src1[j]; /* s1 = src1[2*len-1 ... len] */ + int32_t wi = -win[i]; /* wi = -win[ 0 ... len-1] */ + int32_t wj = -win[j]; /* wj = -win[2*len-1 ... len] */ + dst[i] = fixmul31(s0, wj) - fixmul31(s1, wi); /* dst[ 0 ... len-1] */ + dst[j] = fixmul31(s0, wi) + fixmul31(s1, wj); /* dst[2*len-1 ... len] */ } } #endif @@ -232,9 +232,15 @@ static inline void vector_fixmul_window(int32_t *dst, const int32_t *src0, static inline void vector_fixmul_scalar(int32_t *dst, const int32_t *src, int32_t mul, int len) { + /* len is _always_ a multiple of 4, because len is the difference of sfb's + * which themselves are always a multiple of 4. */ int i; - for(i=0; i