From f32294d6abff7c5952b3a0c079a54b53eb42eb40 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Tue, 20 Jul 2010 08:18:04 +0000 Subject: 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 --- apps/codecs/libffmpegFLAC/shndec.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'apps') diff --git a/apps/codecs/libffmpegFLAC/shndec.c b/apps/codecs/libffmpegFLAC/shndec.c index b107b356d7..78914f6252 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 -- cgit v1.2.3