This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [PATCHv4 6/8] Convert _Complex tangent functions to generated code


On Thu, 18 Aug 2016, Paul E. Murphy wrote:

> This is fairly straight fowards.  m68k overrides are
> updated to use the framework, and thus are simplified
> a bit.

There are no m68k overrides for these functions, so this description is 
incorrect, as is the ChangeLog entry:

> 	* sysdeps/m68k/m680x0/fpu/s_ctanh.c: Refactor into ...
> 	* sysdeps/m68k/m680x0/fpu/s_ctanh_template.c: New file.
> 	* sysdeps/m68k/m680x0/fpu/s_ctanhf.c: Removed.
> 	* sysdeps/m68k/m680x0/fpu/s_ctanhl.c: Removed.

> -	      den = (1.0 - absx) * (1.0 + absx);
> -	      if (den == -0.0)
> -		den = 0.0;
> +	      den = (1 - absx) * (1 + absx);
> +	      if (den == -0)
> +		den = 0;

Saying -0 as an integer is fairly nonsensical, since there is no such 
integer as distinct from 0.

Saying == 0, as is done in cacos, is fine here; it's clear enough that 
this code is converting -0 to +0 (and tests == -0.0 and == 0.0 mean the 
same thing anyway).  Then catan and catanh should be consistent, so change 
catanh as well

> +	      den = (1 - absx) * (1 + absx);
> +	      if (den == M_LIT (-0.0))
> +		den = 0;

so it also uses == 0 in the comparison.

Patches 5 and 6 are OK with those changes.

-- 
Joseph S. Myers
joseph@codesourcery.com


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