Don't try to detect the CPUID instruction if we're compiling for Pentium

If we're compiling for Pentium or better CPUs, then we know that the
CPUID instruction is present (I think it was introduced in late 486s,
actually). So don't try to detect it. Simply assume it's there and then
execute it.

This means that if you compile Qt for Pentium (or higher) and run it on
an i386 or i486, you'll get a SIGILL (or whatever your OS produces for
an #UD processor exception). If the CPU detection code even got run --
SIGILL might happen for any other instructions found along the way.

Change-Id: Iacd4a94a51363a609a61fc2bfd2e218fb290272d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Thiago Macieira 2013-08-06 13:51:00 -07:00 committed by The Qt Project
parent 788bde071a
commit b0b5ade8d3

View File

@ -159,7 +159,7 @@ static int maxBasicCpuidSupported()
#if defined(Q_CC_GNU)
qintptr tmp1;
# ifdef Q_PROCESSOR_X86_32
# if Q_PROCESSOR_X86 < 5
// check if the CPUID instruction is supported
long cpuid_supported;
asm ("pushf\n"