[PATCHv2 03/11] Support for type-generic libm function implementations libm
Paul E. Murphy
murphyp@linux.vnet.ibm.com
Fri Aug 5 14:43:00 GMT 2016
On 08/04/2016 11:42 AM, Joseph Myers wrote:
> On Wed, 3 Aug 2016, Paul E. Murphy wrote:
>
>> +# Add special flags to control how the templated functions
>> +# are built.
>> +g_CPPFLAGS = -include math-type-macros.h
>> +g__fCPPFLAGS = $(g_CPPFLAGS) -DM_TYPE=M_FLOAT
>> +g__CPPFLAGS = $(g_CPPFLAGS) -DM_TYPE=M_DOUBLE
>> +g__lCPPFLAGS = $(g_CPPFLAGS) -DM_TYPE=M_LDOUBLE
>
> Once you've got a separate header for each type, I wonder if you actually
> need this M_FLOAT etc. enumeration, or if it would be better to -include a
> per-type header (either before -include math-type-macros.h, or a header
> which in turn #includes <math-type-macros.h>) and so avoid M_TYPE, M_FLOAT
> etc.
The attached patch directly includes math-type-macros-<type>.h and removes
the M_<TYPE> macros. Likewise, I've tried improve the math/Makefile
readability.
The only hiccup this caused was a simplification of b_clog10.c in a later
patch. My original hope was this could be used to remove all ldbl-opt
overrides for generated functions. Such is not feasible with the
current patches. This is resolved by overriding and building s_clog10l.c
to maintain symbol and binary compatibility similar to what is done
now.
>> +#define CFLOAT __complex__ double
>
> I think _Complex should be preferred over __complex__ for new code
> (existing code is inconsistent).
>
>> + M_HUGE_VAL - Resolves to the type-specific variant of HUGE_VAL
>
> You could just use (M_SUF (__builtin_huge_val) ()) rather than needing
> type-specific headers to define this macro.
>
Ok.
As requested earlier, I will hold off submission until we have
consensus on the entire patch series. Likewise, once we reach
tentative agreement on this, I'll post updates to the remaining
patches.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Support-for-type-generic-libm-function-implementatio.patch
Type: text/x-patch
Size: 47368 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160805/8dc94446/attachment.bin>
More information about the Libc-alpha
mailing list