diff options
author | Marcoen Hirschberg <marcoen@gmail.com> | 2006-12-31 08:56:59 +0000 |
---|---|---|
committer | Marcoen Hirschberg <marcoen@gmail.com> | 2006-12-31 08:56:59 +0000 |
commit | 6d6eb0816ad38fe8d3f34706a1f26622fb7bc782 (patch) | |
tree | 62849086aba8c21cd5a0f8eb56a366499982d6cb | |
parent | c390620439d2c9298c7699aa7abbbf0ed775fbd8 (diff) | |
download | rockbox-6d6eb0816ad38fe8d3f34706a1f26622fb7bc782.tar.gz rockbox-6d6eb0816ad38fe8d3f34706a1f26622fb7bc782.zip |
fix for the inline asm in CLIP on the gigabeat by Steve Gotthard (fs#6488). Turns out that gcc rearranged the ASM block without volatile
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11873 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugins/mpegplayer/idct.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/plugins/mpegplayer/idct.c b/apps/plugins/mpegplayer/idct.c index 372d18a6dc..7ad78bfcd9 100644 --- a/apps/plugins/mpegplayer/idct.c +++ b/apps/plugins/mpegplayer/idct.c | |||
@@ -60,11 +60,10 @@ static inline unsigned CLIP(int value) | |||
60 | ); | 60 | ); |
61 | return value; | 61 | return value; |
62 | } | 62 | } |
63 | /* FIXME why doesn't this work on the gigabeat? */ | 63 | #elif defined CPU_ARM |
64 | #elif defined CPU_ARM && CONFIG_CPU != S3C2440 | ||
65 | static inline unsigned CLIP(int value) | 64 | static inline unsigned CLIP(int value) |
66 | { | 65 | { |
67 | asm ( /* Note: Uses knowledge that only the low byte of the result is used */ | 66 | asm volatile ( /* Note: Uses knowledge that only the low byte of the result is used */ |
68 | "cmp %[v], #255 \n" | 67 | "cmp %[v], #255 \n" |
69 | "mvnhi %[v], %[v], asr #31 \n" | 68 | "mvnhi %[v], %[v], asr #31 \n" |
70 | : /* outputs */ | 69 | : /* outputs */ |
@@ -302,7 +301,7 @@ void mpeg2_idct_init (uint32_t accel) | |||
302 | 301 | ||
303 | mpeg2_idct_copy = mpeg2_idct_copy_c; | 302 | mpeg2_idct_copy = mpeg2_idct_copy_c; |
304 | mpeg2_idct_add = mpeg2_idct_add_c; | 303 | mpeg2_idct_add = mpeg2_idct_add_c; |
305 | #if !defined(CPU_COLDFIRE) && !defined(CPU_ARM) || CONFIG_CPU == S3C2440 | 304 | #if !defined(CPU_COLDFIRE) && !defined(CPU_ARM) |
306 | for (i = -3840; i < 3840 + 256; i++) | 305 | for (i = -3840; i < 3840 + 256; i++) |
307 | CLIP(i) = (i < 0) ? 0 : ((i > 255) ? 255 : i); | 306 | CLIP(i) = (i < 0) ? 0 : ((i > 255) ? 255 : i); |
308 | #endif | 307 | #endif |