1
0
Fork 0
forked from len0rd/rockbox
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13786 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Giacomelli 2007-07-04 17:51:52 +00:00
parent 51b3bbbf1c
commit fe8ae10ab4
3 changed files with 25 additions and 25 deletions

View file

@ -53,30 +53,8 @@ fixed64 Fixed32To64(fixed32 x)
/*Sign-15.16 format */
#ifdef CPU_ARM
/* these are defines in wmafixed.h*/
#elif defined(CPU_COLDFIRE)
inline int32_t fixmul32(int32_t x, int32_t y)
{
#if PRECISION != 16
#warning Coldfire fixmul32() only works for PRECISION == 16
#endif
int32_t t1;
asm (
"mac.l %[x], %[y], %%acc0 \n" /* multiply */
"mulu.l %[y], %[x] \n" /* get lower half, avoid emac stall */
"movclr.l %%acc0, %[t1] \n" /* get higher half */
"lsr.l #1, %[t1] \n"
"move.w %[t1], %[x] \n"
"swap %[x] \n"
: /* outputs */
[t1]"=&d"(t1),
[x] "+d" (x)
: /* inputs */
[y] "d" (y)
);
return x;
}
#else
fixed32 fixmul32(fixed32 x, fixed32 y)
@ -91,7 +69,6 @@ fixed32 fixmul32(fixed32 x, fixed32 y)
}
/*
Special fixmul32 that does a 16.16 x 1.31 multiply that returns a 16.16 value.
this is needed because the fft constants are all normalized to be less then 1

View file

@ -85,7 +85,30 @@ long fsincos(unsigned long phase, fixed32 *cos);
})
#elif defined(CPU_COLDFIRE)
static inline int32_t fixmul32(int32_t x, int32_t y)
{
#if PRECISION != 16
#warning Coldfire fixmul32() only works for PRECISION == 16
#endif
int32_t t1;
asm (
"mac.l %[x], %[y], %%acc0 \n" /* multiply */
"mulu.l %[y], %[x] \n" /* get lower half, avoid emac stall */
"movclr.l %%acc0, %[t1] \n" /* get higher half */
"lsr.l #1, %[t1] \n"
"move.w %[t1], %[x] \n"
"swap %[x] \n"
: /* outputs */
[t1]"=&d"(t1),
[x] "+d" (x)
: /* inputs */
[y] "d" (y)
);
return x;
}
#else
fixed32 fixmul32(fixed32 x, fixed32 y);
fixed32 fixmul32b(fixed32 x, fixed32 y);
#endif