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
This commit is contained in:
Måns Rullgård 2009-05-04 17:31:15 +00:00
parent e2fa5cf4c9
commit 3737dd1cd3
1 changed files with 7 additions and 0 deletions

View File

@ -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 */