This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: soft-fp: Add FP_DENORM_ZERO
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 08 Oct 2014 21:54:00 -0400
- Subject: Re: soft-fp: Add FP_DENORM_ZERO
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1409191817180 dot 11496 at digraph dot polyomino dot org dot uk> <5435D91B dot 90603 at redhat dot com> <Pine dot LNX dot 4 dot 64 dot 1410090054000 dot 4884 at digraph dot polyomino dot org dot uk>
On 10/08/2014 08:57 PM, Joseph S. Myers wrote:
> On Wed, 8 Oct 2014, Carlos O'Donell wrote:
>
>>> diff --git a/soft-fp/soft-fp.h b/soft-fp/soft-fp.h
>>> index 86bc7fa..05fcca0 100644
>>> --- a/soft-fp/soft-fp.h
>>> +++ b/soft-fp/soft-fp.h
>>> @@ -161,6 +161,11 @@
>>> # define FP_HANDLE_EXCEPTIONS do {} while (0)
>>> #endif
>>>
>>> +/* Whether to flush subnormal inputs to zero with the same sign. */
>>> +#ifndef FP_DENORM_ZERO
>>> +# define FP_DENORM_ZERO 0
>>> +#endif
>>
>> OK, but...
>>
>> For the record this is an instance of the "centralized defaults" pattern
>> which we try to avoid in glibc. What if the target accidentally defines:
>
> I am unconvinced this can readily be avoided in the soft-fp code without a
> lot of duplication of common definitions in different sfp-machine.h files
> (of which there are a lot, when you consider those in libgcc and the Linux
> kernel as well as glibc).
I am not sufficiently familiar with the code to make that judgement, I was
only noting that we're trying to avoid that kind of pattern in glibc in
general. However, "in general" may not apply to this specific case for
soft-fp.
Cheers,
Carlos.