[llvm-commits] [gcc-plugin] r82976 - /gcc-plugin/trunk/x86/llvm-target.h

Duncan Sands baldrick at free.fr
Mon Sep 28 00:28:19 PDT 2009


Author: baldrick
Date: Mon Sep 28 02:28:18 2009
New Revision: 82976

URL: http://llvm.org/viewvc/llvm-project?rev=82976&view=rev
Log:
Treat all subfeatures uniformly, and wire up a few more.  I mapped FMA to
fma3 rather than fma4 because the GCC support was done by intel people,
so presumably is for intel's fma3 rather than amd's fma4.

Modified:
    gcc-plugin/trunk/x86/llvm-target.h

Modified: gcc-plugin/trunk/x86/llvm-target.h
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/x86/llvm-target.h?rev=82976&r1=82975&r2=82976&view=diff

==============================================================================
--- gcc-plugin/trunk/x86/llvm-target.h (original)
+++ gcc-plugin/trunk/x86/llvm-target.h Mon Sep 28 02:28:18 2009
@@ -850,24 +850,71 @@
       F.setCPU(TARGET_64BIT ? "core2" : "yonah");             \
     else                                                      \
       F.setCPU(ix86_arch_string);                             \
-    if (TARGET_64BIT)   F.AddFeature("64bit");                \
-    if (TARGET_MMX)     F.AddFeature("mmx");                  \
+                                                              \
+    if (TARGET_64BIT)                                         \
+      F.AddFeature("64bit");                                  \
+    else if (target_flags_explicit & OPTION_MASK_ISA_64BIT)   \
+      F.AddFeature("64bit", false);                           \
+                                                              \
+    if (TARGET_MMX)                                           \
+      F.AddFeature("mmx");                                    \
     else if (target_flags_explicit & OPTION_MASK_ISA_MMX)     \
       F.AddFeature("mmx", false);                             \
-    if (TARGET_SSE)     F.AddFeature("sse");                  \
+                                                              \
+    if (TARGET_3DNOW)                                         \
+      F.AddFeature("3dnow");                                  \
+    else if (target_flags_explicit & OPTION_MASK_ISA_3DNOW)   \
+      F.AddFeature("3dnow", false);                           \
+                                                              \
+    if (TARGET_3DNOW_A)                                       \
+      F.AddFeature("3dnowa");                                 \
+    else if (target_flags_explicit & OPTION_MASK_ISA_3DNOW_A) \
+      F.AddFeature("3dnowa", false);                          \
+                                                              \
+    if (TARGET_SSE)                                           \
+      F.AddFeature("sse");                                    \
     else if (target_flags_explicit & OPTION_MASK_ISA_SSE)     \
       F.AddFeature("sse", false);                             \
-    if (TARGET_SSE2)    F.AddFeature("sse2");                 \
+                                                              \
+    if (TARGET_SSE2)                                          \
+      F.AddFeature("sse2");                                   \
     else if (target_flags_explicit & OPTION_MASK_ISA_SSE2)    \
       F.AddFeature("sse2", false);                            \
-    if (TARGET_SSE3)    F.AddFeature("sse3");                 \
+                                                              \
+    if (TARGET_SSE3)                                          \
+      F.AddFeature("sse3");                                   \
     else if (target_flags_explicit & OPTION_MASK_ISA_SSE3)    \
       F.AddFeature("sse3", false);                            \
-    if (TARGET_SSSE3)   F.AddFeature("ssse3");                \
-    if (TARGET_SSE4_1)  F.AddFeature("sse41");                \
-    if (TARGET_SSE4_2)  F.AddFeature("sse42");                \
-    if (TARGET_3DNOW)   F.AddFeature("3dnow");                \
-    if (TARGET_3DNOW_A) F.AddFeature("3dnowa");               \
+                                                              \
+    if (TARGET_SSSE3)                                         \
+      F.AddFeature("ssse3");                                  \
+    else if (target_flags_explicit & OPTION_MASK_ISA_SSSE3)   \
+      F.AddFeature("ssse3", false);                           \
+                                                              \
+    if (TARGET_SSE4_1)                                        \
+      F.AddFeature("sse41");                                  \
+    else if (target_flags_explicit & OPTION_MASK_ISA_SSE4_1)  \
+      F.AddFeature("sse41", false);                           \
+                                                              \
+    if (TARGET_SSE4_2)                                        \
+      F.AddFeature("sse42");                                  \
+    else if (target_flags_explicit & OPTION_MASK_ISA_SSE4_2)  \
+      F.AddFeature("sse42", false);                           \
+                                                              \
+    if (TARGET_AVX)                                           \
+      F.AddFeature("avx");                                    \
+    else if (target_flags_explicit & OPTION_MASK_ISA_AVX)     \
+      F.AddFeature("avx", false);                             \
+                                                              \
+    if (TARGET_FMA)                                           \
+      F.AddFeature("fma3");                                   \
+    else if (target_flags_explicit & OPTION_MASK_ISA_FMA)     \
+      F.AddFeature("fma3", false);                            \
+                                                              \
+    if (TARGET_SSE4A)                                         \
+      F.AddFeature("sse4a");                                  \
+    else if (target_flags_explicit & OPTION_MASK_ISA_SSE4A)   \
+      F.AddFeature("sse4a", false);                           \
   }
 
 #define LLVM_SET_IMPLICIT_FLOAT(flag_no_implicit_float)       \





More information about the llvm-commits mailing list