[MPlayer-dev-eng] cpuid vs 386 vs 486
Michael Niedermayer
michaelni at gmx.at
Tue Feb 5 22:55:09 CET 2002
Hi
On Tuesday 05 February 2002 22:28, Arpi wrote:
> Hi,
>
> it probably uses BSWAP. It's specific to 486+ cpus, and common in these
> codecs.
bswap.h:
---------------------------------
inline static unsigned int ByteSwap32(unsigned int x)
{
#if __CPU__ > 386
__asm("bswap %0":
"=r" (x) :
#else
__asm("xchgb %b0,%h0\n"
" rorl $16,%0\n"
" xchgb %b0,%h0":
"=q" (x) :
#endif
"0" (x));
return x;
}
----------------------------------
so it wont work if its compiled on 486+ and executed on 386
runtime cpudetect detect is imho not worth it here, and would have a serious
impact on performance as this is used in the bitstream reader which is called
alot
[...]
Michael
More information about the MPlayer-dev-eng
mailing list