From: Roland McGrath <roland@hack.frob.com>
To: Will Newton <will.newton@linaro.org>
Cc: libc-ports@sourceware.org, patches@linaro.org
Subject: Re: [PATCH, v5] ARM: Add Cortex-A15 optimized NEON and VFP memcpy routines, with IFUNC.
Date: Tue, 30 Apr 2013 17:18:00 -0000 [thread overview]
Message-ID: <20130430171818.697972C08A@topped-with-meat.com> (raw)
In-Reply-To: Will Newton's message of Tuesday, 30 April 2013 17:54:22 +0100 <517FF73E.5020509@linaro.org>
> +++ b/ports/sysdeps/arm/armv7/multiarch/aeabi_memcpy.c
> @@ -0,0 +1,33 @@
> +/* Copyright (C) 2005-2013 Free Software Foundation, Inc.
The first line of each new file should be a descriptive comment.
> +void *__memcpy_arm (void *dest, const void *src, size_t n);
> +
> +/* Copy memory like memcpy, but no return value required. Can't alias
> + to memcpy because it's not defined in the same translation
> + unit. */
Why not just define the aliases in memcpy.S instead?
(Then this can be an empty file just to override arm/aeabi_memcpy.c.)
You should also add some comments about why it's important that the
__aeabi_* functions use __memcpy_arm rather than memcpy.
> +++ b/ports/sysdeps/arm/armv7/multiarch/ifunc-impl-list.c
> @@ -0,0 +1,44 @@
> +/* Enumerate available IFUNC implementations of a function. arm version.
ARM in caps.
> + IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_ARM_VFPv3,
> + __memcpy_vfp)
HWCAP_ARM_VFP.
> +ENTRY(memcpy)
> + .type memcpy, %gnu_indirect_function
> + ldr r1, .Lmemcpy_arm
> + tst r0, #HWCAP_ARM_VFP
> + ldrne r1, .Lmemcpy_vfp
If __SOFTFP__ is predefined by the compiler, then the compiler is presuming
VFP support anyway. So you can make this:
#ifdef __SOFTFP__
ldr r1, .Lmemcpy_arm
tst r0, #HWCAP_ARM_VFP
ldrne r1, .Lmemcpy_vfp
#else
ldr r1, .Lmemcpy_vfp
#endif
(and also conditionalize .Lmemcpy_arm, below).
> +# If we are configuring for armv7 we need binutils 2.21 to ensure that
> +# NEON alignments are assembled correctly.
> +if test $machine = arm/armv7; then
> + AC_CHECK_PROG_VER(AS, $AS, --version,
> + [GNU assembler.* \([0-9]*\.[0-9.]*\)],
> + [2.1[0-9][0-9]*|2.[2-9][1-9]*|[3-9].*|[1-9][0-9]*], AS=: critic_missing="$critic_missing as")
> +fi
Just put this in sysdeps/arm/armv7/configure.in and don't test $machine.
Whenever possible, it is far better to test for an actual relevant detail
empirically rather than testing version numbers. If you can show an
example of an instruction sequence that is misassembled by binutils 2.20
then we can help you construct a more precise configure check.
Thanks,
Roland
next prev parent reply other threads:[~2013-04-30 17:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-30 16:54 Will Newton
2013-04-30 17:08 ` Joseph S. Myers
2013-05-01 9:11 ` Will Newton
2013-04-30 17:18 ` Roland McGrath [this message]
2013-05-01 15:26 ` Will Newton
2013-05-01 17:01 ` Roland McGrath
2013-05-01 18:43 ` Will Newton
2013-05-02 19:54 ` Roland McGrath
2013-05-01 12:53 ` Richard Henderson
2013-05-01 16:50 ` Roland McGrath
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=20130430171818.697972C08A@topped-with-meat.com \
--to=roland@hack.frob.com \
--cc=libc-ports@sourceware.org \
--cc=patches@linaro.org \
--cc=will.newton@linaro.org \
/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).