Jens Arnold | f98fd72 | 2006-12-10 22:50:00 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 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 Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 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. |
Jens Arnold | f98fd72 | 2006-12-10 22:50:00 +0000 | [diff] [blame] | 18 | * |
| 19 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 20 | * KIND, either express or implied. |
| 21 | * |
| 22 | ****************************************************************************/ |
| 23 | |
| 24 | long fsincos(unsigned long phase, long *cos); |
Thom Johansen | 5f48e15 | 2007-02-05 01:01:15 +0000 | [diff] [blame] | 25 | long fsqrt(long a, unsigned int fracbits); |
Kevin Ferrare | df4f56b | 2007-07-31 04:59:03 +0000 | [diff] [blame] | 26 | long cos_int(int val); |
| 27 | long sin_int(int val); |
Robert Keevil | 98e6073 | 2007-07-31 17:23:49 +0000 | [diff] [blame] | 28 | long flog(int x); |
Kevin Ferrare | ebe5acf | 2008-01-23 08:25:04 +0000 | [diff] [blame] | 29 | |
| 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 |