summaryrefslogtreecommitdiff
path: root/apps/codecs
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2010-07-20 08:18:04 +0000
committerNils Wallménius <nils@rockbox.org>2010-07-20 08:18:04 +0000
commitf32294d6abff7c5952b3a0c079a54b53eb42eb40 (patch)
tree54a0bff738a41dabec9fe792b33b2279ddde4d89 /apps/codecs
parentbd78dc7693743e35a854d3a615a20474a7a450b2 (diff)
downloadrockbox-f32294d6abff7c5952b3a0c079a54b53eb42eb40.zip
rockbox-f32294d6abff7c5952b3a0c079a54b53eb42eb40.tar.gz
rockbox-f32294d6abff7c5952b3a0c079a54b53eb42eb40.tar.bz2
rockbox-f32294d6abff7c5952b3a0c079a54b53eb42eb40.tar.xz
Shorten: tweak some inline asm, use local lables to not cause problems when the function gets inlined, mark it as inline, tweak clobbers and use lea instead of add in one place. Fixes problems when building libffmpegFLAC with newer gcc.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27503 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-rw-r--r--apps/codecs/libffmpegFLAC/shndec.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/apps/codecs/libffmpegFLAC/shndec.c b/apps/codecs/libffmpegFLAC/shndec.c
index b107b35..78914f6 100644
--- a/apps/codecs/libffmpegFLAC/shndec.c
+++ b/apps/codecs/libffmpegFLAC/shndec.c
@@ -73,8 +73,7 @@ static unsigned int get_uint(ShortenContext *s, int k)
}
#if defined(CPU_COLDFIRE)
-static void coldfire_lshift_samples(int n, int shift, int32_t *samples) ICODE_ATTR_FLAC;
-static void coldfire_lshift_samples(int n, int shift, int32_t *samples)
+static inline void coldfire_lshift_samples(int n, int shift, int32_t *samples)
{
/*
for (i = 0; i < n; i++)
@@ -83,34 +82,33 @@ static void coldfire_lshift_samples(int n, int shift, int32_t *samples)
asm volatile (
"move.l %[n], %%d0 \n" /* d0 = loop counter */
"asr.l #2, %%d0 \n"
- "beq l1_shift \n"
- "l2_shift:" /* main loop (unroll by 4) */
+ "beq 1f \n"
+ "2:" /* main loop (unroll by 4) */
"movem.l (%[x]), %%d4-%%d7 \n"
"asl.l %[s], %%d4 \n"
"asl.l %[s], %%d5 \n"
"asl.l %[s], %%d6 \n"
"asl.l %[s], %%d7 \n"
"movem.l %%d4-%%d7, (%[x]) \n"
- "add.l #16, %[x] \n"
+ "lea.l (16, %[x]), %[x] \n"
"subq.l #1, %%d0 \n"
- "bne l2_shift \n"
- "l1_shift:" /* any loops left? */
+ "bne 2b \n"
+ "1:" /* any loops left? */
"and.l #3, %[n] \n"
- "beq l4_shift \n"
- "l3_shift:" /* remaining loops */
+ "beq 4f \n"
+ "3:" /* remaining loops */
"move.l (%[x]), %%d4 \n"
"asl.l %[s], %%d4 \n"
"move.l %%d4, (%[x])+ \n"
"subq.l #1, %[n] \n"
- "bne l3_shift \n"
- "l4_shift:" /* exit */
- : [n] "+d" (n), /* d1 */
- [s] "+d" (shift), /* d2 */
- [x] "+a" (samples) /* a0 */
- :
- : "%d0", "%d4", "%d5", "%d6", "%d7"
+ "bne 3b \n"
+ "4:" /* exit */
+ : [n] "+d" (n),
+ [x] "+a" (samples)
+ : [s] "d" (shift)
+ : "%d0", "%d4", "%d5", "%d6", "%d7", "cc", "memory"
);
}
#endif