This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Move M_DECL_FUNC_R* to math-type-macros.h
Joseph Myers <joseph@codesourcery.com> writes:
> On Fri, 11 May 2018, Tulio Magno Quites Machado Filho wrote:
>
>> Thread-safe math functions (*_r) have a different naming scheme that
>> doesn't fit the M_SUF() / M_DECL_FUNC() mechanism.
>> Move the M_DECL_FUNC_R() implementation from w_lgamma_r_template.c to
>> math-type-macros.h in order to reuse these macros in other functions.
>
> lgamma_r is a pretty unique function and I don't see any likely other such
> functions (at all, whether or not they might be implemented with
> type-generic templates).
There is also gamma_r. Let me try to explain...
> So again, you'll need to explain more why this
> is useful (or if it's just intended as a cleanup, I think such a cleanup
> should make the _r an explicit macro argument so M_DECL_FUNC can be
> defined in terms of M_DECL_FUNC_R, just as libm_alias_float is defined in
> terms of libm_alias_float_r, etc., unless there's some reason that can't
> work).
... I'm expanding from the explanation I provided in the
declare_mgen_finite_alias thread. I suggest to read that message first.
We can apply the same template techniques to provide *ibm128 functions that:
1. do not conflict with *l symbols that are reserved for the new long double
ABI.
2. do not require a new API. We can redirect them from math.h using asm, in
the same way used for finite or nldbl symbols.
--
Tulio Magno