[Mplayer-dev-eng] VP3 Codec

Nick Kurshev nickols_k at mail.ru
Sat Sep 22 07:58:11 CEST 2001


Hello, Arpi!
On Sat, 22 Sep 2001 02:15:48 +0200 (CEST), you wrote:

> Hi,
> 
> > > >
> > > > > 0x10004bd6:     mov    %cr0,%edx
> > > >
> > > > Oops.  So a Win32 DLL can mess with %cr0?  Amazing.
> > >
> > > yes. you know their slogen: win98 - everything possible
> > >
> > > btw that routine just checks some flags in cr0, and depending on their
> > > value returns eax=0 or eax=1. i think thet can be replaced by a mov eax,0/1
> > > and many nops.
> > the codec seems to use much asm code, maybe it's some sort of cpu feature 
> > detection.
> 
> yes:
> 
> ; check to see if OS supports SIMD instructions
>     mov     edx,cr0
>     bt      edx,2                           ; ensure no emulation
>     jnae    NoXMMSupport
> 
>     mov     edx,cr4
>     bt      edx,9                           ; OS support SIMD
>     jnc     NoXMMSupport
> 
> ; we support XMM instructions
>     mov     eax,1
>     jmp     Exit
> 
> NoXMMSupport:
> ;    mov     eax,0                           ; OS does not support XMM instructi
> 
> so it uses cr0 to check OS support of SSE. this is why it works for Gabucino
> (his k6 has no sse at all) and crashes for you.
> 
> 
> A'rpi / Astral & ESP-team
> 
To avoid such problems in the future - mplayer's win32 loader and win32 emulator should tell
to program that it was ran under WinNT but not under Win95. In this case many correctly
written dlls will not pass execution to Ring 0 priveleged code. 

Best regards! Nick



More information about the MPlayer-dev-eng mailing list