r181006 - Add support for -march=btver2.
Benjamin Kramer
benny.kra at googlemail.com
Fri May 3 03:47:15 PDT 2013
Author: d0k
Date: Fri May 3 05:47:15 2013
New Revision: 181006
URL: http://llvm.org/viewvc/llvm-project?rev=181006&view=rev
Log:
Add support for -march=btver2.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/Preprocessor/predefined-arch-macros.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=181006&r1=181005&r2=181006&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Fri May 3 05:47:15 2013
@@ -1835,6 +1835,7 @@ class X86TargetInfo : public TargetInfo
/// Bobcat architecture processors.
//@{
CK_BTVER1,
+ CK_BTVER2,
//@}
/// \name Bulldozer
@@ -1959,6 +1960,7 @@ public:
.Case("opteron-sse3", CK_OpteronSSE3)
.Case("amdfam10", CK_AMDFAM10)
.Case("btver1", CK_BTVER1)
+ .Case("btver2", CK_BTVER2)
.Case("bdver1", CK_BDVER1)
.Case("bdver2", CK_BDVER2)
.Case("x86-64", CK_x86_64)
@@ -2024,6 +2026,7 @@ public:
case CK_OpteronSSE3:
case CK_AMDFAM10:
case CK_BTVER1:
+ case CK_BTVER2:
case CK_BDVER1:
case CK_BDVER2:
case CK_x86_64:
@@ -2193,6 +2196,15 @@ void X86TargetInfo::getDefaultFeatures(l
setFeatureEnabled(Features, "lzcnt", true);
setFeatureEnabled(Features, "popcnt", true);
break;
+ case CK_BTVER2:
+ setFeatureEnabled(Features, "avx", true);
+ setFeatureEnabled(Features, "sse4a", true);
+ setFeatureEnabled(Features, "lzcnt", true);
+ setFeatureEnabled(Features, "aes", true);
+ setFeatureEnabled(Features, "pclmul", true);
+ setFeatureEnabled(Features, "bmi", true);
+ setFeatureEnabled(Features, "f16c", true);
+ break;
case CK_BDVER1:
setFeatureEnabled(Features, "xop", true);
setFeatureEnabled(Features, "lzcnt", true);
@@ -2611,6 +2623,9 @@ void X86TargetInfo::getTargetDefines(con
case CK_BTVER1:
defineCPUMacros(Builder, "btver1");
break;
+ case CK_BTVER2:
+ defineCPUMacros(Builder, "btver2");
+ break;
case CK_BDVER1:
defineCPUMacros(Builder, "bdver1");
break;
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=181006&r1=181005&r2=181006&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/predefined-arch-macros.c (original)
+++ cfe/trunk/test/Preprocessor/predefined-arch-macros.c Fri May 3 05:47:15 2013
@@ -1094,6 +1094,52 @@
// CHECK_BTVER1_M64: #define __tune_btver1__ 1
// CHECK_BTVER1_M64: #define __x86_64 1
// CHECK_BTVER1_M64: #define __x86_64__ 1
+// RUN: %clang -march=btver2 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
+// RUN: | FileCheck %s -check-prefix=CHECK_BTVER2_M32
+// CHECK_BTVER2_M32-NOT: #define __3dNOW_A__ 1
+// CHECK_BTVER2_M32-NOT: #define __3dNOW__ 1
+// CHECK_BTVER2_M32: #define __AES__ 1
+// CHECK_BTVER2_M32: #define __AVX__ 1
+// CHECK_BTVER2_M32: #define __LZCNT__ 1
+// CHECK_BTVER2_M32: #define __MMX__ 1
+// CHECK_BTVER2_M32: #define __POPCNT__ 1
+// CHECK_BTVER2_M32: #define __SSE2_MATH__ 1
+// CHECK_BTVER2_M32: #define __SSE2__ 1
+// CHECK_BTVER2_M32: #define __SSE3__ 1
+// CHECK_BTVER2_M32: #define __SSE4A__ 1
+// CHECK_BTVER2_M32: #define __SSE_MATH__ 1
+// CHECK_BTVER2_M32: #define __SSE__ 1
+// CHECK_BTVER2_M32: #define __SSSE3__ 1
+// CHECK_BTVER2_M32: #define __btver2 1
+// CHECK_BTVER2_M32: #define __btver2__ 1
+// CHECK_BTVER2_M32: #define __i386 1
+// CHECK_BTVER2_M32: #define __i386__ 1
+// CHECK_BTVER2_M32: #define __tune_btver2__ 1
+// RUN: %clang -march=btver2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
+// RUN: | FileCheck %s -check-prefix=CHECK_BTVER2_M64
+// CHECK_BTVER2_M64-NOT: #define __3dNOW_A__ 1
+// CHECK_BTVER2_M64-NOT: #define __3dNOW__ 1
+// CHECK_BTVER2_M64: #define __AES__ 1
+// CHECK_BTVER2_M64: #define __AVX__ 1
+// CHECK_BTVER2_M64: #define __LZCNT__ 1
+// CHECK_BTVER2_M64: #define __MMX__ 1
+// CHECK_BTVER2_M64: #define __POPCNT__ 1
+// CHECK_BTVER2_M64: #define __SSE2_MATH__ 1
+// CHECK_BTVER2_M64: #define __SSE2__ 1
+// CHECK_BTVER2_M64: #define __SSE3__ 1
+// CHECK_BTVER2_M64: #define __SSE4A__ 1
+// CHECK_BTVER2_M64: #define __SSE_MATH__ 1
+// CHECK_BTVER2_M64: #define __SSE__ 1
+// CHECK_BTVER2_M64: #define __SSSE3__ 1
+// CHECK_BTVER2_M64: #define __amd64 1
+// CHECK_BTVER2_M64: #define __amd64__ 1
+// CHECK_BTVER2_M64: #define __btver2 1
+// CHECK_BTVER2_M64: #define __btver2__ 1
+// CHECK_BTVER2_M64: #define __tune_btver2__ 1
+// CHECK_BTVER2_M64: #define __x86_64 1
+// CHECK_BTVER2_M64: #define __x86_64__ 1
// RUN: %clang -march=bdver1 -m32 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_BDVER1_M32
More information about the cfe-commits
mailing list