diff options
author | Michael Meissner <gnu@the-meissners.org> | 1997-05-17 02:28:11 +0000 |
---|---|---|
committer | Michael Meissner <gnu@the-meissners.org> | 1997-05-17 02:28:11 +0000 |
commit | 63aa80ff5151ee867663272a38ac3d7556408fcf (patch) | |
tree | bb6b2383207066d78f1b0badd5a8c2da796563ba | |
parent | 248c1fb830d34f985f4d14370b505bc320ff1d10 (diff) | |
download | gdb-63aa80ff5151ee867663272a38ac3d7556408fcf.zip gdb-63aa80ff5151ee867663272a38ac3d7556408fcf.tar.gz gdb-63aa80ff5151ee867663272a38ac3d7556408fcf.tar.bz2 |
Treat infinities like normal numbers for purposes of comparisons
-rw-r--r-- | sim/common/ChangeLog | 5 | ||||
-rw-r--r-- | sim/common/sim-fpu.c | 12 |
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; |