diff options
author | Craig Topper <craig.topper@intel.com> | 2017-11-02 03:32:49 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-11-02 03:32:49 +0000 |
commit | 094d7914ae044b957335be075616a8c77e63a15e (patch) | |
tree | 9695d8b02cd25af5dbcf02238c73fbf474bd2f01 /llvm/lib | |
parent | 23502721870be84917fb97e4c9b8ae0755bd220e (diff) | |
download | bcm5719-llvm-094d7914ae044b957335be075616a8c77e63a15e.tar.gz bcm5719-llvm-094d7914ae044b957335be075616a8c77e63a15e.zip |
[X86] Simplify the detection of pentium-mmx in Host.cpp.
Rather than looking at model numbers just check for the mmx feature flag. While there promote INTEL_PENTIUM_MMX to a CPU type instead of a subtype so that we don't have weird type with only one subtype.
llvm-svn: 317184
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Support/Host.cpp | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp index b1d5b44ebd0..e3daadd5045 100644 --- a/llvm/lib/Support/Host.cpp +++ b/llvm/lib/Support/Host.cpp @@ -344,6 +344,7 @@ enum ProcessorTypes { INTEL_i386, INTEL_i486, INTEL_PENTIUM, + INTEL_PENTIUM_MMX, INTEL_PENTIUM_PRO, INTEL_PENTIUM_II, INTEL_PENTIUM_III, @@ -378,7 +379,6 @@ enum ProcessorSubtypes { INTEL_COREI7_SKYLAKE, INTEL_COREI7_SKYLAKE_AVX512, // Entries below this are not in libgcc/compiler-rt. - INTEL_PENTIUM_MMX, INTEL_CORE2_65, INTEL_CORE2_45, AMDPENTIUM_K6, @@ -603,26 +603,11 @@ getIntelProcessorTypeAndSubtype(unsigned Family, unsigned Model, } break; case 5: - switch (Model) { - case 1: // Pentium OverDrive processor for Pentium processor (60, 66), - // Pentium processors (60, 66) - case 2: // Pentium OverDrive processor for Pentium processor (75, 90, - // 100, 120, 133), Pentium processors (75, 90, 100, 120, 133, - // 150, 166, 200) - case 3: // Pentium OverDrive processors for Intel486 processor-based - // systems - *Type = INTEL_PENTIUM; - break; - case 4: // Pentium OverDrive processor with MMX technology for Pentium - // processor (75, 90, 100, 120, 133), Pentium processor with - // MMX technology (166, 200) - *Type = INTEL_PENTIUM; - *Subtype = INTEL_PENTIUM_MMX; - break; - default: - *Type = INTEL_PENTIUM; + if (Features & (1 << FEATURE_MMX)) { + *Type = INTEL_PENTIUM_MMX; break; } + *Type = INTEL_PENTIUM; break; case 6: switch (Model) { @@ -1118,9 +1103,9 @@ StringRef sys::getHostCPUName() { case INTEL_i486: return "i486"; case INTEL_PENTIUM: - if (Subtype == INTEL_PENTIUM_MMX) - return "pentium-mmx"; return "pentium"; + case INTEL_PENTIUM_MMX: + return "pentium-mmx"; case INTEL_PENTIUM_PRO: return "pentiumpro"; case INTEL_PENTIUM_II: |