summaryrefslogtreecommitdiff
path: root/src/libfaad/fixed.h
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-04-12 14:58:46 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-04-12 14:58:46 +0000
commitc40876878a3e1743738f4ce813330812d8bf49f0 (patch)
tree98a2b74bd2cb014b25a395e186a579687ce59447 /src/libfaad/fixed.h
parent7be172b50ab8d2c90ac818bfe721e70c274d9880 (diff)
downloadxine-lib-c40876878a3e1743738f4ce813330812d8bf49f0.tar.gz
xine-lib-c40876878a3e1743738f4ce813330812d8bf49f0.tar.bz2
sync to faad2 cvs, remove some warnings.
CVS patchset: 4592 CVS date: 2003/04/12 14:58:46
Diffstat (limited to 'src/libfaad/fixed.h')
-rw-r--r--src/libfaad/fixed.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/libfaad/fixed.h b/src/libfaad/fixed.h
index ae5e5cc4a..5fae855ab 100644
--- a/src/libfaad/fixed.h
+++ b/src/libfaad/fixed.h
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: fixed.h,v 1.1 2002/12/16 19:00:06 miguelfreitas Exp $
+** $Id: fixed.h,v 1.2 2003/04/12 14:58:47 miguelfreitas Exp $
**/
#ifndef __FIXED_H__
@@ -71,6 +71,38 @@ static INLINE MUL_R_C(real_t A, real_t B)
}
}
+#elif defined(__GNUC__) && defined (__arm__)
+
+/* taken from MAD */
+#define arm_mul(x, y, SCALEBITS) \
+ ({ uint32_t __hi; \
+ uint32_t __lo; \
+ uint32_t __result; \
+ asm ("smull %0, %1, %3, %4\n\t" \
+ "movs %0, %0, lsr %5\n\t" \
+ "adc %2, %0, %1, lsl %6" \
+ : "=&r" (__lo), "=&r" (__hi), "=r" (__result) \
+ : "%r" (x), "r" (y), \
+ "M" (SCALEBITS), "M" (32 - (SCALEBITS)) \
+ : "cc"); \
+ __result; \
+ })
+
+static INLINE real_t MUL(real_t A, real_t B)
+{
+ return arm_mul( A, B, REAL_BITS);
+}
+
+static INLINE real_t MUL_C_C(real_t A, real_t B)
+{
+ return arm_mul( A, B, COEF_BITS);
+}
+
+static INLINE real_t MUL_R_C(real_t A, real_t B)
+{
+ return arm_mul( A, B, COEF_BITS);
+}
+
#else
/* multiply real with real */