r207848 - Add support for -march=bdver4.

Benjamin Kramer benny.kra at googlemail.com
Fri May 2 08:47:51 PDT 2014


Author: d0k
Date: Fri May  2 10:47:51 2014
New Revision: 207848

URL: http://llvm.org/viewvc/llvm-project?rev=207848&view=rev
Log:
Add support for -march=bdver4.

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=207848&r1=207847&r2=207848&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Fri May  2 10:47:51 2014
@@ -1768,6 +1768,7 @@ class X86TargetInfo : public TargetInfo
     CK_BDVER1,
     CK_BDVER2,
     CK_BDVER3,
+    CK_BDVER4,
     //@}
 
     /// This specification is deprecated and will be removed in the future.
@@ -1911,6 +1912,7 @@ public:
       .Case("bdver1", CK_BDVER1)
       .Case("bdver2", CK_BDVER2)
       .Case("bdver3", CK_BDVER3)
+      .Case("bdver4", CK_BDVER4)
       .Case("x86-64", CK_x86_64)
       .Case("geode", CK_Geode)
       .Default(CK_Generic);
@@ -1980,6 +1982,7 @@ public:
     case CK_BDVER1:
     case CK_BDVER2:
     case CK_BDVER3:
+    case CK_BDVER4:
     case CK_x86_64:
       return true;
     }
