public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH/committed 1/3] sim: bfin: clean up astat reg name decode a little
@ 2023-12-21  5:03 Mike Frysinger
  2023-12-21  5:03 ` [PATCH/ccommitted 2/3] sim: mn10300: fix LAST_TIMER_REG typo Mike Frysinger
  2023-12-21  5:03 ` [PATCH/committed 3/3] sim: warnings: enable -Wduplicated-cond Mike Frysinger
  0 siblings, 2 replies; 3+ messages in thread
From: Mike Frysinger @ 2023-12-21  5:03 UTC (permalink / raw)
  To: gdb-patches

The compiler pointed out we checked AZ twice.  Sort by name to avoid
that in the future, and to make it clearer that we have coverage of
all the bits.  And add the bits we were missing.

The order here doesn't matter as it's just turning a pointer into a
human readable string when store tracing is enabled.
---
 sim/bfin/bfin-sim.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/sim/bfin/bfin-sim.c b/sim/bfin/bfin-sim.c
index 4fa5ccc315c7..1a9b499ebb4c 100644
--- a/sim/bfin/bfin-sim.c
+++ b/sim/bfin/bfin-sim.c
@@ -504,6 +504,16 @@ get_store_name (SIM_CPU *cpu, bu32 *p)
     return greg_names[4 * 8 + 2];
   else if (p == &AWREG (1))
     return greg_names[4 * 8 + 3];
+  else if (p == &ASTATREG (ac0))
+    return "ASTAT[ac0]";
+  else if (p == &ASTATREG (ac0_copy))
+    return "ASTAT[ac0_copy]";
+  else if (p == &ASTATREG (ac1))
+    return "ASTAT[ac1]";
+  else if (p == &ASTATREG (an))
+    return "ASTAT[an]";
+  else if (p == &ASTATREG (aq))
+    return "ASTAT[aq]";
   else if (p == &ASTATREG (av0))
     return "ASTAT[av0]";
   else if (p == &ASTATREG (av0s))
@@ -512,22 +522,14 @@ get_store_name (SIM_CPU *cpu, bu32 *p)
     return "ASTAT[av1]";
   else if (p == &ASTATREG (av1s))
     return "ASTAT[av1s]";
+  else if (p == &ASTATREG (az))
+    return "ASTAT[az]";
   else if (p == &ASTATREG (v))
     return "ASTAT[v]";
-  else if (p == &ASTATREG (vs))
-    return "ASTAT[vs]";
   else if (p == &ASTATREG (v_copy))
     return "ASTAT[v_copy]";
-  else if (p == &ASTATREG (az))
-    return "ASTAT[az]";
-  else if (p == &ASTATREG (an))
-    return "ASTAT[an]";
-  else if (p == &ASTATREG (az))
-    return "ASTAT[az]";
-  else if (p == &ASTATREG (ac0))
-    return "ASTAT[ac0]";
-  else if (p == &ASTATREG (ac0_copy))
-    return "ASTAT[ac0_copy]";
+  else if (p == &ASTATREG (vs))
+    return "ASTAT[vs]";
   else
     {
       /* Worry about this when we start to STORE() it.  */
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH/ccommitted 2/3] sim: mn10300: fix LAST_TIMER_REG typo
  2023-12-21  5:03 [PATCH/committed 1/3] sim: bfin: clean up astat reg name decode a little Mike Frysinger
@ 2023-12-21  5:03 ` Mike Frysinger
  2023-12-21  5:03 ` [PATCH/committed 3/3] sim: warnings: enable -Wduplicated-cond Mike Frysinger
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2023-12-21  5:03 UTC (permalink / raw)
  To: gdb-patches

The compiler pointed out that we're testing LAST_TIMER_REG and
LAST_COUNTER which are the same value ... and that's because we
set LAST_TIMER_REG to the wrong register.  Fix the typo.
---
 sim/mn10300/dv-mn103tim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sim/mn10300/dv-mn103tim.c b/sim/mn10300/dv-mn103tim.c
index 95ebc82b9e04..b1844a68e37e 100644
--- a/sim/mn10300/dv-mn103tim.c
+++ b/sim/mn10300/dv-mn103tim.c
@@ -86,7 +86,7 @@ enum timer_register_types {
   TM6MDB,
   TM6CA,
   TM6CB,
-  LAST_TIMER_REG = TM6BC,
+  LAST_TIMER_REG = TM6CB,
 };
 
 
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH/committed 3/3] sim: warnings: enable -Wduplicated-cond
  2023-12-21  5:03 [PATCH/committed 1/3] sim: bfin: clean up astat reg name decode a little Mike Frysinger
  2023-12-21  5:03 ` [PATCH/ccommitted 2/3] sim: mn10300: fix LAST_TIMER_REG typo Mike Frysinger
@ 2023-12-21  5:03 ` Mike Frysinger
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2023-12-21  5:03 UTC (permalink / raw)
  To: gdb-patches

---
 sim/configure                    | 1 +
 sim/m4/sim_ac_option_warnings.m4 | 1 +
 2 files changed, 2 insertions(+)

diff --git a/sim/m4/sim_ac_option_warnings.m4 b/sim/m4/sim_ac_option_warnings.m4
index 7bcf9af7804f..9f1487f93d0c 100644
--- a/sim/m4/sim_ac_option_warnings.m4
+++ b/sim/m4/sim_ac_option_warnings.m4
@@ -44,6 +44,7 @@ build_warnings="-Wall -Wpointer-arith
 dnl C++ -Wno-mismatched-tags
 -Wno-error=deprecated-register
 dnl C++ -Wsuggest-override
+-Wduplicated-cond
 dnl C++ -Wdeprecated-copy
 dnl C++ -Wdeprecated-copy-dtor
 dnl C++ -Wredundant-move
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-21  5:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-21  5:03 [PATCH/committed 1/3] sim: bfin: clean up astat reg name decode a little Mike Frysinger
2023-12-21  5:03 ` [PATCH/ccommitted 2/3] sim: mn10300: fix LAST_TIMER_REG typo Mike Frysinger
2023-12-21  5:03 ` [PATCH/committed 3/3] sim: warnings: enable -Wduplicated-cond Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).