summaryrefslogtreecommitdiff
path: root/sim/common/sim-fpu.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-06-22 13:31:57 +0000
committerAndrew Cagney <cagney@redhat.com>2003-06-22 13:31:57 +0000
commit5ccdad339a29d175cb784895a5318e38b4d95f5a (patch)
tree2626fec57afeaaeeb803859c46c1dd9eb98301a7 /sim/common/sim-fpu.c
parente71bd2e757d871b3aa3c55da56d3409c391f7240 (diff)
downloadgdb-5ccdad339a29d175cb784895a5318e38b4d95f5a.tar.gz
Oops! Committed to much, reverting :-(
Diffstat (limited to 'sim/common/sim-fpu.c')
-rw-r--r--sim/common/sim-fpu.c46
1 files changed, 28 insertions, 18 deletions
diff --git a/sim/common/sim-fpu.c b/sim/common/sim-fpu.c
index 845248adb59..28d61a565fe 100644
--- a/sim/common/sim-fpu.c
+++ b/sim/common/sim-fpu.c
@@ -2,7 +2,7 @@
of the floating point routines in libgcc1.c for targets without
hardware floating point. */
-/* Copyright 1994, 1997, 1998, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1994,1997-1998 Free Software Foundation, Inc.
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -1754,7 +1754,33 @@ INLINE_SIM_FPU (int)
sim_fpu_inv (sim_fpu *f,
const sim_fpu *r)
{
- return sim_fpu_div (f, &sim_fpu_one, r);
+ if (sim_fpu_is_snan (r))
+ {
+ *f = *r;
+ f->class = sim_fpu_class_qnan;
+ return sim_fpu_status_invalid_snan;
+ }
+ if (sim_fpu_is_qnan (r))
+ {
+ *f = *r;
+ f->class = sim_fpu_class_qnan;
+ return 0;
+ }
+ if (sim_fpu_is_infinity (r))
+ {
+ *f = sim_fpu_zero;
+ f->sign = r->sign;
+ return 0;
+ }
+ if (sim_fpu_is_zero (r))
+ {
+ f->class = sim_fpu_class_infinity;
+ f->sign = r->sign;
+ return sim_fpu_status_invalid_div0;
+ }
+ *f = *r;
+ f->normal_exp = - r->normal_exp;
+ return 0;
}
@@ -2188,22 +2214,6 @@ sim_fpu_exp (const sim_fpu *d)
}
-INLINE_SIM_FPU (unsigned64)
-sim_fpu_fraction (const sim_fpu *d)
-{
- return d->fraction;
-}
-
-
-INLINE_SIM_FPU (unsigned64)
-sim_fpu_guard (const sim_fpu *d, int is_double)
-{
- unsigned64 rv;
- unsigned64 guardmask = LSMASK64 (NR_GUARDS - 1, 0);
- rv = (d->fraction & guardmask) >> NR_PAD;
- return rv;
-}
-
INLINE_SIM_FPU (int)
sim_fpu_is (const sim_fpu *d)