Commit 0fb8f28d authored by mru's avatar mru

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.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18737 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 07987b6b
...@@ -37,4 +37,11 @@ ...@@ -37,4 +37,11 @@
__rt; }) __rt; })
#endif #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 */ #endif /* AVCODEC_PPC_MATHOPS_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment