[cfe-commits] r168239 - in /cfe/trunk: lib/Basic/Targets.cpp test/Preprocessor/predefined-arch-macros.c

Eli Friedman eli.friedman at gmail.com
Fri Nov 16 17:43:10 PST 2012


Author: efriedma
Date: Fri Nov 16 19:43:10 2012
New Revision: 168239

URL: http://llvm.org/viewvc/llvm-project?rev=168239&view=rev
Log:
Add missing features for misc x86 CPUs to CPU feature translation.  Patch by Jung-uk Kim.


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=168239&r1=168238&r2=168239&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Fri Nov 16 19:43:10 2012
@@ -1889,6 +1889,7 @@
     setFeatureEnabled(Features, "aes", true);
     setFeatureEnabled(Features, "pclmul", true);
     setFeatureEnabled(Features, "rdrnd", true);
+    setFeatureEnabled(Features, "f16c", true);
     break;
   case CK_CoreAVX2:
     setFeatureEnabled(Features, "avx2", true);
@@ -1896,6 +1897,7 @@
     setFeatureEnabled(Features, "pclmul", true);
     setFeatureEnabled(Features, "lzcnt", true);
     setFeatureEnabled(Features, "rdrnd", true);
+    setFeatureEnabled(Features, "f16c", true);
     setFeatureEnabled(Features, "bmi", true);
     setFeatureEnabled(Features, "bmi2", true);
     setFeatureEnabled(Features, "rtm", true);
@@ -1939,17 +1941,28 @@
     setFeatureEnabled(Features, "sse3", true);
     setFeatureEnabled(Features, "sse4a", true);
     setFeatureEnabled(Features, "3dnowa", true);
+    setFeatureEnabled(Features, "lzcnt", true);
+    setFeatureEnabled(Features, "popcnt", true);
     break;
   case CK_BTVER1:
     setFeatureEnabled(Features, "ssse3", true);
     setFeatureEnabled(Features, "sse4a", true);
+    setFeatureEnabled(Features, "lzcnt", true);
+    setFeatureEnabled(Features, "popcnt", true);
     break;
   case CK_BDVER1:
+    setFeatureEnabled(Features, "xop", true);
+    setFeatureEnabled(Features, "lzcnt", true);
+    setFeatureEnabled(Features, "aes", true);
+    setFeatureEnabled(Features, "pclmul", true);
   case CK_BDVER2:
-    setFeatureEnabled(Features, "avx", true);
     setFeatureEnabled(Features, "xop", true);
+    setFeatureEnabled(Features, "lzcnt", true);
     setFeatureEnabled(Features, "aes", true);
     setFeatureEnabled(Features, "pclmul", true);
+    setFeatureEnabled(Features, "bmi", true);
+    setFeatureEnabled(Features, "fma", true);
+    setFeatureEnabled(Features, "f16c", true);
     break;
   case CK_C3_2:
     setFeatureEnabled(Features, "sse", true);

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=168239&r1=168238&r2=168239&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/predefined-arch-macros.c (original)
+++ cfe/trunk/test/Preprocessor/predefined-arch-macros.c Fri Nov 16 19:43:10 2012
@@ -464,6 +464,7 @@
 // RUN:   | FileCheck %s -check-prefix=CHECK_CORE_AVX_I_M32
 // CHECK_CORE_AVX_I_M32: #define __AES__ 1
 // CHECK_CORE_AVX_I_M32: #define __AVX__ 1
+// CHECK_CORE_AVX_I_M32: #define __F16C__ 1
 // CHECK_CORE_AVX_I_M32: #define __MMX__ 1
 // CHECK_CORE_AVX_I_M32: #define __PCLMUL__ 1
 // CHECK_CORE_AVX_I_M32: #define __RDRND__ 1
@@ -484,6 +485,7 @@
 // RUN:   | FileCheck %s -check-prefix=CHECK_CORE_AVX_I_M64
 // CHECK_CORE_AVX_I_M64: #define __AES__ 1
 // CHECK_CORE_AVX_I_M64: #define __AVX__ 1
+// CHECK_CORE_AVX_I_M64: #define __F16C__ 1
 // CHECK_CORE_AVX_I_M64: #define __MMX__ 1
 // CHECK_CORE_AVX_I_M64: #define __PCLMUL__ 1
 // CHECK_CORE_AVX_I_M64: #define __RDRND__ 1
@@ -510,6 +512,7 @@
 // CHECK_CORE_AVX2_M32: #define __AVX__ 1
 // CHECK_CORE_AVX2_M32: #define __BMI2__ 1
 // CHECK_CORE_AVX2_M32: #define __BMI__ 1
+// CHECK_CORE_AVX2_M32: #define __F16C__ 1
 // CHECK_CORE_AVX2_M32: #define __FMA__ 1
 // CHECK_CORE_AVX2_M32: #define __LZCNT__ 1
 // CHECK_CORE_AVX2_M32: #define __MMX__ 1