@@ -2182,6 +2185,10 @@ void X86TargetInfo::getDefaultFeatures(l
     setFeatureEnabledImpl(Features, "prfchw", true);
     setFeatureEnabledImpl(Features, "cx16", true);
     break;
+  case CK_BDVER4:
+    setFeatureEnabledImpl(Features, "avx2", true);
+    setFeatureEnabledImpl(Features, "bmi2", true);
+    // FALLTHROUGH
   case CK_BDVER2:
   case CK_BDVER3:
     setFeatureEnabledImpl(Features, "xop", true);
@@ -2685,6 +2692,9 @@ void X86TargetInfo::getTargetDefines(con
   case CK_BDVER3:
     defineCPUMacros(Builder, "bdver3");
     break;
+  case CK_BDVER4:
+    defineCPUMacros(Builder, "bdver4");
+    break;
   case CK_Geode:
     defineCPUMacros(Builder, "geode");
     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=207848&r1=207847&r2=207848&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/predefined-arch-macros.c (original)
+++ cfe/trunk/test/Preprocessor/predefined-arch-macros.c Fri May  2 10:47:51 2014
@@ -1437,6 +1437,76 @@
 // CHECK_BDVER3_M64: #define __tune_bdver3__ 1
 // CHECK_BDVER3_M64: #define __x86_64 1
 // CHECK_BDVER3_M64: #define __x86_64__ 1
+// RUN: %clang -march=bdver4 -m32 -E -dM %s -o - 2>&1 \
+// RUN:     -target i386-unknown-linux \
+// RUN:   | FileCheck %s -check-prefix=CHECK_BDVER4_M32
+// CHECK_BDVER4_M32-NOT: #define __3dNOW_A__ 1
+// CHECK_BDVER4_M32-NOT: #define __3dNOW__ 1
+// CHECK_BDVER4_M32: #define __AES__ 1
+// CHECK_BDVER4_M32: #define __AVX2__ 1
+// CHECK_BDVER4_M32: #define __AVX__ 1
+// CHECK_BDVER4_M32: #define __BMI2__ 1
+// CHECK_BDVER4_M32: #define __BMI__ 1
+// CHECK_BDVER4_M32: #define __F16C__ 1
+// CHECK_BDVER4_M32: #define __FMA4__ 1
+// CHECK_BDVER4_M32: #define __FMA__ 1
+// CHECK_BDVER4_M32: #define __LZCNT__ 1
+// CHECK_BDVER4_M32: #define __MMX__ 1
+// CHECK_BDVER4_M32: #define __PCLMUL__ 1
+// CHECK_BDVER4_M32: #define __POPCNT__ 1
+// CHECK_BDVER4_M32: #define __PRFCHW__ 1
+// CHECK_BDVER4_M32: #define __SSE2_MATH__ 1
+// CHECK_BDVER4_M32: #define __SSE2__ 1
+// CHECK_BDVER4_M32: #define __SSE3__ 1
+// CHECK_BDVER4_M32: #define __SSE4A__ 1
+// CHECK_BDVER4_M32: #define __SSE4_1__ 1
+// CHECK_BDVER4_M32: #define __SSE4_2__ 1
+// CHECK_BDVER4_M32: #define __SSE_MATH__ 1
+// CHECK_BDVER4_M32: #define __SSE__ 1
+// CHECK_BDVER4_M32: #define __SSSE3__ 1
+// CHECK_BDVER4_M32: #define __TBM__ 1
+// CHECK_BDVER4_M32: #define __XOP__ 1
+// CHECK_BDVER4_M32: #define __bdver4 1
+// CHECK_BDVER4_M32: #define __bdver4__ 1
+// CHECK_BDVER4_M32: #define __i386 1
+// CHECK_BDVER4_M32: #define __i386__ 1
+// CHECK_BDVER4_M32: #define __tune_bdver4__ 1
+// RUN: %clang -march=bdver4 -m64 -E -dM %s -o - 2>&1 \
+// RUN:     -target i386-unknown-linux \
+// RUN:   | FileCheck %s -check-prefix=CHECK_BDVER4_M64
+// CHECK_BDVER4_M64-NOT: #define __3dNOW_A__ 1
+// CHECK_BDVER4_M64-NOT: #define __3dNOW__ 1
+// CHECK_BDVER4_M64: #define __AES__ 1
+// CHECK_BDVER4_M64: #define __AVX2__ 1
+// CHECK_BDVER4_M64: #define __AVX__ 1
+// CHECK_BDVER4_M64: #define __BMI2__ 1
+// CHECK_BDVER4_M64: #define __BMI__ 1
+// CHECK_BDVER4_M64: #define __F16C__ 1
+// CHECK_BDVER4_M64: #define __FMA4__ 1
+// CHECK_BDVER4_M64: #define __FMA__ 1
+// CHECK_BDVER4_M64: #define __LZCNT__ 1
+// CHECK_BDVER4_M64: #define __MMX__ 1
+// CHECK_BDVER4_M64: #define __PCLMUL__ 1
+// CHECK_BDVER4_M64: #define __POPCNT__ 1
+// CHECK_BDVER4_M64: #define __PRFCHW__ 1
+// CHECK_BDVER4_M64: #define __SSE2_MATH__ 1
+// CHECK_BDVER4_M64: #define __SSE2__ 1
+// CHECK_BDVER4_M64: #define __SSE3__ 1
+// CHECK_BDVER4_M64: #define __SSE4A__ 1
+// CHECK_BDVER4_M64: #define __SSE4_1__ 1
+// CHECK_BDVER4_M64: #define __SSE4_2__ 1
+// CHECK_BDVER4_M64: #define __SSE_MATH__ 1
+// CHECK_BDVER4_M64: #define __SSE__ 1
+// CHECK_BDVER4_M64: #define __SSSE3__ 1
+// CHECK_BDVER4_M64: #define __TBM__ 1
+// CHECK_BDVER4_M64: #define __XOP__ 1
+// CHECK_BDVER4_M64: #define __amd64 1
+// CHECK_BDVER4_M64: #define __amd64__ 1
+// CHECK_BDVER4_M64: #define __bdver4 1
+// CHECK_BDVER4_M64: #define __bdver4__ 1
+// CHECK_BDVER4_M64: #define __tune_bdver4__ 1
+// CHECK_BDVER4_M64: #define __x86_64 1
+// CHECK_BDVER4_M64: #define __x86_64__ 1
 //
 // End X86/GCC/Linux tests ------------------
 





More information about the cfe-commits mailing list