1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2006 Jens Arnold
12 * Fixed point library for plugins
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
22 ****************************************************************************/
24 long fsincos(unsigned long phase
, long *cos
);
25 long fsqrt(long a
, unsigned int fracbits
);
26 long cos_int(int val
);
27 long sin_int(int val
);
30 /* fast unsigned multiplication (16x16bit->32bit or 32x32bit->32bit,
31 * whichever is faster for the architecture) */
33 #define FMULU(a, b) ((uint32_t) (((uint32_t) (a)) * ((uint32_t) (b))))
34 #else /* SH1, coldfire */
35 #define FMULU(a, b) ((uint32_t) (((uint16_t) (a)) * ((uint16_t) (b))))