projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b2829fc
)
sim/sh: use fabs instead of abs
author
Andrew Burgess
<aburgess@redhat.com>
Wed, 19 Oct 2022 14:04:14 +0000
(15:04 +0100)
committer
Andrew Burgess
<aburgess@redhat.com>
Mon, 24 Oct 2022 16:00:49 +0000
(17:00 +0100)
The sh simulator incorrectly uses integer abs instead of the floating
point fabs on some floating point values, fixed in this commit.
sim/sh/interp.c
patch
|
blob
|
history
diff --git
a/sim/sh/interp.c
b/sim/sh/interp.c
index fb92d9f4480a1aba01e13dd3a35bd035bc55f4b4..38f3f945a3575e8b87065758d1af4e458973a6a7 100644
(file)
--- 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) >= f
abs (lower - result) ? upper : lower;
}
static float