diff options
Diffstat (limited to 'apps/plugins/fractals/cpu_coldfire.h')
-rw-r--r-- | apps/plugins/fractals/cpu_coldfire.h | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/apps/plugins/fractals/cpu_coldfire.h b/apps/plugins/fractals/cpu_coldfire.h index 452f18e2c5..9be207ee2f 100644 --- a/apps/plugins/fractals/cpu_coldfire.h +++ b/apps/plugins/fractals/cpu_coldfire.h | |||
@@ -22,8 +22,39 @@ | |||
22 | #ifndef _CPU_COLDFIRE_H | 22 | #ifndef _CPU_COLDFIRE_H |
23 | #define _CPU_COLDFIRE_H | 23 | #define _CPU_COLDFIRE_H |
24 | 24 | ||
25 | inline short muls16_asr10(short a, short b); | 25 | inline static short muls16_asr10(short a, short b) |
26 | { | ||
27 | asm ( | ||
28 | "muls.w %[a],%[b] \n" | ||
29 | "asr.l #8,%[b] \n" | ||
30 | "asr.l #2,%[b] \n" | ||
31 | : /* outputs */ | ||
32 | [b]"+d"(b) | ||
33 | : /* inputs */ | ||
34 | [a]"d" (a) | ||
35 | ); | ||
36 | return b; | ||
37 | } | ||
26 | 38 | ||
27 | inline long muls32_asr26(long a, long b); | 39 | inline static long muls32_asr26(long a, long b) |
40 | { | ||
41 | long r, t1; | ||
42 | asm ( | ||
43 | "mac.l %[a], %[b], %%acc0 \n" /* multiply */ | ||
44 | "move.l %%accext01, %[t1] \n" /* get low part */ | ||
45 | "movclr.l %%acc0, %[r] \n" /* get high part */ | ||
46 | "asl.l #5, %[r] \n" /* hi <<= 5, plus one free */ | ||
47 | "lsr.l #3, %[t1] \n" /* lo >>= 3 */ | ||
48 | "and.l #0x1f, %[t1] \n" /* mask out unrelated bits */ | ||
49 | "or.l %[t1], %[r] \n" /* combine result */ | ||
50 | : /* outputs */ | ||
51 | [r] "=d"(r), | ||
52 | [t1]"=d"(t1) | ||
53 | : /* inputs */ | ||
54 | [a] "d" (a), | ||
55 | [b] "d" (b) | ||
56 | ); | ||
57 | return r; | ||
58 | } | ||
28 | 59 | ||
29 | #endif | 60 | #endif |