Commit 03b3e271 by Kazu Hirata Committed by Kazu Hirata

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
parent 3ac4c44a
2008-06-12 Kazu Hirata <kazu@codesourcery.com>
* 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.
2008-06-12 Jakub Jelinek <jakub@redhat.com> 2008-06-12 Jakub Jelinek <jakub@redhat.com>
PR middle-end/36506 PR middle-end/36506
......
...@@ -391,6 +391,9 @@ enum fpu_type m68k_fpu; ...@@ -391,6 +391,9 @@ enum fpu_type m68k_fpu;
/* The set of FL_* flags that apply to the target processor. */ /* The set of FL_* flags that apply to the target processor. */
unsigned int m68k_cpu_flags; 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, /* 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 or NULL if such calls or jumps are not supported. The address is held
in operand 0. */ in operand 0. */
...@@ -571,13 +574,23 @@ override_options (void) ...@@ -571,13 +574,23 @@ override_options (void)
/* Set the directly-usable versions of the -mcpu and -mtune settings. */ /* Set the directly-usable versions of the -mcpu and -mtune settings. */
m68k_cpu = entry->device; m68k_cpu = entry->device;
if (m68k_tune_entry) 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 #ifdef M68K_DEFAULT_TUNE
else if (!m68k_cpu_entry && !m68k_arch_entry) 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 #endif
else else
m68k_tune = entry->microarch; {
m68k_tune = entry->microarch;
m68k_tune_flags = entry->flags;
}
/* Set the type of FPU. */ /* Set the type of FPU. */
m68k_fpu = (!TARGET_HARD_FLOAT ? FPUTYPE_NONE m68k_fpu = (!TARGET_HARD_FLOAT ? FPUTYPE_NONE
...@@ -2226,13 +2239,18 @@ m68k_rtx_costs (rtx x, int code, int outer_code, int *total) ...@@ -2226,13 +2239,18 @@ m68k_rtx_costs (rtx x, int code, int outer_code, int *total)
#define MULL_COST \ #define MULL_COST \
(TUNE_68060 ? 2 \ (TUNE_68060 ? 2 \
: TUNE_68040 ? 5 \ : TUNE_68040 ? 5 \
: TUNE_CFV2 ? 10 \ : (TUNE_CFV2 && TUNE_EMAC) ? 3 \
: (TUNE_CFV2 && TUNE_MAC) ? 4 \
: TUNE_CFV2 ? 8 \
: TARGET_COLDFIRE ? 3 : 13) : TARGET_COLDFIRE ? 3 : 13)
#define MULW_COST \ #define MULW_COST \
(TUNE_68060 ? 2 \ (TUNE_68060 ? 2 \
: TUNE_68040 ? 3 \ : 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) : TARGET_COLDFIRE ? 2 : 8)
#define DIVW_COST \ #define DIVW_COST \
......
...@@ -269,6 +269,9 @@ along with GCC; see the file COPYING3. If not see ...@@ -269,6 +269,9 @@ along with GCC; see the file COPYING3. If not see
#define TUNE_CFV3 (m68k_tune == ucfv3) #define TUNE_CFV3 (m68k_tune == ucfv3)
#define TUNE_CFV4 (m68k_tune == ucfv4 || m68k_tune == ucfv4e) #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() #define OVERRIDE_OPTIONS override_options()
/* These are meant to be redefined in the host dependent files */ /* These are meant to be redefined in the host dependent files */
...@@ -1137,6 +1140,7 @@ extern enum target_device m68k_cpu; ...@@ -1137,6 +1140,7 @@ extern enum target_device m68k_cpu;
extern enum uarch_type m68k_tune; extern enum uarch_type m68k_tune;
extern enum fpu_type m68k_fpu; extern enum fpu_type m68k_fpu;
extern unsigned int m68k_cpu_flags; extern unsigned int m68k_cpu_flags;
extern unsigned int m68k_tune_flags;
extern const char *m68k_symbolic_call; extern const char *m68k_symbolic_call;
extern const char *m68k_symbolic_jump; extern const char *m68k_symbolic_jump;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment