Mercurial > libavcodec.hg
changeset 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 |
files | mpegaudiodec.c |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mpegaudiodec.c Tue Aug 22 11:51:09 2006 +0000 +++ b/mpegaudiodec.c Tue Aug 22 12:07:02 2006 +0000 @@ -44,7 +44,13 @@ #define FRAC_ONE (1 << FRAC_BITS) #ifdef ARCH_X86 -# define MULL(a,b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS) +# define MULL(ra, rb) \ + ({ int rt, dummy; asm (\ + "imull %3 \n\t"\ + "shrdl %4, %%edx, %%eax \n\t"\ + : "=a"(rt), "=d"(dummy)\ + : "a" (ra), "rm" (rb), "i"(FRAC_BITS));\ + rt; }) # define MUL64(ra, rb) \ ({ int64_t rt; asm ("imull %2\n\t" : "=A"(rt) : "a" (ra), "g" (rb)); rt; }) # define MULH(ra, rb) \