From: Will Newton <will.newton@linaro.org>
To: Richard Henderson <rth@twiddle.net>
Cc: libc-ports@sourceware.org, Patch Tracking <patches@linaro.org>
Subject: Re: [PATCH] ARM: Add Cortex-A15 optimized NEON and VFP memcpy routines, with IFUNC.
Date: Mon, 15 Apr 2013 18:31:00 -0000 [thread overview]
Message-ID: <CANu=DmjtkP7zyT65FBQoAy=ze6mSXCKv2YherWgL_gQk8n0YtQ@mail.gmail.com> (raw)
In-Reply-To: <516C4554.3090202@twiddle.net>
On 15 April 2013 19:22, Richard Henderson <rth@twiddle.net> wrote:
> On 2013-04-15 19:44, Will Newton wrote:
>>
>> On 15 April 2013 18:14, Richard Henderson <rth@twiddle.net> wrote:
>>>
>>> On 2013-04-15 11:56, Will Newton wrote:
>>>>
>>>>
>>>> +# ifdef PIC
>>>> +1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
>>>> +.Lmemcpy_neon:
>>>> + .long C_SYMBOL_NAME(__memcpy_neon)(GOT)
>>>> +.Lmemcpy_vfp:
>>>> + .long C_SYMBOL_NAME(__memcpy_vfp)(GOT)
>>>> +.Lmemcpy_arm:
>>>> + .long C_SYMBOL_NAME(__memcpy_arm)(GOT)
>>>
>>>
>>>
>>> There's no need for GOT entries. Just use pc-relative references.
>>
>>
>> Are you suggesting I use GOTOFF here or something else?
>
>
> Declining to look up the real names of the constants, something like
>
> ldr r1, .Lmemcpy_arm
> tst r0, #VFP
> ldrne r1, .Lmemcpy_vfp
> tst r0, #NEON
> ldrne r1, .Lmemcpy_neon
> 1: add r0, r1, pc
> bx lr
>
> .Lmemcpy_arm:
> .long C_SYMBOL_NAME(__memcpy_arm) - 1b - PC_OFS
> .Lmemcpy_vfp:
> .long C_SYMBOL_NAME(__memcpy_vfp) - 1b - PC_OFS
> .Lmemcpy_neon:
> .long C_SYMBOL_NAME(__memcpy_neon) - 1b - PC_OFS
>
>
> And I forgot -- this is a bug fix. Using GOT references from IFUNC
> resolvers is not guaranteed to work, due to the one pass nature of ld.so.
> See comments by Dave Miller in the glibc archive wrt Sparc IFUNC.
>
> And does anyone see a benefit to obfuscating this code with PIC tests just
> to avoid a single ADD insn in the static library?
Thanks Richard, that is a great improvement. I'll post up a v2
rewritten this way.
--
Will Newton
Toolchain Working Group, Linaro
next prev parent reply other threads:[~2013-04-15 18:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-15 9:57 Will Newton
2013-04-15 10:01 ` Will Newton
2013-04-15 10:23 ` Ondřej Bílka
2013-04-15 10:59 ` Will Newton
2013-04-15 13:38 ` Ondřej Bílka
2013-04-15 10:06 ` Måns Rullgård
2013-04-15 10:38 ` Will Newton
2013-04-15 10:46 ` Måns Rullgård
2013-04-15 10:49 ` Will Newton
2013-04-18 9:39 ` Ondřej Bílka
2013-04-18 9:47 ` Will Newton
2013-04-18 11:56 ` Ondřej Bílka
2013-04-15 17:14 ` Richard Henderson
2013-04-15 17:44 ` Will Newton
2013-04-15 18:22 ` Richard Henderson
2013-04-15 18:31 ` Will Newton [this message]
2013-04-15 18:37 ` Richard Henderson
2013-04-15 18:48 ` Will Newton
2013-04-15 19:12 ` Richard Henderson
2013-04-15 19:47 ` Will Newton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CANu=DmjtkP7zyT65FBQoAy=ze6mSXCKv2YherWgL_gQk8n0YtQ@mail.gmail.com' \
--to=will.newton@linaro.org \
--cc=libc-ports@sourceware.org \
--cc=patches@linaro.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).