From: Craig Topper Date: Thu, 26 Oct 2017 23:06:19 +0000 (+0000) Subject: [X86] Make -march=i686 an alias of -march=pentiumpro X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b4d273c998f39c228f0940515b9b2924451eadb;p=clang [X86] Make -march=i686 an alias of -march=pentiumpro I think the only reason they are different is because we don't set tune_i686 for -march=i686 to match GCC. But GCC 4.9.0 seems to have changed this behavior and they do set it now. So I think they can aliases now. Differential Revision: https://reviews.llvm.org/D39349 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316712 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets/X86.cpp b/lib/Basic/Targets/X86.cpp index d2716ac670..c1d0a84529 100644 --- a/lib/Basic/Targets/X86.cpp +++ b/lib/Basic/Targets/X86.cpp @@ -119,7 +119,6 @@ bool X86TargetInfo::initFeatureMap( case CK_i486: case CK_i586: case CK_Pentium: - case CK_i686: case CK_PentiumPro: case CK_Lakemont: break; @@ -806,15 +805,8 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts, Builder.defineMacro("__tune_pentium2__"); LLVM_FALLTHROUGH; case CK_PentiumPro: - Builder.defineMacro("__tune_i686__"); - Builder.defineMacro("__tune_pentiumpro__"); - LLVM_FALLTHROUGH; - case CK_i686: - Builder.defineMacro("__i686"); - Builder.defineMacro("__i686__"); - // Strangely, __tune_i686__ isn't defined by GCC when CPU == i686. - Builder.defineMacro("__pentiumpro"); - Builder.defineMacro("__pentiumpro__"); + defineCPUMacros(Builder, "i686"); + defineCPUMacros(Builder, "pentiumpro"); break; case CK_Pentium4: defineCPUMacros(Builder, "pentium4"); @@ -1542,7 +1534,6 @@ bool X86TargetInfo::checkCPUKind(CPUKind Kind) const { case CK_i586: case CK_Pentium: case CK_PentiumMMX: - case CK_i686: case CK_PentiumPro: case CK_Pentium2: case CK_Pentium3: @@ -1606,8 +1597,7 @@ X86TargetInfo::CPUKind X86TargetInfo::getCPUKind(StringRef CPU) const { .Case("i586", CK_i586) .Case("pentium", CK_Pentium) .Case("pentium-mmx", CK_PentiumMMX) - .Case("i686", CK_i686) - .Case("pentiumpro", CK_PentiumPro) + .Cases("i686", "pentiumpro", CK_PentiumPro) .Case("pentium2", CK_Pentium2) .Cases("pentium3", "pentium3m", CK_Pentium3) .Case("pentium-m", CK_PentiumM) diff --git a/lib/Basic/Targets/X86.h b/lib/Basic/Targets/X86.h index 321ce65bd1..b86497f17b 100644 --- a/lib/Basic/Targets/X86.h +++ b/lib/Basic/Targets/X86.h @@ -122,7 +122,6 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public TargetInfo { /// \name i686 /// i686-generation processors, P6 / Pentium M microarchitecture based. //@{ - CK_i686, CK_PentiumPro, CK_Pentium2, CK_Pentium3, diff --git a/test/Preprocessor/predefined-arch-macros.c b/test/Preprocessor/predefined-arch-macros.c index 43dc469d3e..2f3d9e3047 100644 --- a/test/Preprocessor/predefined-arch-macros.c +++ b/test/Preprocessor/predefined-arch-macros.c @@ -156,6 +156,8 @@ // CHECK_I686_M32: #define __i686__ 1 // CHECK_I686_M32: #define __pentiumpro 1 // CHECK_I686_M32: #define __pentiumpro__ 1 +// CHECK_I686_M32: #define __tune_i686__ 1 +// CHECK_I686_M32: #define __tune_pentiumpro__ 1 // CHECK_I686_M32: #define i386 1 // RUN: not %clang -march=i686 -m64 -E -dM %s -o - 2>&1 \ // RUN: -target i386-unknown-linux \