comparison internal.h @ 583:9277793841bb libavutil

ARM: faster ARMv6 FASTDIV()
author mru
date Sat, 25 Oct 2008 18:54:23 +0000
parents b20a4eb68876
children b27f233a4b3c
comparison
equal deleted inserted replaced
582:57da90f7c680 583:9277793841bb
138 ret;\ 138 ret;\
139 }) 139 })
140 #elif defined(HAVE_ARMV6) 140 #elif defined(HAVE_ARMV6)
141 static inline av_const int FASTDIV(int a, int b) 141 static inline av_const int FASTDIV(int a, int b)
142 { 142 {
143 int r; 143 int r, t;
144 __asm__ volatile("cmp %2, #0 \n\t" 144 __asm__ volatile("cmp %3, #2 \n\t"
145 "smmul %0, %1, %2 \n\t" 145 "ldr %1, [%4, %3, lsl #2] \n\t"
146 "rsblt %0, %0, #0 \n\t" 146 "lsrle %0, %2, #1 \n\t"
147 : "=r"(r) : "r"(a), "r"(ff_inverse[b])); 147 "smmulgt %0, %1, %2 \n\t"
148 : "=&r"(r), "=&r"(t) : "r"(a), "r"(b), "r"(ff_inverse));
148 return r; 149 return r;
149 } 150 }
150 #elif defined(ARCH_ARMV4L) 151 #elif defined(ARCH_ARMV4L)
151 # define FASTDIV(a,b) \ 152 # define FASTDIV(a,b) \
152 ({\ 153 ({\