From b0b5ade8d3eed6db320bf775d848d58fcb072d6f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 6 Aug 2013 13:51:00 -0700 Subject: 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 Reviewed-by: Thiago Macieira --- src/corelib/tools/qsimd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') 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" -- cgit v1.2.3