This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3] PowerPC: stpcpy optimization for PPC64/POWER7
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: will_schmidt at vnet dot ibm dot com
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Thu, 24 Oct 2013 16:33:57 -0200
- Subject: Re: [PATCH v3] PowerPC: stpcpy optimization for PPC64/POWER7
- Authentication-results: sourceware.org; auth=none
- References: <523715EE dot 9070408 at linux dot vnet dot ibm dot com> <524EDF56 dot 2060706 at linux dot vnet dot ibm dot com> <1382629560 dot 23318 dot 58 dot camel at brimstone>
On 24-10-2013 13:46, Will Schmidt wrote:
>
> A few comments scattered about below on cosmetic issues. Nothing of
> real concern, this looks good to me.
>
> Thanks,
> -Will
Thanks for the review/comments Will.
> +#ifndef USE_AS_STPCPY
> +/* Save the dst pointer to use as return value. */
> + mr rRTN, r3
> +#endif
> Just to get rid of a #ifndef, I'd be tempted to change the above to just
> mr rRTN, r3
> and live with the "mr r3, r3" for the USE_AS_STPCPY case.
>
> I Don't feel strongly about it, but wanted to have more feedback than
> 'looks good' :-)
Yeah, although we can live, it will be more icache usage and another instruction to
dispatch (although in the end it might turn in nop).
>
>> +
>> +#ifndef USE_AS_STPCPY
>> +libc_hidden_builtin_def (strcpy)
>> +#endif
> I'm not sure if there is style precedence, can or should the #ifndef
> above be dropped, so that reads
> libc_hidden_builtin_def (FUNC_NAME)
> And then remove the statement from the stpcpy.S that includes this file?
>
> I suppose that would be a problem if we needed to mix
> libc_hidden_builtin_def and libc_builtin_def incantations...
>
>
> Looks Ok.
I in fact try to mimic what x86_64 does in a lot of assembly code (check sysdeps/x86_64/memcpy.S
for instance).
>
> Similar comment as earlier, should the strcpy reference here become
> FUNC_NAME, and possibly also remove the #ifndef wrapper.
>
I tried to keep the libc_hidden_xxx/strong_alias/weak_alias in the same modules as they are defined.
> Either way, looks OK.
> Thanks,
> -Will
If you don't have any more objection, I'll commit it.