aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sim/common/ChangeLog5
-rw-r--r--sim/common/sim-fpu.c12
2 files changed, 11 insertions, 6 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 34288b3..1497a40 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,8 @@
+Fri May 16 22:26:43 1997 Michael Meissner <meissner@cygnus.com>
+
+ * sim-fpu.c (sim_fpu_is_{eq,ne,lt,le,gt,ge}): Compare Infinities
+ just like normal numbers as per IEEE rules.
+
Wed May 14 21:20:38 1997 Bob Manson <manson@charmed.cygnus.com>
* callback.c (os_close): Mark the descriptor as being
diff --git a/sim/common/sim-fpu.c b/sim/common/sim-fpu.c
index d2b9266..ab9986c 100644
--- a/sim/common/sim-fpu.c
+++ b/sim/common/sim-fpu.c
@@ -713,7 +713,7 @@ sim_fpu_is_lt (sim_fpu l,
{
sim_ufpu tl = fpu2ufpu (&l);
sim_ufpu tr = fpu2ufpu (&r);
- if (is_ufpu_number (&tl) && is_ufpu_number (&tr))
+ if (!is_ufpu_nan (&tl) && !is_ufpu_nan (&tr))
return (l.val.d < r.val.d);
else
return 0;
@@ -725,7 +725,7 @@ sim_fpu_is_le (sim_fpu l,
{
sim_ufpu tl = fpu2ufpu (&l);
sim_ufpu tr = fpu2ufpu (&r);
- if (is_ufpu_number (&tl) && is_ufpu_number (&tr))
+ if (!is_ufpu_nan (&tl) && !is_ufpu_nan (&tr))
return (l.val.d <= r.val.d);
else
return 0;
@@ -737,7 +737,7 @@ sim_fpu_is_eq (sim_fpu l,
{
sim_ufpu tl = fpu2ufpu (&l);
sim_ufpu tr = fpu2ufpu (&r);
- if (is_ufpu_number (&tl) && is_ufpu_number (&tr))
+ if (!is_ufpu_nan (&tl) && !is_ufpu_nan (&tr))
return (l.val.d == r.val.d);
else
return 0;
@@ -749,7 +749,7 @@ sim_fpu_is_ne (sim_fpu l,
{
sim_ufpu tl = fpu2ufpu (&l);
sim_ufpu tr = fpu2ufpu (&r);
- if (is_ufpu_number (&tl) && is_ufpu_number (&tr))
+ if (!is_ufpu_nan (&tl) && !is_ufpu_nan (&tr))
return (l.val.d != r.val.d);
else
return 0;
@@ -761,7 +761,7 @@ sim_fpu_is_ge (sim_fpu l,
{
sim_ufpu tl = fpu2ufpu (&l);
sim_ufpu tr = fpu2ufpu (&r);
- if (is_ufpu_number (&tl) && is_ufpu_number (&tr))
+ if (!is_ufpu_nan (&tl) && !is_ufpu_nan (&tr))
return (l.val.d >= r.val.d);
else
return 0;
@@ -773,7 +773,7 @@ sim_fpu_is_gt (sim_fpu l,
{
sim_ufpu tl = fpu2ufpu (&l);
sim_ufpu tr = fpu2ufpu (&r);
- if (is_ufpu_number (&tl) && is_ufpu_number (&tr))
+ if (!is_ufpu_nan (&tl) && !is_ufpu_nan (&tr))
return (l.val.d > r.val.d);
else
return 0;