aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2010-05-17 07:52:27 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2010-05-17 07:52:27 +0000
commit24a235c84f2a6d589e8a0d35121773232fcf787b (patch)
tree52e1f759e31d104d3b48c29f881d46d29bfe7204
parent18252dcfaa504d6711e6d96a05a5c360b2b7078c (diff)
downloadgcc-24a235c84f2a6d589e8a0d35121773232fcf787b.zip
gcc-24a235c84f2a6d589e8a0d35121773232fcf787b.tar.gz
gcc-24a235c84f2a6d589e8a0d35121773232fcf787b.tar.bz2
s390.c: Define sane prefetch settings and activate flag_prefetch_loop_arrays on -O3.
2010-05-17 Christian Borntraeger <borntraeger@de.ibm.com> * config/s390/s390.c: Define sane prefetch settings and activate flag_prefetch_loop_arrays on -O3. * config/s390/s390.h: Declare that read can use write prefetch. From-SVN: r159474
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/s390/s390.c16
-rw-r--r--gcc/config/s390/s390.h2
3 files changed, 24 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d4b4e50..7482a36 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-05-17 Christian Borntraeger <borntraeger@de.ibm.com>
+
+ * config/s390/s390.c: Define sane prefetch settings and activate
+ flag_prefetch_loop_arrays on -O3.
+ * config/s390/s390.h: Declare that read can use write prefetch.
+
2010-05-17 Jakub Jelinek <jakub@redhat.com>
* lto-streamer-out.c (lto_output): Fix --enable-checking=release
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 858aac9..b660e36 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -1475,6 +1475,9 @@ optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
without maintaining a stack frame back-chain. */
flag_asynchronous_unwind_tables = 1;
+ if (HAVE_prefetch || optimize >= 3)
+ flag_prefetch_loop_arrays = 1;
+
/* Use MVCLE instructions to decrease code size if requested. */
if (size != 0)
target_flags |= MASK_MVCLE;
@@ -1661,6 +1664,19 @@ override_options (void)
}
set_param_value ("max-pending-list-length", 256);
+ /* values for loop prefetching */
+ set_param_value ("l1-cache-line-size", 256);
+ if (!PARAM_SET_P (PARAM_L1_CACHE_SIZE))
+ set_param_value ("l1-cache-size", 128);
+ /* s390 has more than 2 levels and the size is much larger. Since
+ we are always running virtualized assume that we only get a small
+ part of the caches above l1. */
+ if (!PARAM_SET_P (PARAM_L2_CACHE_SIZE))
+ set_param_value ("l2-cache-size", 1500);
+ if (!PARAM_SET_P (PARAM_PREFETCH_MIN_INSN_TO_MEM_RATIO))
+ set_param_value ("prefetch-min-insn-to-mem-ratio", 2);
+ if (!PARAM_SET_P (PARAM_SIMULTANEOUS_PREFETCHES))
+ set_param_value ("simultaneous-prefetches", 6);
}
/* Map for smallest class containing reg regno. */
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 5acdd58..1d74d30 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -989,4 +989,6 @@ do { \
(TARGET_LONG_DISPLACEMENT? ((d) >= -524288 && (d) <= 524287) \
: ((d) >= 0 && (d) <= 4095))
+/* Reads can reuse write prefetches, used by tree-ssa-prefetch-loops.c. */
+#define READ_CAN_USE_WRITE_PREFETCH 1
#endif