summaryrefslogtreecommitdiff
path: root/libavcodec/arm
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-12 14:26:46 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-12 14:26:46 +0200
commite335658370840390272b70de92f5a76860537fb9 (patch)
tree8f9074bfd2d0f5c6c09c34f23b354ee9dbce7e56 /libavcodec/arm
parent43cce41267a7aa71946911e87b4dfce48183bb25 (diff)
parent9734b8ba56d05e970c353dfd5baafa43fdb08024 (diff)
Merge commit '9734b8ba56d05e970c353dfd5baafa43fdb08024'
* commit '9734b8ba56d05e970c353dfd5baafa43fdb08024': Move avutil tables only used in libavcodec to libavcodec. Conflicts: libavcodec/mathtables.c libavutil/intmath.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/arm')
-rw-r--r--libavcodec/arm/mathops.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/libavcodec/arm/mathops.h b/libavcodec/arm/mathops.h
index d67714c496..9313d6bbb0 100644
--- a/libavcodec/arm/mathops.h
+++ b/libavcodec/arm/mathops.h
@@ -36,6 +36,30 @@ static inline av_const int MULH(int a, int b)
__asm__ ("smmul %0, %1, %2" : "=r"(r) : "r"(a), "r"(b));
return r;
}
+
+#define FASTDIV FASTDIV
+static av_always_inline av_const int FASTDIV(int a, int b)
+{
+ int r;
+ __asm__ ("cmp %2, #2 \n\t"
+ "ldr %0, [%3, %2, lsl #2] \n\t"
+ "ite le \n\t"
+ "lsrle %0, %1, #1 \n\t"
+ "smmulgt %0, %0, %1 \n\t"
+ : "=&r"(r) : "r"(a), "r"(b), "r"(ff_inverse) : "cc");
+ return r;
+}
+
+#else /* HAVE_ARMV6 */
+
+#define FASTDIV FASTDIV
+static av_always_inline av_const int FASTDIV(int a, int b)
+{
+ int r, t;
+ __asm__ ("umull %1, %0, %2, %3"
+ : "=&r"(r), "=&r"(t) : "r"(a), "r"(ff_inverse[b]));
+ return r;
+}
#endif
#define MLS64(d, a, b) MAC64(d, -(a), b)