Driver: Add support for -march=bdver3 on x86.

llvm-svn: 193985
This commit is contained in:
Benjamin Kramer 2013-11-04 10:29:51 +00:00
parent d114def3d6
commit d9a5e2a490
2 changed files with 73 additions and 0 deletions

View File

@ -1768,6 +1768,7 @@ class X86TargetInfo : public TargetInfo {
//@{ //@{
CK_BDVER1, CK_BDVER1,
CK_BDVER2, CK_BDVER2,
CK_BDVER3,
//@} //@}
/// This specification is deprecated and will be removed in the future. /// This specification is deprecated and will be removed in the future.
@ -1910,6 +1911,7 @@ public:
.Case("btver2", CK_BTVER2) .Case("btver2", CK_BTVER2)
.Case("bdver1", CK_BDVER1) .Case("bdver1", CK_BDVER1)
.Case("bdver2", CK_BDVER2) .Case("bdver2", CK_BDVER2)
.Case("bdver3", CK_BDVER3)
.Case("x86-64", CK_x86_64) .Case("x86-64", CK_x86_64)
.Case("geode", CK_Geode) .Case("geode", CK_Geode)
.Default(CK_Generic); .Default(CK_Generic);
@ -1978,6 +1980,7 @@ public:
case CK_BTVER2: case CK_BTVER2:
case CK_BDVER1: case CK_BDVER1:
case CK_BDVER2: case CK_BDVER2:
case CK_BDVER3:
case CK_x86_64: case CK_x86_64:
return true; return true;
} }
@ -2181,6 +2184,7 @@ void X86TargetInfo::getDefaultFeatures(llvm::StringMap<bool> &Features) const {
setFeatureEnabledImpl(Features, "cx16", true); setFeatureEnabledImpl(Features, "cx16", true);
break; break;
case CK_BDVER2: case CK_BDVER2:
case CK_BDVER3:
setFeatureEnabledImpl(Features, "xop", true); setFeatureEnabledImpl(Features, "xop", true);
setFeatureEnabledImpl(Features, "lzcnt", true); setFeatureEnabledImpl(Features, "lzcnt", true);
setFeatureEnabledImpl(Features, "aes", true); setFeatureEnabledImpl(Features, "aes", true);
@ -2679,6 +2683,9 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
case CK_BDVER2: case CK_BDVER2:
defineCPUMacros(Builder, "bdver2"); defineCPUMacros(Builder, "bdver2");
break; break;
case CK_BDVER3:
defineCPUMacros(Builder, "bdver3");
break;
case CK_Geode: case CK_Geode:
defineCPUMacros(Builder, "geode"); defineCPUMacros(Builder, "geode");
break; break;

View File

@ -1371,6 +1371,72 @@
// CHECK_BDVER2_M64: #define __tune_bdver2__ 1 // CHECK_BDVER2_M64: #define __tune_bdver2__ 1
// CHECK_BDVER2_M64: #define __x86_64 1 // CHECK_BDVER2_M64: #define __x86_64 1
// CHECK_BDVER2_M64: #define __x86_64__ 1 // CHECK_BDVER2_M64: #define __x86_64__ 1
// RUN: %clang -march=bdver3 -m32 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_BDVER3_M32
// CHECK_BDVER3_M32-NOT: #define __3dNOW_A__ 1
// CHECK_BDVER3_M32-NOT: #define __3dNOW__ 1
// CHECK_BDVER3_M32: #define __AES__ 1
// CHECK_BDVER3_M32: #define __AVX__ 1
// CHECK_BDVER3_M32: #define __BMI__ 1
// CHECK_BDVER3_M32: #define __F16C__ 1
// CHECK_BDVER3_M32: #define __FMA4__ 1
// CHECK_BDVER3_M32: #define __FMA__ 1
// CHECK_BDVER3_M32: #define __LZCNT__ 1
// CHECK_BDVER3_M32: #define __MMX__ 1
// CHECK_BDVER3_M32: #define __PCLMUL__ 1
// CHECK_BDVER3_M32: #define __POPCNT__ 1
// CHECK_BDVER3_M32: #define __PRFCHW__ 1
// CHECK_BDVER3_M32: #define __SSE2_MATH__ 1
// CHECK_BDVER3_M32: #define __SSE2__ 1
// CHECK_BDVER3_M32: #define __SSE3__ 1
// CHECK_BDVER3_M32: #define __SSE4A__ 1
// CHECK_BDVER3_M32: #define __SSE4_1__ 1
// CHECK_BDVER3_M32: #define __SSE4_2__ 1
// CHECK_BDVER3_M32: #define __SSE_MATH__ 1
// CHECK_BDVER3_M32: #define __SSE__ 1
// CHECK_BDVER3_M32: #define __SSSE3__ 1
// CHECK_BDVER3_M32: #define __TBM__ 1
// CHECK_BDVER3_M32: #define __XOP__ 1
// CHECK_BDVER3_M32: #define __bdver3 1
// CHECK_BDVER3_M32: #define __bdver3__ 1
// CHECK_BDVER3_M32: #define __i386 1
// CHECK_BDVER3_M32: #define __i386__ 1
// CHECK_BDVER3_M32: #define __tune_bdver3__ 1
// RUN: %clang -march=bdver3 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_BDVER3_M64
// CHECK_BDVER3_M64-NOT: #define __3dNOW_A__ 1
// CHECK_BDVER3_M64-NOT: #define __3dNOW__ 1
// CHECK_BDVER3_M64: #define __AES__ 1
// CHECK_BDVER3_M64: #define __AVX__ 1
// CHECK_BDVER3_M64: #define __BMI__ 1
// CHECK_BDVER3_M64: #define __F16C__ 1
// CHECK_BDVER3_M64: #define __FMA4__ 1
// CHECK_BDVER3_M64: #define __FMA__ 1
// CHECK_BDVER3_M64: #define __LZCNT__ 1
// CHECK_BDVER3_M64: #define __MMX__ 1
// CHECK_BDVER3_M64: #define __PCLMUL__ 1
// CHECK_BDVER3_M64: #define __POPCNT__ 1
// CHECK_BDVER3_M64: #define __PRFCHW__ 1
// CHECK_BDVER3_M64: #define __SSE2_MATH__ 1
// CHECK_BDVER3_M64: #define __SSE2__ 1
// CHECK_BDVER3_M64: #define __SSE3__ 1
// CHECK_BDVER3_M64: #define __SSE4A__ 1
// CHECK_BDVER3_M64: #define __SSE4_1__ 1
// CHECK_BDVER3_M64: #define __SSE4_2__ 1
// CHECK_BDVER3_M64: #define __SSE_MATH__ 1
// CHECK_BDVER3_M64: #define __SSE__ 1
// CHECK_BDVER3_M64: #define __SSSE3__ 1
// CHECK_BDVER3_M64: #define __TBM__ 1
// CHECK_BDVER3_M64: #define __XOP__ 1
// CHECK_BDVER3_M64: #define __amd64 1
// CHECK_BDVER3_M64: #define __amd64__ 1
// CHECK_BDVER3_M64: #define __bdver3 1
// CHECK_BDVER3_M64: #define __bdver3__ 1
// CHECK_BDVER3_M64: #define __tune_bdver3__ 1
// CHECK_BDVER3_M64: #define __x86_64 1
// CHECK_BDVER3_M64: #define __x86_64__ 1
// //
// End X86/GCC/Linux tests ------------------ // End X86/GCC/Linux tests ------------------