comparison mpegaudiodec.c @ 3605:6702a154df1f libavcodec

MUL* for ARM code based on a patch by Siarhei Siamashka untested
author michael
date Tue, 22 Aug 2006 13:25:09 +0000
parents dad0296d4522
children 997036dffa26
comparison
equal deleted inserted replaced
3604:dad0296d4522 3605:6702a154df1f
53 rt; }) 53 rt; })
54 # define MUL64(ra, rb) \ 54 # define MUL64(ra, rb) \
55 ({ int64_t rt; asm ("imull %2\n\t" : "=A"(rt) : "a" (ra), "g" (rb)); rt; }) 55 ({ int64_t rt; asm ("imull %2\n\t" : "=A"(rt) : "a" (ra), "g" (rb)); rt; })
56 # define MULH(ra, rb) \ 56 # define MULH(ra, rb) \
57 ({ int rt, dummy; asm ("imull %3\n\t" : "=d"(rt), "=a"(dummy): "a" (ra), "rm" (rb)); rt; }) 57 ({ int rt, dummy; asm ("imull %3\n\t" : "=d"(rt), "=a"(dummy): "a" (ra), "rm" (rb)); rt; })
58 #elif defined(ARCH_ARMV4L)
59 # define MULL(a, b) \
60 ({ int lo, hi;\
61 asm("smull %0, %1, %2, %3 \n\t"\
62 "mov %0, %0, lsr #%4\n\t"\
63 "add %1, %0, %1, lsl #%5\n\t"\
64 : "=r"(lo), "=r"(hi)\
65 : "r"(b), "r"(a), "i"(FRAC_BITS), "i"(32-FRAC_BITS));\
66 hi; })
67 # define MUL64(a,b) ((int64_t)(a) * (int64_t)(b))
68 # define MULH(a, b) ({ int lo, hi; asm ("smull %0, %1, %2, %3" : "=r"(lo), "=r"(hi) : "r"(b),"r"(a)); hi; })
58 #else 69 #else
59 # define MULL(a,b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS) 70 # define MULL(a,b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS)
60 # define MUL64(a,b) ((int64_t)(a) * (int64_t)(b)) 71 # define MUL64(a,b) ((int64_t)(a) * (int64_t)(b))
61 //#define MULH(a,b) (((int64_t)(a) * (int64_t)(b))>>32) //gcc 3.4 creates an incredibly bloated mess out of this 72 //#define MULH(a,b) (((int64_t)(a) * (int64_t)(b))>>32) //gcc 3.4 creates an incredibly bloated mess out of this
62 static always_inline int MULH(int a, int b){ 73 static always_inline int MULH(int a, int b){