[PATCHv2 03/11] Support for type-generic libm function implementations libm
Paul E. Murphy
murphyp@linux.vnet.ibm.com
Wed Aug 10 21:50:00 GMT 2016
On 08/10/2016 11:39 AM, Joseph Myers wrote:
> On Wed, 10 Aug 2016, Paul E. Murphy wrote:
>
>> Thinking on Carlos' comments regarding tst-wcstod-round, I am wondering if
>> maybe it wouldn't be better to add an extra make target which instead
>> generates a .c file based on existing naming conventions. E.g:
>>
>> /* This file is generated by 'make regen-libm-templates. Do not edit. */
>> #include <math-type-macros-${type}>
>> #include <${func_unsuffixed}_template.c>
>>
>> This has the benefit of leaving the existing implicit override mechanism
>> in place, and no insane makefile hacks. I would prefer them living in
>> their own directory maybe math/generated, ensuring they are always included
>> after sysdep targets.
>>
>> This target would not run as part of the build process. It would be invoked
>> periodically as libm supports new types, or changes are needed.
>
> Files with an explicit #include are fine as an alternative to generating
> special -include options. But if you're generating them from the glibc
> build system, it would be better to generate them in the build directory
> rather than checking them in.
>
Ok, here is a patch which does all of the above. I like this approach
much better than the previous patches. This approach is much more
inline with the existing idioms, much easier to understand, and more
robust.
Likewise, I've passed these through same set of toolchains to verify
no changes to code generation. I am currently running the individual
patches to verify no intermittent breakage between the patches after
this round of refactoring.
Notable changes from the last patch:
* Rename b_*.c files to *_template.c.
* Don't muck names in gen-libm-calls.
* Create a rule to generate a stub file to include
the appropriate math-type-macros-TYPE.h and
FUNC_template.c in the build directory.
* Remove now unnecessary override variables.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Support-for-type-generic-libm-function-implementatio.patch
Type: text/x-patch
Size: 42038 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160810/369f70b0/attachment.bin>
More information about the Libc-alpha
mailing list