summaryrefslogtreecommitdiff
path: root/apps/plugins/imageviewer/jpeg
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/imageviewer/jpeg')
-rw-r--r--apps/plugins/imageviewer/jpeg/jpeg_decoder.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/apps/plugins/imageviewer/jpeg/jpeg_decoder.c b/apps/plugins/imageviewer/jpeg/jpeg_decoder.c
index 342b59c6a4..b014fa0ed1 100644
--- a/apps/plugins/imageviewer/jpeg/jpeg_decoder.c
+++ b/apps/plugins/imageviewer/jpeg/jpeg_decoder.c
@@ -39,23 +39,7 @@
39 39
40INLINE unsigned range_limit(int value) 40INLINE unsigned range_limit(int value)
41{ 41{
42#if CONFIG_CPU == SH7034 42#if defined(CPU_COLDFIRE)
43 unsigned tmp;
44 asm ( /* Note: Uses knowledge that only low byte of result is used */
45 "mov #-128,%[t] \n"
46 "sub %[t],%[v] \n" /* value -= -128; equals value += 128; */
47 "extu.b %[v],%[t] \n"
48 "cmp/eq %[v],%[t] \n" /* low byte == whole number ? */
49 "bt 1f \n" /* yes: no overflow */
50 "cmp/pz %[v] \n" /* overflow: positive? */
51 "subc %[v],%[v] \n" /* %[r] now either 0 or 0xffffffff */
52 "1: \n"
53 : /* outputs */
54 [v]"+r"(value),
55 [t]"=&r"(tmp)
56 );
57 return value;
58#elif defined(CPU_COLDFIRE)
59 asm ( /* Note: Uses knowledge that only the low byte of the result is used */ 43 asm ( /* Note: Uses knowledge that only the low byte of the result is used */
60 "add.l #128,%[v] \n" /* value += 128; */ 44 "add.l #128,%[v] \n" /* value += 128; */
61 "cmp.l #255,%[v] \n" /* overflow? */ 45 "cmp.l #255,%[v] \n" /* overflow? */