diff options
author | Måns Rullgård <mans@mansr.com> | 2008-10-25 18:54:23 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2008-10-25 18:54:23 +0000 |
commit | b98f10c08af4f3c438914c200d8845731057dd2b (patch) | |
tree | 2b0e681e5ed8dce3d5311e93de262428e522ff9b /libavutil/internal.h | |
parent | 590bd200dd55b35b23007469cb3037dee98f3211 (diff) | |
download | ffmpeg-b98f10c08af4f3c438914c200d8845731057dd2b.tar.gz |
ARM: faster ARMv6 FASTDIV()
Originally committed as revision 15712 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/internal.h')
-rw-r--r-- | libavutil/internal.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libavutil/internal.h b/libavutil/internal.h index aaecab77a5..5ade1affa7 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -140,11 +140,12 @@ extern const uint32_t ff_inverse[256]; #elif defined(HAVE_ARMV6) static inline av_const int FASTDIV(int a, int b) { - int r; - __asm__ volatile("cmp %2, #0 \n\t" - "smmul %0, %1, %2 \n\t" - "rsblt %0, %0, #0 \n\t" - : "=r"(r) : "r"(a), "r"(ff_inverse[b])); + int r, t; + __asm__ volatile("cmp %3, #2 \n\t" + "ldr %1, [%4, %3, lsl #2] \n\t" + "lsrle %0, %2, #1 \n\t" + "smmulgt %0, %1, %2 \n\t" + : "=&r"(r), "=&r"(t) : "r"(a), "r"(b), "r"(ff_inverse)); return r; } #elif defined(ARCH_ARMV4L) |