[vlc-devel] [PATCH] Detect AVX-enabled processors

Rémi Denis-Courmont remi at remlab.net
Fri Dec 9 17:18:58 CET 2011

Le vendredi 9 décembre 2011 18:08:02 Jean-Baptiste Kempf, vous avez écrit :
> On Fri, Dec 09, 2011 at 06:02:07PM +0200, Rémi Denis-Courmont wrote :
> > Side topic... I think those fork/SIGILL tests are not really good idea.
> > fork() can (and seems to) cause problems with libraries using
> > pthread_atfork().
> > 
> > Besides, I don't really understand why we have those tests. A number of
> > libraries just check for CPUID, including some libraries used by VLC. I
> > wonder how this test can fail? Can the OS block those instructions, or
> > can it block the MMX and/or SSE registers?
> From what I understand, we need to have the OS support to get access to
> the YMM registers.

That actualy makes sense. If the OS does not know the registers, it cannot 
save and restore them during context switch. But then we only need to test 
MMX, SSE1 and AVX, not _everything_.

Also then:
- there is a problem on Windows (no tests at all),
- parsing /proc/cpuinfo is safer than fork+SIGILL.

Rémi Denis-Courmont

More information about the vlc-devel mailing list