Update the x86 feature-detection code, unifying x86 and x86-64
authorThiago Macieira <thiago.macieira@intel.com>
Sun, 25 Dec 2011 22:36:14 +0000 (20:36 -0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 25 Apr 2012 12:58:36 +0000 (14:58 +0200)
commitdc6d1c6c3f877ea7f3fd0fde35a5916964093d5c
tree408d00effc7c63f8d10ee91677d36861845064bb
parent01ee0985319a0f41be12c3c8ff3813a74b43835e
Update the x86 feature-detection code, unifying x86 and x86-64

Most of it is the same for both of them, so let's avoid doing
everything twice. Or more, since we may support x32 soon. For Windows,
use the intrinsics. For GCC, we'd like to use cpuid.h, but it only
exists since GCC 4.3, so we can't.

And properly detect AVX support: it's not enough to detect that the
processor supports them, we also need to check that the OS enabled
support for the 256-bit registers.

Change-Id: Ibb4872cdb774de5701b18c40f4e612330a266214
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/corelib/tools/qsimd.cpp