This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 3/6] Convert _Complex cosine functions to generated code
- From: "Paul E. Murphy" <murphyp at linux dot vnet dot ibm dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 30 Jun 2016 21:08:46 -0500
- Subject: Re: [PATCH 3/6] Convert _Complex cosine functions to generated code
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1467323999 dot git dot murphyp at linux dot vnet dot ibm dot com> <429c0afaf57df188108f8be094ebbca2fa25db4e dot 1467323999 dot git dot murphyp at linux dot vnet dot ibm dot com> <alpine dot DEB dot 2 dot 20 dot 1606302233100 dot 21713 at digraph dot polyomino dot org dot uk>
On 06/30/2016 05:36 PM, Joseph Myers wrote:
> On Thu, 30 Jun 2016, Paul E. Murphy wrote:
>
>> + if (__real__ res == M_LIT (0.0))
>
> As a general principle for all such changes:
>
> Macroization makes the code less readable, so should be avoided where not
> necessary. In particular, where implicit conversions from integers to
> floating point will suffice to give the right floating-point value with
> the right type, use integers, so use integer 0 here, and make similar
> changes throughout this patch series whenever the floating-point constant
> has a small value (not -0) representable in int. (Of course, explicit
> -0.0 does need to use a floating-point constant, not an integer constant.)
Ok, I'll bite. It's a trivial change to apply, and does not alter
code generation on the 5 platforms I'm testing with. C11/TS 18661
guarantee these constants should always be correctly promoted.