[FFmpeg-cvslog] ARM: remove MUL64 and MAC64 inline asm

Mans Rullgard git at videolan.org
Tue Jun 7 03:49:12 CEST 2011


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Sun Jun  5 13:44:28 2011 +0100| [21c65125424ef3dd7e276dea14f8e8ef3292e388] | committer: Mans Rullgard

ARM: remove MUL64 and MAC64 inline asm

Current GCC versions know how to generate these instructions
properly and avoiding inline asm gives better code.  The MULH
function for ARMv5 uses the same instruction and is also not
needed any more.

The MLS64 macro remains since negating an input would normally
not be allowed as it would fail for INT_MIN.  In our uses, the
inputs never have this value and thus negating is safe.

Signed-off-by: Mans Rullgard <mans at mansr.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=21c65125424ef3dd7e276dea14f8e8ef3292e388
---

 libavcodec/arm/mathops.h |   31 +------------------------------
 1 files changed, 1 insertions(+), 30 deletions(-)

diff --git a/libavcodec/arm/mathops.h b/libavcodec/arm/mathops.h
index 3870fce..b27b18f 100644
--- a/libavcodec/arm/mathops.h
+++ b/libavcodec/arm/mathops.h
@@ -28,45 +28,16 @@
 
 #if HAVE_INLINE_ASM
 
-#define MULH MULH
-#define MUL64 MUL64
-
 #if HAVE_ARMV6
+#define MULH MULH
 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;
 }
-
-static inline av_const int64_t MUL64(int a, int b)
-{
-    int64_t x;
-    __asm__ ("smull %Q0, %R0, %1, %2" : "=r"(x) : "r"(a), "r"(b));
-    return x;
-}
-#else
-static inline av_const int MULH(int a, int b)
-{
-    int lo, hi;
-    __asm__ ("smull %0, %1, %2, %3" : "=&r"(lo), "=&r"(hi) : "r"(b), "r"(a));
-    return hi;
-}
-
-static inline av_const int64_t MUL64(int a, int b)
-{
-    int64_t x;
-    __asm__ ("smull %Q0, %R0, %1, %2" : "=&r"(x) : "r"(a), "r"(b));
-    return x;
-}
 #endif
 
-static inline av_const int64_t MAC64(int64_t d, int a, int b)
-{
-    __asm__ ("smlal %Q0, %R0, %1, %2" : "+r"(d) : "r"(a), "r"(b));
-    return d;
-}
-#define MAC64(d, a, b) ((d) = MAC64(d, a, b))
 #define MLS64(d, a, b) MAC64(d, -(a), b)
 
 #if HAVE_ARMV5TE



More information about the ffmpeg-cvslog mailing list