@@ -536,6 +539,7 @@
 // CHECK_CORE_AVX2_M64: #define __AVX__ 1
 // CHECK_CORE_AVX2_M64: #define __BMI2__ 1
 // CHECK_CORE_AVX2_M64: #define __BMI__ 1
+// CHECK_CORE_AVX2_M64: #define __F16C__ 1
 // CHECK_CORE_AVX2_M64: #define __FMA__ 1
 // CHECK_CORE_AVX2_M64: #define __LZCNT__ 1
 // CHECK_CORE_AVX2_M64: #define __MMX__ 1
@@ -1008,12 +1012,33 @@
 // CHECK_ATHLON_FX_M64: #define __tune_k8__ 1
 // CHECK_ATHLON_FX_M64: #define __x86_64 1
 // CHECK_ATHLON_FX_M64: #define __x86_64__ 1
+// RUN: %clang -march=amdfam10 -m32 -E -dM %s -o - 2>&1 \
+// RUN:     -target i386-unknown-linux \
+// RUN:   | FileCheck %s -check-prefix=CHECK_AMDFAM10_M32
+// CHECK_AMDFAM10_M32: #define __3dNOW_A__ 1
+// CHECK_AMDFAM10_M32: #define __3dNOW__ 1
+// CHECK_AMDFAM10_M32: #define __LZCNT__ 1
+// CHECK_AMDFAM10_M32: #define __MMX__ 1
+// CHECK_AMDFAM10_M32: #define __POPCNT__ 1
+// CHECK_AMDFAM10_M32: #define __SSE2_MATH__ 1
+// CHECK_AMDFAM10_M32: #define __SSE2__ 1
+// CHECK_AMDFAM10_M32: #define __SSE3__ 1
+// CHECK_AMDFAM10_M32: #define __SSE4A__ 1
+// CHECK_AMDFAM10_M32: #define __SSE_MATH__ 1
+// CHECK_AMDFAM10_M32: #define __SSE__ 1
+// CHECK_AMDFAM10_M32: #define __amdfam10 1
+// CHECK_AMDFAM10_M32: #define __amdfam10__ 1
+// CHECK_AMDFAM10_M32: #define __i386 1
+// CHECK_AMDFAM10_M32: #define __i386__ 1
+// CHECK_AMDFAM10_M32: #define __tune_amdfam10__ 1
 // RUN: %clang -march=amdfam10 -m64 -E -dM %s -o - 2>&1 \
 // RUN:     -target i386-unknown-linux \
 // RUN:   | FileCheck %s -check-prefix=CHECK_AMDFAM10_M64
 // CHECK_AMDFAM10_M64: #define __3dNOW_A__ 1
 // CHECK_AMDFAM10_M64: #define __3dNOW__ 1
+// CHECK_AMDFAM10_M64: #define __LZCNT__ 1
 // CHECK_AMDFAM10_M64: #define __MMX__ 1
+// CHECK_AMDFAM10_M64: #define __POPCNT__ 1
 // CHECK_AMDFAM10_M64: #define __SSE2_MATH__ 1
 // CHECK_AMDFAM10_M64: #define __SSE2__ 1
 // CHECK_AMDFAM10_M64: #define __SSE3__ 1
@@ -1027,15 +1052,87 @@
 // CHECK_AMDFAM10_M64: #define __tune_amdfam10__ 1
 // CHECK_AMDFAM10_M64: #define __x86_64 1
 // CHECK_AMDFAM10_M64: #define __x86_64__ 1
