changeset 7280:c8b0366e066f libavcodec

ARM: ARMv6 optimised MULH
author mru
date Tue, 15 Jul 2008 19:06:25 +0000
parents 00858715211e
children 747908449de0
files armv4l/mathops.h
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/armv4l/mathops.h	Tue Jul 15 18:43:26 2008 +0000
+++ b/armv4l/mathops.h	Tue Jul 15 19:06:25 2008 +0000
@@ -33,10 +33,20 @@
          hi; })
 #endif
 
+#ifdef HAVE_ARMV6
+static inline av_const int MULH(int a, int b)
+{
+    int r;
+    asm ("smmul %0, %1, %2" : "=r"(r) : "r"(a), "r"(b));
+    return r;
+}
+#define MULH MULH
+#else
 #define MULH(a, b) \
     ({ int lo, hi;\
      asm ("smull %0, %1, %2, %3" : "=&r"(lo), "=&r"(hi) : "r"(b), "r"(a));\
      hi; })
+#endif
 
 #if defined(HAVE_ARMV5TE)