From 63aa80ff5151ee867663272a38ac3d7556408fcf Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Sat, 17 May 1997 02:28:11 +0000 Subject: [PATCH] Treat infinities like normal numbers for purposes of comparisons --- sim/common/ChangeLog | 5 +++++ sim/common/sim-fpu.c | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 34288b32e39..1497a406cf6 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,8 @@ +Fri May 16 22:26:43 1997 Michael Meissner + + * 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 * callback.c (os_close): Mark the descriptor as being diff --git a/sim/common/sim-fpu.c b/sim/common/sim-fpu.c index d2b926608e5..ab9986c8f82 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; -- 2.30.2