svn commit: r275819 - in head/lib/msun: ld128 ld80 src

Steve Kargl sgk at troutmask.apl.washington.edu
Tue Dec 16 16:27:43 UTC 2014


On Tue, Dec 16, 2014 at 09:21:57AM +0000, Ed Schouten wrote:
> Author: ed
> Date: Tue Dec 16 09:21:56 2014
> New Revision: 275819
> URL: https://svnweb.freebsd.org/changeset/base/275819
> 
> Log:
>   Rename cpack*() to CMPLX*().

This seems like a lot of code churn for very little benefit.

In particular, I know that the one person working on fixing
problems with FreeBSD's libm has a private repo and the openlibm
and android developers base their libm off of FreeBSD's libm
and now they'll need to resync their codebases and resolve
conflicts.

> Modified: head/lib/msun/src/math_private.h
> ==============================================================================
> --- head/lib/msun/src/math_private.h	Tue Dec 16 08:29:02 2014	(r275818)
> +++ head/lib/msun/src/math_private.h	Tue Dec 16 09:21:56 2014	(r275819)
> @@ -454,9 +454,16 @@ typedef union {
>   * (0.0+I)*(y+0.0*I) and laboriously computing the full complex product.
>   * In particular, I*Inf is corrupted to NaN+I*Inf, and I*-0 is corrupted
>   * to -0.0+I*0.0.
> + *
> + * The C11 standard introduced the macros CMPLX(), CMPLXF() and CMPLXL()
> + * to construct complex values. The functions below are modelled after
> + * these macros, with the exception that they cannot be used to
> + * construct compile-time complex values.

This comment isn't true!  These functions pre-date C11 by years.
See r151865.  These functions were designed to deal with gcc's
poorly implemented I.  See the paragraph above your comment.

>   */
> +
> +#ifndef CMPLXF
>  static __inline float complex
> -cpackf(float x, float y)
> +CMPLXF(float x, float y)
>  {
>  	float_complex z;
>  
> @@ -464,9 +471,11 @@ cpackf(float x, float y)
>  	IMAGPART(z) = y;
>  	return (z.f);
>  }
> +#endif

Why not use a much less invasive change?

#ifdef CMPLXF
#define cpackf(x, y)  CMPLXF((x), (y))
#else
static __inline float complex
cpackf(float x, float y)
{
	float_complex z;

	REALPART(z) = x;
	IMAGPART(z) = y;
	return (z.f);
}
#endif

-- 
steve




More information about the svn-src-all mailing list