Mercurial > libavutil.hg
comparison arm/intmath.h @ 980:f08c66310125 libavutil
ARM: intmath.h cosmetics
author | mru |
---|---|
date | Wed, 07 Jul 2010 17:27:48 +0000 |
parents | 4d9ad0ed07d0 |
children | d004c9e2aa40 |
comparison
equal
deleted
inserted
replaced
979:a3c26f53e6fa | 980:f08c66310125 |
---|---|
25 #include "libavutil/attributes.h" | 25 #include "libavutil/attributes.h" |
26 | 26 |
27 #if HAVE_INLINE_ASM | 27 #if HAVE_INLINE_ASM |
28 | 28 |
29 #if HAVE_ARMV6 | 29 #if HAVE_ARMV6 |
30 | |
31 #define FASTDIV FASTDIV | |
30 static inline av_const int FASTDIV(int a, int b) | 32 static inline av_const int FASTDIV(int a, int b) |
31 { | 33 { |
32 int r, t; | 34 int r, t; |
33 __asm__ volatile("cmp %3, #2 \n\t" | 35 __asm__ volatile("cmp %3, #2 \n\t" |
34 "ldr %1, [%4, %3, lsl #2] \n\t" | 36 "ldr %1, [%4, %3, lsl #2] \n\t" |
35 "lsrle %0, %2, #1 \n\t" | 37 "lsrle %0, %2, #1 \n\t" |
36 "smmulgt %0, %1, %2 \n\t" | 38 "smmulgt %0, %1, %2 \n\t" |
37 : "=&r"(r), "=&r"(t) : "r"(a), "r"(b), "r"(ff_inverse)); | 39 : "=&r"(r), "=&r"(t) : "r"(a), "r"(b), "r"(ff_inverse)); |
38 return r; | 40 return r; |
39 } | 41 } |
40 #else | 42 |
43 #else /* HAVE_ARMV6 */ | |
44 | |
45 #define FASTDIV FASTDIV | |
41 static inline av_const int FASTDIV(int a, int b) | 46 static inline av_const int FASTDIV(int a, int b) |
42 { | 47 { |
43 int r, t; | 48 int r, t; |
44 __asm__ volatile("umull %1, %0, %2, %3" | 49 __asm__ volatile("umull %1, %0, %2, %3" |
45 : "=&r"(r), "=&r"(t) : "r"(a), "r"(ff_inverse[b])); | 50 : "=&r"(r), "=&r"(t) : "r"(a), "r"(ff_inverse[b])); |
46 return r; | 51 return r; |
47 } | 52 } |
48 #endif | |
49 | 53 |
50 #define FASTDIV FASTDIV | 54 #endif /* HAVE_ARMV6 */ |
51 | 55 |
52 #endif /* HAVE_INLINE_ASM */ | 56 #endif /* HAVE_INLINE_ASM */ |
53 | 57 |
54 #endif /* AVUTIL_ARM_INTMATH_H */ | 58 #endif /* AVUTIL_ARM_INTMATH_H */ |