public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/7] sim: frv: fix ambiguous else compiler warnings
@ 2021-06-27  4:05 Mike Frysinger
  2021-06-27  4:05 ` [PATCH 2/7] sim: frv: fix return type for post_wait_for funcs Mike Frysinger
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Mike Frysinger @ 2021-06-27  4:05 UTC (permalink / raw)
  To: gdb-patches

Add explicit braces to if bodies when the body is another if/else
to fix a bunch of compiler warnings.
---
 sim/frv/frv.c           | 10 ++++++----
 sim/frv/profile-fr500.c | 32 +++++++++++++++++++-------------
 sim/frv/profile-fr550.c | 20 ++++++++++++--------
 3 files changed, 37 insertions(+), 25 deletions(-)

diff --git a/sim/frv/frv.c b/sim/frv/frv.c
index aff9dc1a49ef..22c5fb7d8bdf 100644
--- a/sim/frv/frv.c
+++ b/sim/frv/frv.c
@@ -1182,10 +1182,12 @@ frvbf_shift_left_arith_saturate (SIM_CPU *current_cpu, SI arg1, SI arg2)
 
   /* Signed shift by 31 or greater saturates by definition.  */
   if (arg2 >= 31)
-    if (arg1 > 0)
-      return (SI) 0x7fffffff;
-    else
-      return (SI) 0x80000000;
+    {
+      if (arg1 > 0)
+	return (SI) 0x7fffffff;
+      else
+	return (SI) 0x80000000;
+    }
 
   /* OK, arg2 is between 1 and 31.  */
   neg_arg1 = (arg1 < 0);
diff --git a/sim/frv/profile-fr500.c b/sim/frv/profile-fr500.c
index f89e451bad84..e9cc49dc38d7 100644
--- a/sim/frv/profile-fr500.c
+++ b/sim/frv/profile-fr500.c
@@ -158,22 +158,28 @@ adjust_float_register_busy (SIM_CPU *cpu, INT in_FRi, INT in_FRj, INT out_FRk,
      then their latency will be less than previously recorded.
      See Table 13-13 in the LSI.  */
   if (in_FRi >= 0)
-    if (use_is_fpop (cpu, in_FRi))
-      decrease_FR_busy (cpu, in_FRi, cycles);
-    else
-      enforce_full_fr_latency (cpu, in_FRi);
-  
+    {
+      if (use_is_fpop (cpu, in_FRi))
+	decrease_FR_busy (cpu, in_FRi, cycles);
+      else
+	enforce_full_fr_latency (cpu, in_FRi);
+    }
+
   if (in_FRj >= 0 && in_FRj != in_FRi)
-    if (use_is_fpop (cpu, in_FRj))
-      decrease_FR_busy (cpu, in_FRj, cycles);
-    else
-      enforce_full_fr_latency (cpu, in_FRj);
+    {
+      if (use_is_fpop (cpu, in_FRj))
+	decrease_FR_busy (cpu, in_FRj, cycles);
+      else
+	enforce_full_fr_latency (cpu, in_FRj);
+    }
 
   if (out_FRk >= 0 && out_FRk != in_FRi && out_FRk != in_FRj)
-    if (use_is_fpop (cpu, out_FRk))
-      decrease_FR_busy (cpu, out_FRk, cycles);
-    else
-      enforce_full_fr_latency (cpu, out_FRk);
+    {
+      if (use_is_fpop (cpu, out_FRk))
+	decrease_FR_busy (cpu, out_FRk, cycles);
+      else
+	enforce_full_fr_latency (cpu, out_FRk);
+    }
 }
 
 /* Latency of floating point registers may be less than recorded when followed
diff --git a/sim/frv/profile-fr550.c b/sim/frv/profile-fr550.c
index 2bf1729135a8..9b17931abc29 100644
--- a/sim/frv/profile-fr550.c
+++ b/sim/frv/profile-fr550.c
@@ -225,10 +225,12 @@ adjust_float_register_busy (SIM_CPU *cpu,
       for (i = 0; i < iwidth; ++i)
 	{
 	  if (! REG_OVERLAP (in_FRi + i, 1, out_FRk, kwidth))
-	    if (use_is_fr_load (cpu, in_FRi + i))
-	      decrease_FR_busy (cpu, in_FRi + i, 1);
-	    else
-	      enforce_full_fr_latency (cpu, in_FRi + i);
+	    {
+	      if (use_is_fr_load (cpu, in_FRi + i))
+		decrease_FR_busy (cpu, in_FRi + i, 1);
+	      else
+		enforce_full_fr_latency (cpu, in_FRi + i);
+	    }
 	}
     }
 
@@ -238,10 +240,12 @@ adjust_float_register_busy (SIM_CPU *cpu,
 	{
 	  if (! REG_OVERLAP (in_FRj + i, 1, in_FRi, iwidth)
 	      && ! REG_OVERLAP (in_FRj + i, 1, out_FRk, kwidth))
-	    if (use_is_fr_load (cpu, in_FRj + i))
-	      decrease_FR_busy (cpu, in_FRj + i, 1);
-	    else
-	      enforce_full_fr_latency (cpu, in_FRj + i);
+	    {
+	      if (use_is_fr_load (cpu, in_FRj + i))
+		decrease_FR_busy (cpu, in_FRj + i, 1);
+	      else
+		enforce_full_fr_latency (cpu, in_FRj + i);
+	    }
 	}
     }
 
-- 
2.31.1


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

end of thread, other threads:[~2021-06-27  4:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-27  4:05 [PATCH 1/7] sim: frv: fix ambiguous else compiler warnings Mike Frysinger
2021-06-27  4:05 ` [PATCH 2/7] sim: frv: fix return type for post_wait_for funcs Mike Frysinger
2021-06-27  4:05 ` [PATCH 3/7] sim: frv: fix uninitialized variable warnings Mike Frysinger
2021-06-27  4:05 ` [PATCH 4/7] sim: frv: fix some printf type mismatch warnings Mike Frysinger
2021-06-27  4:05 ` [PATCH 5/7] sim: frv: fix up various missing prototype warnings Mike Frysinger
2021-06-27  4:05 ` [PATCH 6/7] sim: frv: fix engine hook Mike Frysinger
2021-06-27  4:05 ` [PATCH 7/7] sim: frv: add missing const type 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).