+// RUN: %clang -march=btver1 -m32 -E -dM %s -o - 2>&1 \
+// RUN:     -target i386-unknown-linux \
+// RUN:   | FileCheck %s -check-prefix=CHECK_BTVER1_M32
+// CHECK_BTVER1_M32-NOT: #define __3dNOW_A__ 1
+// CHECK_BTVER1_M32-NOT: #define __3dNOW__ 1
+// CHECK_BTVER1_M32: #define __LZCNT__ 1
+// CHECK_BTVER1_M32: #define __MMX__ 1
+// CHECK_BTVER1_M32: #define __POPCNT__ 1
+// CHECK_BTVER1_M32: #define __SSE2_MATH__ 1
+// CHECK_BTVER1_M32: #define __SSE2__ 1
+// CHECK_BTVER1_M32: #define __SSE3__ 1
+// CHECK_BTVER1_M32: #define __SSE4A__ 1
+// CHECK_BTVER1_M32: #define __SSE_MATH__ 1
+// CHECK_BTVER1_M32: #define __SSE__ 1
+// CHECK_BTVER1_M32: #define __SSSE3__ 1
+// CHECK_BTVER1_M32: #define __btver1 1
+// CHECK_BTVER1_M32: #define __btver1__ 1
+// CHECK_BTVER1_M32: #define __i386 1
+// CHECK_BTVER1_M32: #define __i386__ 1
+// CHECK_BTVER1_M32: #define __tune_btver1__ 1
+// RUN: %clang -march=btver1 -m64 -E -dM %s -o - 2>&1 \
+// RUN:     -target i386-unknown-linux \
+// RUN:   | FileCheck %s -check-prefix=CHECK_BTVER1_M64
+// CHECK_BTVER1_M64-NOT: #define __3dNOW_A__ 1
+// CHECK_BTVER1_M64-NOT: #define __3dNOW__ 1
+// CHECK_BTVER1_M64: #define __LZCNT__ 1
+// CHECK_BTVER1_M64: #define __MMX__ 1
+// CHECK_BTVER1_M64: #define __POPCNT__ 1
+// CHECK_BTVER1_M64: #define __SSE2_MATH__ 1
+// CHECK_BTVER1_M64: #define __SSE2__ 1
+// CHECK_BTVER1_M64: #define __SSE3__ 1
+// CHECK_BTVER1_M64: #define __SSE4A__ 1
+// CHECK_BTVER1_M64: #define __SSE_MATH__ 1
+// CHECK_BTVER1_M64: #define __SSE__ 1
+// CHECK_BTVER1_M64: #define __SSSE3__ 1
+// CHECK_BTVER1_M64: #define __amd64 1
+// CHECK_BTVER1_M64: #define __amd64__ 1
+// CHECK_BTVER1_M64: #define __btver1 1
+// CHECK_BTVER1_M64: #define __btver1__ 1
+// CHECK_BTVER1_M64: #define __tune_btver1__ 1
+// CHECK_BTVER1_M64: #define __x86_64 1
+// CHECK_BTVER1_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
+// CHECK_BDVER1_M32-NOT: #define __3dNOW_A__ 1
+// CHECK_BDVER1_M32-NOT: #define __3dNOW__ 1
+// CHECK_BDVER1_M32: #define __AES__ 1
+// CHECK_BDVER1_M32: #define __AVX__ 1
+// CHECK_BDVER1_M32: #define __FMA4__ 1
+// CHECK_BDVER1_M32: #define __LZCNT__ 1
+// CHECK_BDVER1_M32: #define __MMX__ 1
+// CHECK_BDVER1_M32: #define __PCLMUL__ 1
+// CHECK_BDVER1_M32: #define __POPCNT__ 1
+// CHECK_BDVER1_M32: #define __SSE2_MATH__ 1
+// CHECK_BDVER1_M32: #define __SSE2__ 1
+// CHECK_BDVER1_M32: #define __SSE3__ 1
+// CHECK_BDVER1_M32: #define __SSE4A__ 1
+// CHECK_BDVER1_M32: #define __SSE4_1__ 1
+// CHECK_BDVER1_M32: #define __SSE4_2__ 1
+// CHECK_BDVER1_M32: #define __SSE_MATH__ 1
+// CHECK_BDVER1_M32: #define __SSE__ 1
+// CHECK_BDVER1_M32: #define __SSSE3__ 1
+// CHECK_BDVER1_M32: #define __XOP__ 1
+// CHECK_BDVER1_M32: #define __bdver1 1
+// CHECK_BDVER1_M32: #define __bdver1__ 1
+// CHECK_BDVER1_M32: #define __i386 1
+// CHECK_BDVER1_M32: #define __i386__ 1
+// CHECK_BDVER1_M32: #define __tune_bdver1__ 1
 // RUN: %clang -march=bdver1 -m64 -E -dM %s -o - 2>&1 \
 // RUN:     -target i386-unknown-linux \
 // RUN:   | FileCheck %s -check-prefix=CHECK_BDVER1_M64
-// CHECK_BDVER1_M64: #define __AVX__ 1
 // CHECK_BDVER1_M64-NOT: #define __3dNOW_A__ 1
 // CHECK_BDVER1_M64-NOT: #define __3dNOW__ 1
+// CHECK_BDVER1_M64: #define __AES__ 1
+// CHECK_BDVER1_M64: #define __AVX__ 1
 // CHECK_BDVER1_M64: #define __FMA4__ 1
+// CHECK_BDVER1_M64: #define __LZCNT__ 1
 // CHECK_BDVER1_M64: #define __MMX__ 1
 // CHECK_BDVER1_M64: #define __PCLMUL__ 1
+// CHECK_BDVER1_M64: #define __POPCNT__ 1
 // CHECK_BDVER1_M64: #define __SSE2_MATH__ 1
 // CHECK_BDVER1_M64: #define __SSE2__ 1
 // CHECK_BDVER1_M64: #define __SSE3__ 1
