i386.h (ix86_tune_indices): Add X86_TUNE_SOFTWARE_PREFETCHING_BENEFICIAL.
authorJan Hubicka <jh@suse.cz>
Sat, 7 May 2011 14:39:40 +0000 (16:39 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 7 May 2011 14:39:40 +0000 (14:39 +0000)
* i386.h (ix86_tune_indices): Add X86_TUNE_SOFTWARE_PREFETCHING_BENEFICIAL.
(TARGET_SOFTWARE_PREFETCHING_BENEFICIAL): New macor.
* i386.c (initial_ix86_tune_features): Add X86_SOFTARE_PREFETCHING_BENEFICIAL.
(software_prefetching_beneficial_p): Remove predicate.
(ix86_option_override_internal): Use new macro.

From-SVN: r173533

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.h

index b2391638a8192e6b8463927a91520f251b4082fb..6534bbc46eb6ba0b97dc92caaa7e1bb9dfcd6281 100644 (file)
@@ -1,3 +1,11 @@
+2011-05-06  Jan Hubicka  <jh@suse.cz>
+
+       * i386.h (ix86_tune_indices): Add X86_TUNE_SOFTWARE_PREFETCHING_BENEFICIAL.
+       (TARGET_SOFTWARE_PREFETCHING_BENEFICIAL): New macor.
+       * i386.c (initial_ix86_tune_features): Add X86_SOFTARE_PREFETCHING_BENEFICIAL.
+       (software_prefetching_beneficial_p): Remove predicate.
+       (ix86_option_override_internal): Use new macro.
+
 2011-05-06  Jan Hubicka  <jh@suse.cz>
 
        * ipa-inline.c (update_callee_keys): Don't reset node growth cache.
index 786bc6de2003a88b645114a781cf3ff9d7479d45..7b0afb1cec0fc4010d773b0331bd1b58ac36341b 100644 (file)
@@ -2083,6 +2083,11 @@ static unsigned int initial_ix86_tune_features[X86_TUNE_LAST] = {
   /* X86_TUNE_VECTORIZE_DOUBLE: Enable double precision vector
      instructions.  */
   ~m_ATOM,
+
+  /* X86_SOFTARE_PREFETCHING_BENEFICIAL: Enable software prefetching
+     at -O3.  For the moment, the prefetching seems badly tuned for Intel
+     chips.  */
+  m_K6_GEODE | m_AMD_MULTIPLE
 };
 
 /* Feature tests against the various architecture variations.  */
@@ -3257,27 +3262,6 @@ ix86_target_string (int isa, int flags, const char *arch, const char *tune,
   return ret;
 }
 
-/* Return TRUE if software prefetching is beneficial for the
-   given CPU. */
-
-static bool
-software_prefetching_beneficial_p (void)
-{
-  switch (ix86_tune)
-    {
-    case PROCESSOR_GEODE:
-    case PROCESSOR_K6:
-    case PROCESSOR_ATHLON:
-    case PROCESSOR_K8:
-    case PROCESSOR_AMDFAM10:
-    case PROCESSOR_BTVER1:
-      return true;
-
-    default:
-      return false;
-    }
-}
-
 /* Return true, if profiling code should be emitted before
    prologue. Otherwise it returns false.
    Note: For x86 with "hotfix" it is sorried.  */
@@ -4205,7 +4189,7 @@ ix86_option_override_internal (bool main_args_p)
   if (flag_prefetch_loop_arrays < 0
       && HAVE_prefetch
       && optimize >= 3
-      && software_prefetching_beneficial_p ())
+      && TARGET_SOFTWARE_PREFETCHING_BENEFICIAL)
     flag_prefetch_loop_arrays = 1;
 
   /* If using typedef char *va_list, signal that __builtin_va_start (&ap, 0)
index 5baa2b842e839448ad617c13f7b85c7c72ab2b25..4137ecc67288ea0c0210b45e1920bb524426dca9 100644 (file)
@@ -322,6 +322,7 @@ enum ix86_tune_indices {
   X86_TUNE_FUSE_CMP_AND_BRANCH,
   X86_TUNE_OPT_AGU,
   X86_TUNE_VECTORIZE_DOUBLE,
+  X86_TUNE_SOFTWARE_PREFETCHING_BENEFICIAL,
 
   X86_TUNE_LAST
 };
@@ -418,6 +419,8 @@ extern unsigned char ix86_tune_features[X86_TUNE_LAST];
 #define TARGET_OPT_AGU ix86_tune_features[X86_TUNE_OPT_AGU]
 #define TARGET_VECTORIZE_DOUBLE \
        ix86_tune_features[X86_TUNE_VECTORIZE_DOUBLE]
+#define TARGET_SOFTWARE_PREFETCHING_BENEFICIAL \
+       ix86_tune_features[X86_TUNE_SOFTWARE_PREFETCHING_BENEFICIAL]
 
 /* Feature tests against the various architecture variations.  */
 enum ix86_arch_indices {