aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2022-10-19 15:04:14 +0100
committerAndrew Burgess <aburgess@redhat.com>2022-10-24 17:00:49 +0100
commitffa2d048221147bad30dde3cfbcb535a824b203d (patch)
tree0a1ce7bfa11c8952af1eabfc8ab5ae6746e05e4f /sim
parentb2829fcf9b594ad9933d649cb089efa5b63a2b89 (diff)
downloadgdb-ffa2d048221147bad30dde3cfbcb535a824b203d.zip
gdb-ffa2d048221147bad30dde3cfbcb535a824b203d.tar.gz
gdb-ffa2d048221147bad30dde3cfbcb535a824b203d.tar.bz2
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.
Diffstat (limited to 'sim')
-rw-r--r--sim/sh/interp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sim/sh/interp.c b/sim/sh/interp.c
index fb92d9f..38f3f94 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