blob: dfabbad8dc17557e3580c75e910cf8d1f7d3ea20 [file] [log] [blame]
Jens Arnoldf98fd722006-12-10 22:50:00 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 Jens Arnold
11 *
12 * Fixed point library for plugins
13 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000014 * 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.
Jens Arnoldf98fd722006-12-10 22:50:00 +000018 *
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
21 *
22 ****************************************************************************/
23
24long fsincos(unsigned long phase, long *cos);
Thom Johansen5f48e152007-02-05 01:01:15 +000025long fsqrt(long a, unsigned int fracbits);
Kevin Ferraredf4f56b2007-07-31 04:59:03 +000026long cos_int(int val);
27long sin_int(int val);
Robert Keevil98e60732007-07-31 17:23:49 +000028long flog(int x);
Kevin Ferrareebe5acf2008-01-23 08:25:04 +000029
30/* fast unsigned multiplication (16x16bit->32bit or 32x32bit->32bit,
31 * whichever is faster for the architecture) */
32#ifdef CPU_ARM
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))))
36#endif