Mercurial > libavcodec.hg
comparison mpegaudiodec.c @ 3604:dad0296d4522 libavcodec
replace MULL with asm too, no significnat speedup but its probably better to not take any chances, some versions of gcc will almost certainly mess it up too if they can
author | michael |
---|---|
date | Tue, 22 Aug 2006 12:07:02 +0000 |
parents | 42b6cefc6c1a |
children | 6702a154df1f |
comparison
equal
deleted
inserted
replaced
3603:42b6cefc6c1a | 3604:dad0296d4522 |
---|---|
42 #include "mpegaudio.h" | 42 #include "mpegaudio.h" |
43 | 43 |
44 #define FRAC_ONE (1 << FRAC_BITS) | 44 #define FRAC_ONE (1 << FRAC_BITS) |
45 | 45 |
46 #ifdef ARCH_X86 | 46 #ifdef ARCH_X86 |
47 # define MULL(a,b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS) | 47 # define MULL(ra, rb) \ |
48 ({ int rt, dummy; asm (\ | |
49 "imull %3 \n\t"\ | |
50 "shrdl %4, %%edx, %%eax \n\t"\ | |
51 : "=a"(rt), "=d"(dummy)\ | |
52 : "a" (ra), "rm" (rb), "i"(FRAC_BITS));\ | |
53 rt; }) | |
48 # define MUL64(ra, rb) \ | 54 # define MUL64(ra, rb) \ |
49 ({ 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; }) |
50 # define MULH(ra, rb) \ | 56 # define MULH(ra, rb) \ |
51 ({ 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; }) |
52 #else | 58 #else |