summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-23 02:17:00 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-23 02:17:00 +0000
commitf5c2bcb77b8849ac564558828e0a1cd6b64ededc (patch)
tree4a182638a704bea6a7c068eb81f3eb9c3cc5c784
parent4281aa504486f7c456b05a0826a12126c1462b27 (diff)
downloadgcc-f5c2bcb77b8849ac564558828e0a1cd6b64ededc.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131752 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/bfin/bfin-protos.h5
-rw-r--r--gcc/config/bfin/bfin.c84
3 files changed, 61 insertions, 38 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b4c10bc1d8b..44e291e5e66 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/bfin/bfin-protos.h b/gcc/config/bfin/bfin-protos.h
index bb46c8e3611..1786f5c36e4 100644
--- a/gcc/config/bfin/bfin-protos.h
+++ b/gcc/config/bfin/bfin-protos.h
@@ -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
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index d20d5f934d6..0a6a9ecdddc 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -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)