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

Milan Jurik milan.jurik at xylab.cz
Fri Sep 26 00:03:17 CEST 2008


Hi Reimar,

Reimar Döffinger napsal(a):
> 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.
>
>   

It took a bit of time (mainly to find working Solaris 8 x86 box) but I 
have 2 different options:

a) sigaction.patch is dirty reuse of Linux signal detection, I could 
rewrite it in something cleaner

b) uname.patch is based on uname(2) and disables SSE on Solaris < S9

I tested Solaris 8 x86 and it signals sigill for xorps, as documented by 
Sun. So I would prefer the uname.patch as simpler.

As alternative you can enable SSE support by default, of course.

Best regards,

Milan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: uname.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080926/3e952da8/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sigaction.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080926/3e952da8/attachment.asc>


More information about the MPlayer-dev-eng mailing list