This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use integer constants in mpa.c
- From: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>
- To: Richard Henderson <rth at twiddle dot net>
- Cc: Siddhesh Poyarekar <siddhesh at redhat dot com>, libc-alpha at sourceware dot org
- Date: Fri, 22 Mar 2013 23:22:11 +0530
- Subject: Re: [PATCH] Use integer constants in mpa.c
- References: <20130322100206 dot GJ2409 at spoyarek dot pnq dot redhat dot com> <514C69AF dot 8010107 at twiddle dot net>
On 22 March 2013 19:54, Richard Henderson <rth@twiddle.net> wrote:
> On 2013-03-22 03:02, Siddhesh Poyarekar wrote:
>>
>> - if (X[0] == ZERO)
>> + if (__glibc_unlikely (X[0] == 0))
>
>
> I'm not keen on all the branch markup. I can't believe it's all necessary.
> At minimum please split that out to a separate patch, but I'd much rather do
> without.
I've only marked branches where the compiler gets it wrong and that
results in a performance penalty. I'll split it out into a separate
patch since the rest of the bits are fairly straightforward.
>> *y = ZERO;
>
> ...
>
>> - z[2] = ZERO;
>> - z[3] = ZERO;
>> + z[2] = 0;
>> + z[3] = 0;
>
>
> Is there a good reason to leave some ZERO uses and not others? I can't
> imagine the literal 0 not be just as good everywhere, even in a
> floating-point context; the compiler is quite good at converting constants
> at compile time...
>
> Perhaps we should just eliminate these macros entirely?
OK, I'll just remove all of those macros one by one, starting with
mpa.c. I'll do the branch prediction bits later as that may need more
justification.
Thanks,
Siddhesh
--
http://siddhesh.in