aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/m68k
diff options
context:
space:
mode:
authorKazu Hirata <kazu@codesourcery.com>2008-06-12 16:15:58 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2008-06-12 16:15:58 +0000
commit03b3e2712c6ece43c93688cd1e3aef302b44df76 (patch)
treede2ed758825255ce5881b83984e452aa24506a93 /gcc/config/m68k
parent3ac4c44a58c0efc38fea252672028a1737036e32 (diff)
downloadgcc-03b3e2712c6ece43c93688cd1e3aef302b44df76.zip
gcc-03b3e2712c6ece43c93688cd1e3aef302b44df76.tar.gz
gcc-03b3e2712c6ece43c93688cd1e3aef302b44df76.tar.bz2
m68k.c (m68k_tune_flags): New.
* config/m68k/m68k.c (m68k_tune_flags): New. (override_options): Compute m68k_tune_flags. (MULL_COST, MULW_COST): Update for various variants of CFV2. * config/m68k/m68k.h (TUNE_MAC, TUNE_EMAC): New. From-SVN: r136711
Diffstat (limited to 'gcc/config/m68k')
-rw-r--r--gcc/config/m68k/m68k.c28
-rw-r--r--gcc/config/m68k/m68k.h4
2 files changed, 27 insertions, 5 deletions
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index a1437d2..f95e37e 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -391,6 +391,9 @@ enum fpu_type m68k_fpu;
/* The set of FL_* flags that apply to the target processor. */
unsigned int m68k_cpu_flags;
+/* The set of FL_* flags that apply to the processor to be tuned for. */
+unsigned int m68k_tune_flags;
+
/* Asm templates for calling or jumping to an arbitrary symbolic address,
or NULL if such calls or jumps are not supported. The address is held
in operand 0. */
@@ -571,13 +574,23 @@ override_options (void)
/* Set the directly-usable versions of the -mcpu and -mtune settings. */
m68k_cpu = entry->device;
if (m68k_tune_entry)
- m68k_tune = m68k_tune_entry->microarch;
+ {
+ m68k_tune = m68k_tune_entry->microarch;
+ m68k_tune_flags = m68k_tune_entry->flags;
+ }
#ifdef M68K_DEFAULT_TUNE
else if (!m68k_cpu_entry && !m68k_arch_entry)
- m68k_tune = M68K_DEFAULT_TUNE;
+ {
+ enum target_device dev;
+ dev = all_microarchs[M68K_DEFAULT_TUNE].device;
+ m68k_tune_flags = all_devices[dev]->flags;
+ }
#endif
else
- m68k_tune = entry->microarch;
+ {
+ m68k_tune = entry->microarch;
+ m68k_tune_flags = entry->flags;
+ }
/* Set the type of FPU. */
m68k_fpu = (!TARGET_HARD_FLOAT ? FPUTYPE_NONE
@@ -2226,13 +2239,18 @@ m68k_rtx_costs (rtx x, int code, int outer_code, int *total)
#define MULL_COST \
(TUNE_68060 ? 2 \
: TUNE_68040 ? 5 \
- : TUNE_CFV2 ? 10 \
+ : (TUNE_CFV2 && TUNE_EMAC) ? 3 \
+ : (TUNE_CFV2 && TUNE_MAC) ? 4 \
+ : TUNE_CFV2 ? 8 \
: TARGET_COLDFIRE ? 3 : 13)
#define MULW_COST \
(TUNE_68060 ? 2 \
: TUNE_68040 ? 3 \
- : TUNE_68000_10 || TUNE_CFV2 ? 5 \
+ : TUNE_68000_10 ? 5 \
+ : (TUNE_CFV2 && TUNE_EMAC) ? 3 \
+ : (TUNE_CFV2 && TUNE_MAC) ? 2 \
+ : TUNE_CFV2 ? 8 \
: TARGET_COLDFIRE ? 2 : 8)
#define DIVW_COST \
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index 7a68595..2bb725f 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -269,6 +269,9 @@ along with GCC; see the file COPYING3. If not see
#define TUNE_CFV3 (m68k_tune == ucfv3)
#define TUNE_CFV4 (m68k_tune == ucfv4 || m68k_tune == ucfv4e)
+#define TUNE_MAC ((m68k_tune_flags & FL_CF_MAC) != 0)
+#define TUNE_EMAC ((m68k_tune_flags & FL_CF_EMAC) != 0)
+
#define OVERRIDE_OPTIONS override_options()
/* These are meant to be redefined in the host dependent files */
@@ -1137,6 +1140,7 @@ extern enum target_device m68k_cpu;
extern enum uarch_type m68k_tune;
extern enum fpu_type m68k_fpu;
extern unsigned int m68k_cpu_flags;
+extern unsigned int m68k_tune_flags;
extern const char *m68k_symbolic_call;
extern const char *m68k_symbolic_jump;