summaryrefslogtreecommitdiff
path: root/apps/codecs/libwma/wmafixed.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libwma/wmafixed.h')
-rw-r--r--apps/codecs/libwma/wmafixed.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/apps/codecs/libwma/wmafixed.h b/apps/codecs/libwma/wmafixed.h
index 878601d799..887973a78a 100644
--- a/apps/codecs/libwma/wmafixed.h
+++ b/apps/codecs/libwma/wmafixed.h
@@ -85,7 +85,30 @@ long fsincos(unsigned long phase, fixed32 *cos);
85 }) 85 })
86 86
87 87
88#elif defined(CPU_COLDFIRE)
89static inline int32_t fixmul32(int32_t x, int32_t y)
90{
91#if PRECISION != 16
92#warning Coldfire fixmul32() only works for PRECISION == 16
93#endif
94 int32_t t1;
95 asm (
96 "mac.l %[x], %[y], %%acc0 \n" /* multiply */
97 "mulu.l %[y], %[x] \n" /* get lower half, avoid emac stall */
98 "movclr.l %%acc0, %[t1] \n" /* get higher half */
99 "lsr.l #1, %[t1] \n"
100 "move.w %[t1], %[x] \n"
101 "swap %[x] \n"
102 : /* outputs */
103 [t1]"=&d"(t1),
104 [x] "+d" (x)
105 : /* inputs */
106 [y] "d" (y)
107 );
108 return x;
109}
88#else 110#else
111
89fixed32 fixmul32(fixed32 x, fixed32 y); 112fixed32 fixmul32(fixed32 x, fixed32 y);
90fixed32 fixmul32b(fixed32 x, fixed32 y); 113fixed32 fixmul32b(fixed32 x, fixed32 y);
91#endif 114#endif