From d9a5c00cd432c085370536af910784d918ad3cca Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 6 Feb 2021 13:42:49 +0200 Subject: [PATCH] - cleaned x86 CPU detection of obsolete code --- src/common/utility/x86.cpp | 45 -------------------------------------- src/common/utility/x86.h | 1 - 2 files changed, 46 deletions(-) diff --git a/src/common/utility/x86.cpp b/src/common/utility/x86.cpp index 2988bbb35..92edfb057 100644 --- a/src/common/utility/x86.cpp +++ b/src/common/utility/x86.cpp @@ -81,50 +81,6 @@ void CheckCPUID(CPUInfo *cpu) cpu->DataL1LineSize = 32; // Assume a 32-byte cache line -#if !defined(_M_IX86) && !defined(__i386__) && !defined(_M_X64) && !defined(__amd64__) - return; -#else - -#if defined(_M_IX86) || defined(__i386__) - // Old 486s do not have CPUID, so we must test for its presence. - // This code is adapted from the samples in AMD's document - // entitled "AMD-K6 MMX Processor Multimedia Extensions." -#ifndef __GNUC__ - __asm - { - pushfd // save EFLAGS - pop eax // store EFLAGS in EAX - mov ecx,eax // save in ECX for later testing - xor eax,0x00200000 // toggle bit 21 - push eax // put to stack - popfd // save changed EAX to EFLAGS - pushfd // push EFLAGS to TOS - pop eax // store EFLAGS in EAX - cmp eax,ecx // see if bit 21 has changed - jne haveid // if no change, then no CPUID - } - return; -haveid: -#else - int oldfd, newfd; - - __asm__ __volatile__("\t" - "pushf\n\t" - "popl %0\n\t" - "movl %0,%1\n\t" - "xorl $0x200000,%0\n\t" - "pushl %0\n\t" - "popf\n\t" - "pushf\n\t" - "popl %0\n\t" - : "=r" (newfd), "=r" (oldfd)); - if (oldfd == newfd) - { - return; - } -#endif -#endif - // Get vendor ID __cpuid(foo, 0); cpu->dwVendorID[0] = foo[1]; @@ -198,7 +154,6 @@ haveid: cpu->FeatureFlags[3] = foo[3]; // AMD feature flags } } -#endif } FString DumpCPUInfo(const CPUInfo *cpu) diff --git a/src/common/utility/x86.h b/src/common/utility/x86.h index 7a676078e..cf82b6fdc 100644 --- a/src/common/utility/x86.h +++ b/src/common/utility/x86.h @@ -128,7 +128,6 @@ struct CPUInfo // 92 bytes extern CPUInfo CPU; -struct PalEntry; void CheckCPUID (CPUInfo *cpu); FString DumpCPUInfo (const CPUInfo *cpu);