diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-08-06 13:51:00 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-27 03:50:50 +0200 |
commit | b0b5ade8d3eed6db320bf775d848d58fcb072d6f (patch) | |
tree | efbe66f5326819eb17a78b0203f5dda9ea76f4d6 /src/corelib/tools/qsimd.cpp | |
parent | 788bde071afcea71191c62032b48bde71e20d419 (diff) |
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>
Diffstat (limited to 'src/corelib/tools/qsimd.cpp')
-rw-r--r-- | src/corelib/tools/qsimd.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index c81df7a6f2..00c523afe6 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -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" |