[MPlayer-dev-eng] [PATCH] Solaris support for SSE(2) autodetection

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Sep 18 17:24:04 CEST 2008


On Thu, Sep 18, 2008 at 10:08:11AM +0200, Milan Jurik wrote:
> V st, 17. 09. 2008 v 23:24, Reimar Döffinger píše:
> > On Wed, Sep 17, 2008 at 10:30:49PM +0200, Milan Jurik wrote:
> > > I don't understand. The code adds possibility for autodetection of 
> > > SSE/SSE2 in runtime-cpudetection for Solaris, when it's requested (as 
> > > done for other platforms already). I believe it's purpose of runtime CPU 
> > > detection to detect CPU capabilities.
> > 
> > There is already working, perfectly portable code to detect CPU
> > capabilities. The code you are modifying is for detecting if the
> > operating system supports SSE/SSE2, after we already _know_ that the
> > CPU supports them.
> > I am not even sure there are any Solaris versions at all that do not
> > support SSE/SSE2, in which case the check would be quite pointless.
> 
> Ah, this you meant. Officially SSE/SSE2 are supported from Solaris 9 (it
> could be workarounded on S8 probably). Not sure if we can count Solaris
> 8 as relevant on multimedia desktop today. What do you prefer, automatic
> enable for Solaris or uname() version test?

If your method works under Solaris 8, too, I think your first patch is
ok - except that it is a bit much code for what it does, casting ignored
return values away is not MPlayer style (though if you ignore the return
value, you should at least initialize the ui variable).
And e.g.
gCpuCaps.hasSSE = !!(ui & AV_386_SSE)
mp_msg(MSGT_CPUDETECT,MSGL_V, gCpuCaps.hasSSE ? "yes" : "no");
saves some code.
But my question was: currently when we have no special code, we assume the OS
does not support SSE. Would it not be better to assume it does?
And a second question is: could we not use the sigaction method for more
than just Linux, I think it might work on Solaris, too.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list