1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Marcoen Hirschberg 2006-12-31 08:56:59 +00:00
parent c390620439
commit 6d6eb0816a

View file

@ -60,11 +60,10 @@ static inline unsigned CLIP(int value)
); );
return value; return value;
} }
/* FIXME why doesn't this work on the gigabeat? */ #elif defined CPU_ARM
#elif defined CPU_ARM && CONFIG_CPU != S3C2440
static inline unsigned CLIP(int value) static inline unsigned CLIP(int value)
{ {
asm ( /* Note: Uses knowledge that only the low byte of the result is used */ asm volatile ( /* Note: Uses knowledge that only the low byte of the result is used */
"cmp %[v], #255 \n" "cmp %[v], #255 \n"
"mvnhi %[v], %[v], asr #31 \n" "mvnhi %[v], %[v], asr #31 \n"
: /* outputs */ : /* outputs */
@ -302,7 +301,7 @@ void mpeg2_idct_init (uint32_t accel)
mpeg2_idct_copy = mpeg2_idct_copy_c; mpeg2_idct_copy = mpeg2_idct_copy_c;
mpeg2_idct_add = mpeg2_idct_add_c; mpeg2_idct_add = mpeg2_idct_add_c;
#if !defined(CPU_COLDFIRE) && !defined(CPU_ARM) || CONFIG_CPU == S3C2440 #if !defined(CPU_COLDFIRE) && !defined(CPU_ARM)
for (i = -3840; i < 3840 + 256; i++) for (i = -3840; i < 3840 + 256; i++)
CLIP(i) = (i < 0) ? 0 : ((i > 255) ? 255 : i); CLIP(i) = (i < 0) ? 0 : ((i > 255) ? 255 : i);
#endif #endif