public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH/committed] sim: mips: fix sim_fpu usage
Date: Tue,  5 Dec 2023 06:12:44 -0700	[thread overview]
Message-ID: <20231205131244.4216-1-vapier@gentoo.org> (raw)

Fix some of the sim_fpu calls to use the right types.  While I'm
not familiar with the MIPS ISA in these cases, these look like
simple oversights due to the name/type mismatches.  This at least
fixes compiling with -Wenum-conversion.
---
 sim/mips/cp1.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sim/mips/cp1.c b/sim/mips/cp1.c
index 1af0c7ae76d1..aa8b05a836c5 100644
--- a/sim/mips/cp1.c
+++ b/sim/mips/cp1.c
@@ -1178,7 +1178,7 @@ inner_rsqrt(uint64_t op1,
 	uint32_t res;
 	sim_fpu_32to (&wop1, op1);
 	status |= sim_fpu_sqrt (&ans, &wop1);
-	status |= sim_fpu_round_32 (&ans, status, round);
+	status |= sim_fpu_round_32 (&ans, round, denorm);
 	wop1 = ans;
 	op_status = sim_fpu_inv (&ans, &wop1);
 	op_status |= sim_fpu_round_32 (&ans, round, denorm);
@@ -1216,7 +1216,7 @@ fp_inv_sqrt(sim_cpu *cpu,
 	    FP_formats fmt)
 {
   sim_fpu_round round = rounding_mode (GETRM());
-  sim_fpu_round denorm = denorm_mode (cpu);
+  sim_fpu_denorm denorm = denorm_mode (cpu);
   sim_fpu_status status = 0;
   uint64_t result = 0;
 
@@ -1903,8 +1903,8 @@ convert_ps (sim_cpu *cpu,
       result = (((uint64_t)res_u) << 32) | (uint64_t)res_l;
       break;
     case fmt_ps:
-      status_u |= sim_fpu_round_32 (&wop_u, 0, round);
-      status_l |= sim_fpu_round_32 (&wop_l, 0, round);
+      status_u |= sim_fpu_round_32 (&wop_u, round, denorm);
+      status_l |= sim_fpu_round_32 (&wop_l, round, denorm);
       sim_fpu_to32 (&res_u, &wop_u);
       sim_fpu_to32 (&res_l, &wop_l);
       result = FP_PS_cat(res_u, res_l);
-- 
2.43.0


                 reply	other threads:[~2023-12-05 13:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231205131244.4216-1-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).