This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] x86-64: Implement strcpy family IFUNC selectors in C



On 11/06/2017 20:33, H.J. Lu wrote:
> On Sun, Jun 11, 2017 at 12:46 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Sun, Jun 11, 2017 at 11:22 AM, Florian Weimer
>> <fweimer@gapps.redhat.com> wrote:
>>> On 06/11/2017 03:50 PM, H.J. Lu wrote:
>>>> All internal calls within libc.so can use IFUNC on x86-64 since unlike
>>>> x86, x86-64 doesn't need to reserve a register to make a PLT call.
>>>
>>> Shouldn't this rather say, “because, unlike x86, x86-64 supports PC-relative
>>> addressing to access the GOT entry”?  That's probably the root cause of the
>> Both are true.  The end result is there is no extra needed for call
>> via PLT.
>>
>>> performance difference.
>>>
> Here is the patch with updated commit message.  I also renamed
> ifunc-strcpy.h to ifunc-unaligned-ssse3.h so that it can be used for
> strcat.
> 
> Any other comments?

LGTM with just a nit below.

> --- /dev/null
> +++ b/sysdeps/x86_64/multiarch/stpcpy-sse2.S
> @@ -0,0 +1,33 @@
[..]
> +
> +#if IS_IN (libc)
> +
> +# include <sysdep.h>
> +# define __stpcpy __stpcpy_sse2
> +
> +# undef weak_alias
> +# define weak_alias(__stpcpy, stpcpy)
> +# undef libc_hidden_def
> +# define libc_hidden_def(__stpcpy)
> +# undef libc_hidden_builtin_def
> +# define libc_hidden_builtin_def(stpcpy)
> +#endif
> +
> +#define USE_AS_STPCPY
> +#include "../stpcpy.S"

I would prefer to use full paths as for [1].  It is usually less problematic
for file move within source code.

[1] https://sourceware.org/ml/libc-alpha/2017-06/msg00254.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]