From 3529cf5b85d7282b1829d53652f03d0945359ad6 Mon Sep 17 00:00:00 2001
From: Kugan Vivekanandarajah <kugan.vivekanandarajah@linaro.org>
Date: Mon, 12 Feb 2018 10:44:26 +1100
Subject: [PATCH 3/4] add-prefetchers-availabl
Change-Id: I68af62d7be56255574a9c3f636b2d338f918b4e1
---
gcc/config/aarch64/aarch64-protos.h | 1 +
gcc/config/aarch64/aarch64.c | 26 ++++++++++++++++++++------
2 files changed, 21 insertions(+), 6 deletions(-)
@@ -231,6 +231,7 @@ struct cpu_prefetch_tune
const int l1_cache_line_size;
const int l2_cache_size;
const int default_opt_level;
+ const int hw_prefetchers_avail;
};
struct tune_params
@@ -547,7 +547,8 @@ static const cpu_prefetch_tune generic_prefetch_tune =
-1, /* l1_cache_size */
-1, /* l1_cache_line_size */
-1, /* l2_cache_size */
- -1 /* default_opt_level */
+ -1, /* default_opt_level */
+ -1 /* default hw_prefetchers_avail */
};
static const cpu_prefetch_tune exynosm1_prefetch_tune =
@@ -556,7 +557,8 @@ static const cpu_prefetch_tune exynosm1_prefetch_tune =
-1, /* l1_cache_size */
64, /* l1_cache_line_size */
-1, /* l2_cache_size */
- -1 /* default_opt_level */
+ -1, /* default_opt_level */
+ -1 /* default hw_prefetchers_avail */
};
static const cpu_prefetch_tune qdf24xx_prefetch_tune =
@@ -565,7 +567,8 @@ static const cpu_prefetch_tune qdf24xx_prefetch_tune =
32, /* l1_cache_size */
64, /* l1_cache_line_size */
1024, /* l2_cache_size */
- -1 /* default_opt_level */
+ -1, /* default_opt_level */
+ 7 /* hw_prefetchers_avail */
};
static const cpu_prefetch_tune thunderxt88_prefetch_tune =
@@ -574,7 +577,8 @@ static const cpu_prefetch_tune thunderxt88_prefetch_tune =
32, /* l1_cache_size */
128, /* l1_cache_line_size */
16*1024, /* l2_cache_size */
- 3 /* default_opt_level */
+ 3, /* default_opt_level */
+ -1 /* default hw_prefetchers_avail */
};
static const cpu_prefetch_tune thunderx_prefetch_tune =
@@ -583,7 +587,8 @@ static const cpu_prefetch_tune thunderx_prefetch_tune =
32, /* l1_cache_size */
128, /* l1_cache_line_size */
-1, /* l2_cache_size */
- -1 /* default_opt_level */
+ -1, /* default_opt_level */
+ -1 /* default hw_prefetchers_avail */
};
static const cpu_prefetch_tune thunderx2t99_prefetch_tune =
@@ -592,7 +597,8 @@ static const cpu_prefetch_tune thunderx2t99_prefetch_tune =
32, /* l1_cache_size */
64, /* l1_cache_line_size */
256, /* l2_cache_size */
- -1 /* default_opt_level */
+ -1, /* default_opt_level */
+ -1 /* default hw_prefetchers_avail */
};
static const struct tune_params generic_tunings =
@@ -17143,6 +17149,11 @@ aarch64_sched_can_speculate_insn (rtx_insn *insn)
return true;
}
}
+static int
+aarch64_hw_max_mem_read_streams ()
+{
+ return aarch64_tune_params.prefetch->hw_prefetchers_avail;
+}
/* Implement TARGET_COMPUTE_PRESSURE_CLASSES. */
@@ -17661,6 +17672,9 @@ aarch64_libgcc_floating_mode_supported_p
#undef TARGET_SELECT_EARLY_REMAT_MODES
#define TARGET_SELECT_EARLY_REMAT_MODES aarch64_select_early_remat_modes
+#undef TARGET_HW_MAX_MEM_READ_STREAMS
+#define TARGET_HW_MAX_MEM_READ_STREAMS aarch64_hw_max_mem_read_streams
+
#if CHECKING_P
#undef TARGET_RUN_TARGET_SELFTESTS
#define TARGET_RUN_TARGET_SELFTESTS selftest::aarch64_run_selftests
--
2.7.4