2006-12-10 22:50:00 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Jens Arnold
|
|
|
|
*
|
|
|
|
* Fixed point library for plugins
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2006-12-10 22:50:00 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
long fsincos(unsigned long phase, long *cos);
|
2007-02-05 01:01:15 +00:00
|
|
|
long fsqrt(long a, unsigned int fracbits);
|
2007-07-31 04:59:03 +00:00
|
|
|
long cos_int(int val);
|
|
|
|
long sin_int(int val);
|
2007-07-31 17:23:49 +00:00
|
|
|
long flog(int x);
|
2008-01-23 08:25:04 +00:00
|
|
|
|
|
|
|
/* fast unsigned multiplication (16x16bit->32bit or 32x32bit->32bit,
|
|
|
|
* whichever is faster for the architecture) */
|
|
|
|
#ifdef CPU_ARM
|
|
|
|
#define FMULU(a, b) ((uint32_t) (((uint32_t) (a)) * ((uint32_t) (b))))
|
|
|
|
#else /* SH1, coldfire */
|
|
|
|
#define FMULU(a, b) ((uint32_t) (((uint16_t) (a)) * ((uint16_t) (b))))
|
|
|
|
#endif
|