diff options
author | Michael Giacomelli <giac2000@hotmail.com> | 2007-07-04 17:51:52 +0000 |
---|---|---|
committer | Michael Giacomelli <giac2000@hotmail.com> | 2007-07-04 17:51:52 +0000 |
commit | fe8ae10ab41af912bee3d6c5b0dd50ddc74739fa (patch) | |
tree | fb2cc1009699de10c8ce515902a702964551737e /apps/codecs/libwma/wmafixed.h | |
parent | 51b3bbbf1c8f9eeac997035bc333db05bd342a33 (diff) | |
download | rockbox-fe8ae10ab41af912bee3d6c5b0dd50ddc74739fa.tar.gz rockbox-fe8ae10ab41af912bee3d6c5b0dd50ddc74739fa.zip |
Attempt #2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13786 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwma/wmafixed.h')
-rw-r--r-- | apps/codecs/libwma/wmafixed.h | 23 |
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) | ||
89 | static 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 | |||
89 | fixed32 fixmul32(fixed32 x, fixed32 y); | 112 | fixed32 fixmul32(fixed32 x, fixed32 y); |
90 | fixed32 fixmul32b(fixed32 x, fixed32 y); | 113 | fixed32 fixmul32b(fixed32 x, fixed32 y); |
91 | #endif | 114 | #endif |