Commit 433d5d04 by Brad Lucier Committed by Richard Henderson

real.c (do_add): Fix 0+0 sign corner case.

        * real.c (do_add): Fix 0+0 sign corner case.
        (do_divide): Fix Inf/0 corner case.

From-SVN: r58322
parent 1194ca05
2002-10-19 Brad Lucier <lucier@math.purdue.edu>
* real.c (do_add): Fix 0+0 sign corner case.
(do_divide): Fix Inf/0 corner case.
Sun Oct 20 00:31:31 CEST 2002 Jan Hubicka <jh@suse.cz> Sun Oct 20 00:31:31 CEST 2002 Jan Hubicka <jh@suse.cz>
* i386.c (classify_argument): Pass MMX arguments in memory * i386.c (classify_argument): Pass MMX arguments in memory
......
...@@ -578,8 +578,8 @@ do_add (r, a, b, subtract_p) ...@@ -578,8 +578,8 @@ do_add (r, a, b, subtract_p)
switch (CLASS2 (a->class, b->class)) switch (CLASS2 (a->class, b->class))
{ {
case CLASS2 (rvc_zero, rvc_zero): case CLASS2 (rvc_zero, rvc_zero):
/* +-0 +/- +-0 = +0. */ /* -0 + -0 = -0, -0 - +0 = -0; all other cases yield +0. */
get_zero (r, 0); get_zero (r, sign & !subtract_p);
return; return;
case CLASS2 (rvc_zero, rvc_normal): case CLASS2 (rvc_zero, rvc_normal):
...@@ -838,8 +838,6 @@ do_divide (r, a, b) ...@@ -838,8 +838,6 @@ do_divide (r, a, b)
{ {
case CLASS2 (rvc_zero, rvc_zero): case CLASS2 (rvc_zero, rvc_zero):
/* 0 / 0 = NaN. */ /* 0 / 0 = NaN. */
case CLASS2 (rvc_inf, rvc_zero):
/* Inf / 0 = NaN. */
case CLASS2 (rvc_inf, rvc_inf): case CLASS2 (rvc_inf, rvc_inf):
/* Inf / Inf = NaN. */ /* Inf / Inf = NaN. */
get_canonical_qnan (r, sign); get_canonical_qnan (r, sign);
...@@ -856,6 +854,8 @@ do_divide (r, a, b) ...@@ -856,6 +854,8 @@ do_divide (r, a, b)
case CLASS2 (rvc_normal, rvc_zero): case CLASS2 (rvc_normal, rvc_zero):
/* R / 0 = Inf. */ /* R / 0 = Inf. */
case CLASS2 (rvc_inf, rvc_zero):
/* Inf / 0 = Inf. */
get_inf (r, sign); get_inf (r, sign);
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment