public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] sim/sh: use fabs instead of abs Date: Mon, 24 Oct 2022 16:05:02 +0000 (GMT) [thread overview] Message-ID: <20221024160502.11CB1385840C@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ffa2d048221147bad30dde3cfbcb535a824b203d commit ffa2d048221147bad30dde3cfbcb535a824b203d Author: Andrew Burgess <aburgess@redhat.com> Date: Wed Oct 19 15:04:14 2022 +0100 sim/sh: use fabs instead of abs The sh simulator incorrectly uses integer abs instead of the floating point fabs on some floating point values, fixed in this commit. Diff: --- sim/sh/interp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/sh/interp.c b/sim/sh/interp.c index fb92d9f4480..38f3f945a35 100644 --- a/sim/sh/interp.c +++ b/sim/sh/interp.c @@ -1401,7 +1401,7 @@ fsca_s (int in, double (*f) (double)) lower = result - error; frac = frexp (lower, &exp); lower = ldexp (ceil (ldexp (frac, 24)), exp - 24); - return abs (upper - result) >= abs (lower - result) ? upper : lower; + return fabs (upper - result) >= fabs (lower - result) ? upper : lower; } static float
reply other threads:[~2022-10-24 16:05 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=20221024160502.11CB1385840C@sourceware.org \ --to=aburgess@sourceware.org \ --cc=gdb-cvs@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: linkBe 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).