[MPlayer-dev-eng] [PATCH] SSE support for cygwin/mingw

Arpi arpi at thot.banki.hu
Sat Jul 5 15:11:37 CEST 2003


Hi,

> I had a quick look at cpudetect.c and found out why SSE isn't detected on
> cygwin.
> The attached patch would fix it, but I'm not sure if it is save to apply.
> For linux/bsd
> there is a function (check_os_katmai_support) that checks for sse support in
> the os.
> Does anyone know if this might be needed for windows, too?

yes, but probably different way.

at least win95 and mayeb even win98 doesnt support sse properly.
(sse code works, but the OS doesnt save sse registers at task switches,
so running multiple sse apps will trash eachothers data).

probably you should use GetSystemInfo() under windows, according to
loader/win32.c it can return sse availability for win32 apps:

        if (gCpuCaps.hasMMX)
            PF[PF_MMX_INSTRUCTIONS_AVAILABLE] = TRUE;
        if (gCpuCaps.hasSSE)
            PF[PF_XMMI_INSTRUCTIONS_AVAILABLE] = TRUE;
        if (gCpuCaps.has3DNow)
            PF[PF_AMD3D_INSTRUCTIONS_AVAILABLE] = TRUE;

(this is from our GetSystemInfo() emulation for w32 dlls, you should do the
opposite, ie. emulate getcpuflags based on this :))

the other way i saw in win32 dlls was reading the CR1 register, it has a bit
meaning 'OS supports SSE' but it's win9x only, doesnt work on nt/2k/xp.


A'rpi / Astral & ESP-team

--
Developer of MPlayer G2, the Movie Framework for all - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list