This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, PR 57363] IBM long double: adding qNaN and number raises inexact exception


Adhemerval Zanella wrote:

> The issue is in __gcc_qadd implementation at libgcc/config/rs6000/ibm-ldouble.c, 
> if the number if non finite, there is not check if it a NaN before actually
> summing all the components. A possible solution would be to add an extra test
> and return the first sum if the number if not infinity.
> 
> This also fixes two GLIBC math issues I'm seeing:
> 
> TEST_ff_f (nexttoward, qnan_value, 1.1L, qnan_value, NO_INEXACT_EXCEPTION),
> TEST_ff_f (nexttoward, 1.1L, qnan_value, qnan_value, NO_INEXACT_EXCEPTION),
> 
> Fix tested on PPC32 and PPC64.
> 
> ---
> 
> 2013-11-15  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
> 
> 	* libgcc/config/rs6000/ibm-ldouble.c (__gcc_qadd): Fix add
>  	of normal number and sNaN to not raise an inexact exception.

Should this be qNaN instead of sNaN here?

Also, since you already have a test case, I think it would be good to add it
to the GCC test suite ...

Otherwise, this looks reasonable to me (but I cannot approve the patch):

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]