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: [PATCH v4 5/5] float128: Add wrappers to override ldbl-128 as float128.


On Thu, 11 May 2017, Gabriel F. T. Gomes wrote:

> diff --git a/sysdeps/ieee754/float128/e_lgammaf128.c b/sysdeps/ieee754/float128/e_lgammaf128.c
> new file mode 100644
> index 0000000..72f02ac
> --- /dev/null
> +++ b/sysdeps/ieee754/float128/e_lgammaf128.c
> @@ -0,0 +1 @@
> +/* _FloatN uses tgamma instead.  */

No, _FloatN has tgammaf128, lgammaf128 and lgammaf128_r, but not plain 
gammaf128.  This file should be removed; nothing should use it.  Plain 
lgammaf128 for _Float128 should come from the type-generic template 
w_lgamma_template.c, without this patch needing to do anything special for 
it.

> diff --git a/sysdeps/ieee754/float128/e_sqrtf128.c b/sysdeps/ieee754/float128/e_sqrtf128.c
> new file mode 100644
> index 0000000..1ac216f
> --- /dev/null
> +++ b/sysdeps/ieee754/float128/e_sqrtf128.c
> @@ -0,0 +1,2 @@
> +#include <float128_private.h>
> +#include <math/e_sqrtl.c>

That won't achieve the desired effects, in that the stub implementation 
will still reference __ieee754_sqrtl in the error message printed.  I 
think the obvious thing to do is to replicate the stub file with 
appropriate substitutions in it as e_sqrtf128.c.  (While there really 
ought to be a shared soft-fp implementation of sqrt for binary128, and 
AArch64 and MIPS64 have essentially the same one, putting it in the 
sysdeps directory is problematic because such an implementation only works 
when sfp-machine.h is available.)

> +#define signbitl signbitf128_do_not_use

signbitl doesn't exist as a public interface; there should be no need for 
this #define.

> +/* Get the constant suffix from bits/floatn-compat.h.  */
> +#define L __f128

I think this should be defined as a function-like macro rather than 
affecting any object-like use of L.

-- 
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]