aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2012-06-19 14:08:03 -0700
committerRichard Henderson <rth@gcc.gnu.org>2012-06-19 14:08:03 -0700
commitf49278e65eb8259aa7c0703a32553f0ebc133047 (patch)
treec573400a1d0a506806c8e246d40428939ef46b90
parent70f42967b3b48d63a8e90bd19b4277a64d6ccd21 (diff)
downloadgcc-f49278e65eb8259aa7c0703a32553f0ebc133047.zip
gcc-f49278e65eb8259aa7c0703a32553f0ebc133047.tar.gz
gcc-f49278e65eb8259aa7c0703a32553f0ebc133047.tar.bz2
Set cache parameters for alpha
From-SVN: r188794
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/alpha/alpha.c70
2 files changed, 59 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6a9e3c9..2c8eb9e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-19 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c: Include params.h.
+ (alpha_option_override): Initialize PARAM_L1_CACHE_LINE_SIZE,
+ PARAM_L1_CACHE_SIZE, PARAM_L2_CACHE_SIZE for the cpu tuning.
+
2012-06-19 Steven Bosscher <steven@gcc.gnu.org>
* doc/tm.texi.in (TARGET_OBJC_DECLARE_UNRESOLVED_CLASS_REFERENCE,
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 7892bf0..3749866 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -57,6 +57,7 @@ along with GCC; see the file COPYING3. If not see
#include "df.h"
#include "libfuncs.h"
#include "opts.h"
+#include "params.h"
/* Specify which cpu to schedule for. */
enum processor_type alpha_tune;
@@ -224,24 +225,40 @@ alpha_option_override (void)
const char *const name;
const enum processor_type processor;
const int flags;
+ const unsigned short line_size; /* in bytes */
+ const unsigned short l1_size; /* in kb. */
+ const unsigned short l2_size; /* in kb. */
} cpu_table[] = {
- { "ev4", PROCESSOR_EV4, 0 },
- { "ev45", PROCESSOR_EV4, 0 },
- { "21064", PROCESSOR_EV4, 0 },
- { "ev5", PROCESSOR_EV5, 0 },
- { "21164", PROCESSOR_EV5, 0 },
- { "ev56", PROCESSOR_EV5, MASK_BWX },
- { "21164a", PROCESSOR_EV5, MASK_BWX },
- { "pca56", PROCESSOR_EV5, MASK_BWX|MASK_MAX },
- { "21164PC",PROCESSOR_EV5, MASK_BWX|MASK_MAX },
- { "21164pc",PROCESSOR_EV5, MASK_BWX|MASK_MAX },
- { "ev6", PROCESSOR_EV6, MASK_BWX|MASK_MAX|MASK_FIX },
- { "21264", PROCESSOR_EV6, MASK_BWX|MASK_MAX|MASK_FIX },
- { "ev67", PROCESSOR_EV6, MASK_BWX|MASK_MAX|MASK_FIX|MASK_CIX },
- { "21264a", PROCESSOR_EV6, MASK_BWX|MASK_MAX|MASK_FIX|MASK_CIX }
+ /* EV4/LCA45 had 8k L1 caches; EV45 had 16k L1 caches.
+ EV4/EV45 had 128k to 16M 32-byte direct Bcache. LCA45
+ had 64k to 8M 8-byte direct Bcache. */
+ { "ev4", PROCESSOR_EV4, 0, 32, 8, 8*1024 },
+ { "21064", PROCESSOR_EV4, 0, 32, 8, 8*1024 },
+ { "ev45", PROCESSOR_EV4, 0, 32, 16, 16*1024 },
+
+ /* EV5 or EV56 had 8k 32 byte L1, 96k 32 or 64 byte L2,
+ and 1M to 16M 64 byte L3 (not modeled).
+ PCA56 had 16k 64-byte cache; PCA57 had 32k Icache.
+ PCA56 had 8k 64-byte cache; PCA57 had 16k Dcache. */
+ { "ev5", PROCESSOR_EV5, 0, 32, 8, 96 },
+ { "21164", PROCESSOR_EV5, 0, 32, 8, 96 },
+ { "ev56", PROCESSOR_EV5, MASK_BWX, 32, 8, 96 },
+ { "21164a", PROCESSOR_EV5, MASK_BWX, 32, 8, 96 },
+ { "pca56", PROCESSOR_EV5, MASK_BWX|MASK_MAX, 64, 16, 4*1024 },
+ { "21164PC",PROCESSOR_EV5, MASK_BWX|MASK_MAX, 64, 16, 4*1024 },
+ { "21164pc",PROCESSOR_EV5, MASK_BWX|MASK_MAX, 64, 16, 4*1024 },
+
+ /* EV6 had 64k 64 byte L1, 1M to 16M Bcache. */
+ { "ev6", PROCESSOR_EV6, MASK_BWX|MASK_MAX|MASK_FIX, 64, 64, 16*1024 },
+ { "21264", PROCESSOR_EV6, MASK_BWX|MASK_MAX|MASK_FIX, 64, 64, 16*1024 },
+ { "ev67", PROCESSOR_EV6, MASK_BWX|MASK_MAX|MASK_FIX|MASK_CIX,
+ 64, 64, 16*1024 },
+ { "21264a", PROCESSOR_EV6, MASK_BWX|MASK_MAX|MASK_FIX|MASK_CIX,
+ 64, 64, 16*1024 }
};
int const ct_size = ARRAY_SIZE (cpu_table);
+ int line_size = 0, l1_size = 0, l2_size = 0;
int i;
#ifdef SUBTARGET_OVERRIDE_OPTIONS
@@ -314,9 +331,12 @@ alpha_option_override (void)
for (i = 0; i < ct_size; i++)
if (! strcmp (alpha_cpu_string, cpu_table [i].name))
{
- alpha_tune = alpha_cpu = cpu_table [i].processor;
+ alpha_tune = alpha_cpu = cpu_table[i].processor;
+ line_size = cpu_table[i].line_size;
+ l1_size = cpu_table[i].l1_size;
+ l2_size = cpu_table[i].l2_size;
target_flags &= ~ (MASK_BWX | MASK_MAX | MASK_FIX | MASK_CIX);
- target_flags |= cpu_table [i].flags;
+ target_flags |= cpu_table[i].flags;
break;
}
if (i == ct_size)
@@ -328,13 +348,29 @@ alpha_option_override (void)
for (i = 0; i < ct_size; i++)
if (! strcmp (alpha_tune_string, cpu_table [i].name))
{
- alpha_tune = cpu_table [i].processor;
+ alpha_tune = cpu_table[i].processor;
+ line_size = cpu_table[i].line_size;
+ l1_size = cpu_table[i].l1_size;
+ l2_size = cpu_table[i].l2_size;
break;
}
if (i == ct_size)
error ("bad value %qs for -mtune switch", alpha_tune_string);
}
+ if (line_size)
+ maybe_set_param_value (PARAM_L1_CACHE_LINE_SIZE, line_size,
+ global_options.x_param_values,
+ global_options_set.x_param_values);
+ if (l1_size)
+ maybe_set_param_value (PARAM_L1_CACHE_SIZE, l1_size,
+ global_options.x_param_values,
+ global_options_set.x_param_values);
+ if (l2_size)
+ maybe_set_param_value (PARAM_L2_CACHE_SIZE, l2_size,
+ global_options.x_param_values,
+ global_options_set.x_param_values);
+
/* Do some sanity checks on the above options. */
if ((alpha_fptm == ALPHA_FPTM_SU || alpha_fptm == ALPHA_FPTM_SUI)