[vlc-devel] commit: SSE3 detection (runtime) (Jean-Baptiste Kempf )

Rémi Denis-Courmont remi at remlab.net
Wed Sep 23 09:12:06 CEST 2009

----- Message d'origine -----
> Whether or not fork() is slow - it probably shouldn't matter since it should
> only be called once to initialize the CPU capabilities, but can't you use
> cpuid for this?

CPUID tells us whether the CPU supports the instruction set, not the operating system. I do not know if this is a problem anymore, as it was in the MMMXEXT vs SSE1 time.

> However, I'm not sure this line is correct:
> +# if defined (__SSE3__)
> +      i_capabilities |= CPU_CAPABILITY_SSE3;
> __SSE3__ is defined with -msse3 is passed in to gcc whether or not the
> processor supports it, therefore you should still do the same check.

__SSE3__ is predefined if -msse3 is enabled. That option tells the compiler to use SSE3, so it does imply the code can only run on SSE3-capable systems. Normally, you would only pass -msse3 to build SSE3-specific plugins, and definitely not to the autodetection code. Please refer to the GCC x86 platform documentation for further references.

> > Isn't fork() supposed to be slow on Windows?

As far as I know, fork() is slow on Cygwin, fast on Interix and unavailable on plain Win32.


More information about the vlc-devel mailing list