diff options
author | Måns Rullgård <mans@mansr.com> | 2009-05-04 17:31:15 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2009-05-04 17:31:15 +0000 |
commit | 3737dd1cd31f72afa905c5efed7dc1d605813229 (patch) | |
tree | e41995699b92c1694683280135fa589921ab5bcb | |
parent | e2fa5cf4c96391e82848e078e6a1e40f41c2ea2d (diff) | |
download | ffmpeg-3737dd1cd31f72afa905c5efed7dc1d605813229.tar.gz |
PPC: implement MULH() in assembler
Left to its own devices, gcc calculates the full 64-bit product only to
discard the low 32 bits. This forces it to do the right thing.
20% faster MP3 decoding on G4.
Originally committed as revision 18737 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/ppc/mathops.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/ppc/mathops.h b/libavcodec/ppc/mathops.h index adf04cb1da..2b5a5c4eb0 100644 --- a/libavcodec/ppc/mathops.h +++ b/libavcodec/ppc/mathops.h @@ -37,4 +37,11 @@ __rt; }) #endif +#define MULH MULH +static inline av_const int MULH(int a, int b){ + int r; + __asm__ ("mulhw %0, %1, %2" : "=r"(r) : "r"(a), "r"(b)); + return r; +} + #endif /* AVCODEC_PPC_MATHOPS_H */ |