Showing the changes to libavcodec/arm (1 of 14 files). Show all
Unified · Split
| @@ -36,6 +36,30 @@ static inline av_const int MULH(int a, int b) · 35 unmodified lines | |||
| 36 | __asm__ ("smmul %0, %1, %2" : "=r"(r) : "r"(a), "r"(b)); | 36 | __asm__ ("smmul %0, %1, %2" : "=r"(r) : "r"(a), "r"(b)); |
| 37 | return r; | 37 | return r; |
| 38 | } | 38 | } |
| 39 | |||
| 40 | #define FASTDIV FASTDIV | ||
| 41 | static av_always_inline av_const int FASTDIV(int a, int b) | ||
| 42 | { | ||
| 43 | int r; | ||
| 44 | __asm__ ("cmp %2, #2 \n\t" | ||
| 45 | "ldr %0, [%3, %2, lsl #2] \n\t" | ||
| 46 | "ite le \n\t" | ||
| 47 | "lsrle %0, %1, #1 \n\t" | ||
| 48 | "smmulgt %0, %0, %1 \n\t" | ||
| 49 | : "=&r"(r) : "r"(a), "r"(b), "r"(ff_inverse) : "cc"); | ||
| 50 | return r; | ||
| 51 | } | ||
| 52 | |||
| 53 | #else /* HAVE_ARMV6 */ | ||
| 54 | |||
| 55 | #define FASTDIV FASTDIV | ||
| 56 | static av_always_inline av_const int FASTDIV(int a, int b) | ||
| 57 | { | ||
| 58 | int r, t; | ||
| 59 | __asm__ ("umull %1, %0, %2, %3" | ||
| 60 | : "=&r"(r), "=&r"(t) : "r"(a), "r"(ff_inverse[b])); | ||
| 61 | return r; | ||
| 62 | } | ||
| 39 | #endif | 63 | #endif |
| 40 | 64 | ||
| 41 | #define MLS64(d, a, b) MAC64(d, -(a), b) | 65 | #define MLS64(d, a, b) MAC64(d, -(a), b) |