@@ -1053,5 +1150,67 @@
 // CHECK_BDVER1_M64: #define __tune_bdver1__ 1
 // CHECK_BDVER1_M64: #define __x86_64 1
 // CHECK_BDVER1_M64: #define __x86_64__ 1
+// RUN: %clang -march=bdver2 -m32 -E -dM %s -o - 2>&1 \
+// RUN:     -target i386-unknown-linux \
+// RUN:   | FileCheck %s -check-prefix=CHECK_BDVER2_M32
+// CHECK_BDVER2_M32-NOT: #define __3dNOW_A__ 1
+// CHECK_BDVER2_M32-NOT: #define __3dNOW__ 1
+// CHECK_BDVER2_M32: #define __AES__ 1
+// CHECK_BDVER2_M32: #define __AVX__ 1
+// CHECK_BDVER2_M32: #define __BMI__ 1
+// CHECK_BDVER2_M32: #define __F16C__ 1
+// CHECK_BDVER2_M32: #define __FMA4__ 1
+// CHECK_BDVER2_M32: #define __FMA__ 1
+// CHECK_BDVER2_M32: #define __LZCNT__ 1
+// CHECK_BDVER2_M32: #define __MMX__ 1
+// CHECK_BDVER2_M32: #define __PCLMUL__ 1
+// CHECK_BDVER2_M32: #define __POPCNT__ 1
+// CHECK_BDVER2_M32: #define __SSE2_MATH__ 1
+// CHECK_BDVER2_M32: #define __SSE2__ 1
+// CHECK_BDVER2_M32: #define __SSE3__ 1
+// CHECK_BDVER2_M32: #define __SSE4A__ 1
+// CHECK_BDVER2_M32: #define __SSE4_1__ 1
+// CHECK_BDVER2_M32: #define __SSE4_2__ 1
+// CHECK_BDVER2_M32: #define __SSE_MATH__ 1
+// CHECK_BDVER2_M32: #define __SSE__ 1
+// CHECK_BDVER2_M32: #define __SSSE3__ 1
+// CHECK_BDVER2_M32: #define __XOP__ 1
+// CHECK_BDVER2_M32: #define __bdver2 1
+// CHECK_BDVER2_M32: #define __bdver2__ 1
+// CHECK_BDVER2_M32: #define __i386 1
+// CHECK_BDVER2_M32: #define __i386__ 1
+// CHECK_BDVER2_M32: #define __tune_bdver2__ 1
+// RUN: %clang -march=bdver2 -m64 -E -dM %s -o - 2>&1 \
+// RUN:     -target i386-unknown-linux \
+// RUN:   | FileCheck %s -check-prefix=CHECK_BDVER2_M64
+// CHECK_BDVER2_M64-NOT: #define __3dNOW_A__ 1
+// CHECK_BDVER2_M64-NOT: #define __3dNOW__ 1
+// CHECK_BDVER2_M64: #define __AES__ 1
+// CHECK_BDVER2_M64: #define __AVX__ 1
+// CHECK_BDVER2_M64: #define __BMI__ 1
+// CHECK_BDVER2_M64: #define __F16C__ 1
+// CHECK_BDVER2_M64: #define __FMA4__ 1
+// CHECK_BDVER2_M64: #define __FMA__ 1
+// CHECK_BDVER2_M64: #define __LZCNT__ 1
+// CHECK_BDVER2_M64: #define __MMX__ 1
+// CHECK_BDVER2_M64: #define __PCLMUL__ 1
+// CHECK_BDVER2_M64: #define __POPCNT__ 1
+// CHECK_BDVER2_M64: #define __SSE2_MATH__ 1
+// CHECK_BDVER2_M64: #define __SSE2__ 1
+// CHECK_BDVER2_M64: #define __SSE3__ 1
+// CHECK_BDVER2_M64: #define __SSE4A__ 1
+// CHECK_BDVER2_M64: #define __SSE4_1__ 1
+// CHECK_BDVER2_M64: #define __SSE4_2__ 1
+// CHECK_BDVER2_M64: #define __SSE_MATH__ 1
+// CHECK_BDVER2_M64: #define __SSE__ 1
+// CHECK_BDVER2_M64: #define __SSSE3__ 1
+// CHECK_BDVER2_M64: #define __XOP__ 1
+// CHECK_BDVER2_M64: #define __amd64 1
+// CHECK_BDVER2_M64: #define __amd64__ 1
+// CHECK_BDVER2_M64: #define __bdver2 1
+// CHECK_BDVER2_M64: #define __bdver2__ 1
+// CHECK_BDVER2_M64: #define __tune_bdver2__ 1
+// CHECK_BDVER2_M64: #define __x86_64 1
+// CHECK_BDVER2_M64: #define __x86_64__ 1
 //
 // End X86/GCC/Linux tests ------------------





More information about the cfe-commits mailing list