Hallo

> Oh yeah, this isn't on Linux.  OSX probably has some kind of API for
> checking if sse2 is available.  Using CPUID isn't enough, because sse
> requires OS support that might not be there.  I.e., the cpu supports
> sse2 but you're not actually able to use it.  Probably not much of issue
> on OSX.
>
> Easy fix would just be the change the sse detection asm to save and
> restore ebx.
>
> __asm__ volatile("pushl %%ebx ; cpuid ; popl %%ebx" : "=d"(d) : "a"(1) :
> "ecx");
>
> or better
>
> uint32_t tmp;
> __asm__ volatile("movl %%ebx, %1; cpuid; movl %1, %%ebx" : "=d"(d),
> "=&g"(tmp) : "a"(1) : "ecx");
>
> The latter is safer in general, as you can't use push or pop around any
> asm code that has a parameter with a constraint that allows memory
> references.  The memory reference might be relative to esp, in which
> case the push/pop would move it.  Or it might not be relative to esp, in
> which case the push/pop doesn't move it.  So there's no way to adjust
> for it.
I tested your better version. And it compiles here on my linux and Intel 
osx box. I did also a quick test with the new version on the linux box. 
And it works well.

So I would appreciate a feedback if it works on a mac.

auf hoffentlich bald,

Berni the Chaos of Woodquarter

Email: shadowl...@utanet.at
www: http://www.lysator.liu.se/~gz/bernhard

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to