diff options
| author | Marius Strobl <marius@FreeBSD.org> | 2010-03-30 19:06:31 +0000 |
|---|---|---|
| committer | Marius Strobl <marius@FreeBSD.org> | 2010-03-30 19:06:31 +0000 |
| commit | fa38e6334c5f1ee48f441e01d63118139044ee63 (patch) | |
| tree | c24e961a990851f0fc4050f626e8dd4148b6a014 /lib | |
| parent | 35cbfc2ca060c44e84f1da025feec2f011d5f371 (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libc/sparc64/fpu/fpu_div.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/libc/sparc64/fpu/fpu_div.c b/lib/libc/sparc64/fpu/fpu_div.c index c4b8ef6121ff..4748daf40bc4 100644 --- a/lib/libc/sparc64/fpu/fpu_div.c +++ b/lib/libc/sparc64/fpu/fpu_div.c @@ -167,14 +167,16 @@ __fpu_div(fe) * return it. Otherwise we have the following cases: * * Inf / Inf = NaN, plus NV exception - * Inf / num = Inf [i.e., return x] - * Inf / 0 = Inf [i.e., return x] - * 0 / Inf = 0 [i.e., return x] - * 0 / num = 0 [i.e., return x] + * Inf / num = Inf [i.e., return x #] + * Inf / 0 = Inf [i.e., return x #] + * 0 / Inf = 0 [i.e., return x #] + * 0 / num = 0 [i.e., return x #] * 0 / 0 = NaN, plus NV exception - * num / Inf = 0 + * num / Inf = 0 # * num / num = num (do the divide) - * num / 0 = Inf, plus DZ exception + * num / 0 = Inf #, plus DZ exception + * + * # Sign of result is XOR of operand signs. */ if (ISNAN(x) || ISNAN(y)) { ORDER(x, y); @@ -183,10 +185,10 @@ __fpu_div(fe) if (ISINF(x) || ISZERO(x)) { if (x->fp_class == y->fp_class) return (__fpu_newnan(fe)); + x->fp_sign ^= y->fp_sign; return (x); } - /* all results at this point use XOR of operand signs */ x->fp_sign ^= y->fp_sign; if (ISINF(y)) { x->fp_class = FPC_ZERO; |
