bfin-protos.h (WA_RETS, [...]): New macros.

* config/bfin/bfin-protos.h (WA_RETS, ENABLE_WA_RETS): New macros.
	* config/bfin/bfin.c (bfin_cpus): Add WA_RETS everywhere.
	(cputype_selected): New static variable.
	(bfin_handle_option): Set it if -mcpu is used.
	(override_option): Select default set of workarounds if no cpu type
	selected on the command line.
	(workaround_rts_anomaly): Only run if ENABLE_WA_RETS.

From-SVN: r131752
This commit is contained in:
Bernd Schmidt 2008-01-23 02:17:00 +00:00 committed by Bernd Schmidt
parent 24030e4c48
commit fa8d4a0f09
3 changed files with 61 additions and 38 deletions

View File

@ -1,4 +1,12 @@
2008-01-22 Bernd Schmidt <bernd.schmidt@analog.com>
2008-01-23 Bernd Schmidt <bernd.schmidt@analog.com>
* config/bfin/bfin-protos.h (WA_RETS, ENABLE_WA_RETS): New macros.
* config/bfin/bfin.c (bfin_cpus): Add WA_RETS everywhere.
(cputype_selected): New static variable.
(bfin_handle_option): Set it if -mcpu is used.
(override_option): Select default set of workarounds if no cpu type
selected on the command line.
(workaround_rts_anomaly): Only run if ENABLE_WA_RETS.
From Michael Frysinger <michael.frysinger@analog.com>
* config/bfin/bfin-protos.h (enum bfin_cpu_type): Add

View File

@ -65,6 +65,11 @@ extern unsigned int bfin_workarounds;
#define ENABLE_WA_SPECULATIVE_SYNCS \
(bfin_workarounds & WA_SPECULATIVE_SYNCS)
/* For the anomaly 05-00-0371 */
#define WA_RETS 0x00000004
#define ENABLE_WA_RETS \
(bfin_workarounds & WA_RETS)
#define Mmode enum machine_mode

View File

@ -103,6 +103,8 @@ int bfin_si_revision;
/* The workarounds enabled */
unsigned int bfin_workarounds = 0;
static bool cputype_selected = false;
struct bfin_cpu
{
const char *name;
@ -114,97 +116,97 @@ struct bfin_cpu
struct bfin_cpu bfin_cpus[] =
{
{"bf522", BFIN_CPU_BF522, 0x0000,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf523", BFIN_CPU_BF523, 0x0000,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf524", BFIN_CPU_BF524, 0x0000,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf525", BFIN_CPU_BF525, 0x0000,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf526", BFIN_CPU_BF526, 0x0000,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf527", BFIN_CPU_BF527, 0x0000,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf531", BFIN_CPU_BF531, 0x0005,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf531", BFIN_CPU_BF531, 0x0004,
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS},
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS},
{"bf531", BFIN_CPU_BF531, 0x0003,
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS},
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS},
{"bf532", BFIN_CPU_BF532, 0x0005,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf532", BFIN_CPU_BF532, 0x0004,
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS},
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS},
{"bf532", BFIN_CPU_BF532, 0x0003,
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS},
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS},
{"bf533", BFIN_CPU_BF533, 0x0005,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf533", BFIN_CPU_BF533, 0x0004,
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS},
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS},
{"bf533", BFIN_CPU_BF533, 0x0003,
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS},
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS},
{"bf534", BFIN_CPU_BF534, 0x0003,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf534", BFIN_CPU_BF534, 0x0002,
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS},
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS},
{"bf534", BFIN_CPU_BF534, 0x0001,
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS},
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS},
{"bf536", BFIN_CPU_BF536, 0x0003,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf536", BFIN_CPU_BF536, 0x0002,
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS},
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS},
{"bf536", BFIN_CPU_BF536, 0x0001,
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS},
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS},
{"bf537", BFIN_CPU_BF537, 0x0003,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf537", BFIN_CPU_BF537, 0x0002,
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS},
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS},
{"bf537", BFIN_CPU_BF537, 0x0001,
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS},
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS},
{"bf538", BFIN_CPU_BF538, 0x0004,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf538", BFIN_CPU_BF538, 0x0003,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf539", BFIN_CPU_BF539, 0x0004,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf539", BFIN_CPU_BF539, 0x0003,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf539", BFIN_CPU_BF539, 0x0002,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf542", BFIN_CPU_BF542, 0x0000,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf544", BFIN_CPU_BF544, 0x0000,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf547", BFIN_CPU_BF547, 0x0000,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf548", BFIN_CPU_BF548, 0x0000,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf549", BFIN_CPU_BF549, 0x0000,
WA_SPECULATIVE_LOADS},
WA_SPECULATIVE_LOADS | WA_RETS},
{"bf561", BFIN_CPU_BF561, 0x0005, 0},
{"bf561", BFIN_CPU_BF561, 0x0005, WA_RETS},
{"bf561", BFIN_CPU_BF561, 0x0003,
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS},
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS},
{"bf561", BFIN_CPU_BF561, 0x0002,
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS},
WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS},
{NULL, 0, 0, 0}
};
@ -2375,6 +2377,8 @@ bfin_handle_option (size_t code, const char *arg, int value)
q = arg + strlen (p);
cputype_selected = true;
if (*q == '\0')
{
bfin_si_revision = bfin_cpus[i].si_revision;
@ -2455,6 +2459,9 @@ override_options (void)
else if (bfin_specld_anomaly == 0)
bfin_workarounds &= ~WA_SPECULATIVE_LOADS;
if (!cputype_selected)
bfin_workarounds |= WA_RETS;
if (TARGET_OMIT_LEAF_FRAME_POINTER)
flag_omit_frame_pointer = 1;
@ -4779,6 +4786,9 @@ bfin_reorg (void)
if (! ENABLE_WA_SPECULATIVE_SYNCS)
return;
if (! ENABLE_WA_RETS)
return;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
if (JUMP_P (insn)