# HG changeset patch # User mru # Date 1216148792 0 # Node ID dc5a334c758bc1fb9981a089e8afb8f1b2846e4d # Parent 747908449de040ac7d6650a518945e4ca9dd58d0 ARM: optimised MAC64 and MLS64 diff -r 747908449de0 -r dc5a334c758b armv4l/mathops.h --- a/armv4l/mathops.h Tue Jul 15 19:06:29 2008 +0000 +++ b/armv4l/mathops.h Tue Jul 15 19:06:32 2008 +0000 @@ -57,6 +57,16 @@ } #define MUL64 MUL64 +static inline av_const int64_t MAC64(int64_t d, int a, int b) +{ + union { uint64_t x; unsigned hl[2]; } x = { d }; + asm ("smlal %0, %1, %2, %3" + : "+r"(x.hl[0]), "+r"(x.hl[1]) : "r"(a), "r"(b)); + return x.x; +} +#define MAC64(d, a, b) ((d) = MAC64(d, a, b)) +#define MLS64(d, a, b) MAC64(d, -(a), b) + #if defined(HAVE_ARMV5TE) /* signed 16x16 -> 32 multiply add accumulate */