Commit b03fb8c9 by Adhemerval Zanella Committed by Ulrich Weigand

ibm-ldouble.c (__gcc_qadd): Fix add of normal number and qNaN to not raise an inexact exception.

libgcc/ChangeLog:

2013-12-03  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>

	* config/rs6000/ibm-ldouble.c (__gcc_qadd): Fix add
	of normal number and qNaN to not raise an inexact exception.

gcc/testsuite/ChangeLog:

2013-12-03  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>

	* gcc.target/powerpc/pr57363.c: New test.

From-SVN: r205645
parent ba4fa581
2013-12-03 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
* gcc.target/powerpc/pr57363.c: New test.
2013-12-03 Wei Mi <wmi@google.com> 2013-12-03 Wei Mi <wmi@google.com>
PR rtl-optimization/59020 PR rtl-optimization/59020
......
/* { dg-do run { target { powerpc*-*-linux* } } } */
/* { dg-options "-mlong-double-128" } */
/* Check if adding a qNAN and a normal long double does not generate a
inexact exception. */
#define _GNU_SOURCE
#include <fenv.h>
int main(void)
{
double x = __builtin_nan ("");
long double y = 1.1L;
feenableexcept (FE_INEXACT);
feclearexcept (FE_ALL_EXCEPT);
x = x + y;
return fetestexcept(FE_INEXACT);
}
2013-12-03 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
* config/rs6000/ibm-ldouble.c (__gcc_qadd): Fix add
of normal number and qNaN to not raise an inexact exception.
2013-11-28 Uros Bizjak <ubizjak@gmail.com> 2013-11-28 Uros Bizjak <ubizjak@gmail.com>
* config/i386/32/sfp-machine.h (__FP_FRAC_ADDI_4): New macro. * config/i386/32/sfp-machine.h (__FP_FRAC_ADDI_4): New macro.
......
...@@ -104,6 +104,8 @@ __gcc_qadd (double a, double aa, double c, double cc) ...@@ -104,6 +104,8 @@ __gcc_qadd (double a, double aa, double c, double cc)
if (nonfinite (z)) if (nonfinite (z))
{ {
if (fabs (z) != inf())
return z;
z = cc + aa + c + a; z = cc + aa + c + a;
if (nonfinite (z)) if (nonfinite (z))
return z; return z;
......
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