summaryrefslogtreecommitdiff
path: root/apps/codecs/libmad/fixed.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libmad/fixed.h')
-rw-r--r--apps/codecs/libmad/fixed.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/apps/codecs/libmad/fixed.h b/apps/codecs/libmad/fixed.h
index baa7dc59c8..7ccf1cb4ed 100644
--- a/apps/codecs/libmad/fixed.h
+++ b/apps/codecs/libmad/fixed.h
@@ -420,6 +420,29 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
420 420
421# define MAD_F_SCALEBITS MAD_F_FRACBITS 421# define MAD_F_SCALEBITS MAD_F_FRACBITS
422 422
423# elif defined(FPM_COLDFIRE_EMAC)
424
425/* mad_f_mul using the Coldfire MCF5249 EMAC unit. Loses 3 bits of accuracy.
426 Note that we don't define any of the libmad accumulator macros, as
427 any functions that use these should have the relevant sections rewritten
428 in assembler to utilise the EMAC accumulators properly.
429 Assumes the default +/- 3.28 fixed point format
430 */
431#define mad_f_mul(x, y) \
432({ \
433 mad_fixed64hi_t hi; \
434 asm volatile("mac.l %[a], %[b], %%acc0\n\t" \
435 "movclr.l %%acc0, %[hi]\n\t" \
436 "asl.l #3, %[hi]" \
437 : [hi] "=d" (hi) \
438 : [a] "r" ((x)), [b] "r" ((y))); \
439 hi; \
440})
441/* Define dummy mad_f_scale64 to prevent libmad from defining MAD_F_SCALEBITS
442 below. Having MAD_F_SCALEBITS defined screws up the PRESHIFT macro in synth.h
443 */
444#define mad_f_scale64(hi, lo) (lo)
445
423/* --- Default ------------------------------------------------------------- */ 446/* --- Default ------------------------------------------------------------- */
424 447
425# elif defined(FPM_DEFAULT) 448# elif defined(FPM_DEFAULT)