r316712 - [X86] Make -march=i686 an alias of -march=pentiumpro
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 26 16:06:20 PDT 2017
Author: ctopper
Date: Thu Oct 26 16:06:19 2017
New Revision: 316712
URL: http://llvm.org/viewvc/llvm-project?rev=316712&view=rev
Log:
[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
Modified:
cfe/trunk/lib/Basic/Targets/X86.cpp
cfe/trunk/lib/Basic/Targets/X86.h
cfe/trunk/test/Preprocessor/predefined-arch-macros.c
Modified: cfe/trunk/lib/Basic/Targets/X86.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/X86.cpp?rev=316712&r1=316711&r2=316712&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets/X86.cpp (original)
+++ cfe/trunk/lib/Basic/Targets/X86.cpp Thu Oct 26 16:06:19 2017
@@ -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(con
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
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::ge
.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)
Modified: cfe/trunk/lib/Basic/Targets/X86.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/X86.h?rev=316712&r1=316711&r2=316712&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets/X86.h (original)
+++ cfe/trunk/lib/Basic/Targets/X86.h Thu Oct 26 16:06:19 2017
@@ -122,7 +122,6 @@ class LLVM_LIBRARY_VISIBILITY X86TargetI
/// \name i686
/// i686-generation processors, P6 / Pentium M microarchitecture based.
//@{
- CK_i686,
CK_PentiumPro,
CK_Pentium2,
CK_Pentium3,
Modified: cfe/trunk/test/Preprocessor/predefined-arch-macros.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/predefined-arch-macros.c?rev=316712&r1=316711&r2=316712&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/predefined-arch-macros.c (original)
+++ cfe/trunk/test/Preprocessor/predefined-arch-macros.c Thu Oct 26 16:06:19 2017
@@ -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 \
More information about the cfe-commits
mailing list