public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mike Stump <mikestump@comcast.net>
To: Kyrill Tkachov <kyrylo.tkachov@arm.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: arm memcpy of aligned data
Date: Sun, 16 Aug 2015 19:24:00 -0000	[thread overview]
Message-ID: <177C53C9-4F9A-4C11-A9CC-B8965FFCFA1B@comcast.net> (raw)
In-Reply-To: <557EE17C.5000008@arm.com>

On Jun 15, 2015, at 7:30 AM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
> 
> On 29/05/15 11:15, Kyrill Tkachov wrote:
>> On 29/05/15 10:08, Kyrill Tkachov wrote:
>>> Hi Mike,
>>> 
>>> On 28/05/15 22:15, Mike Stump wrote:
>>>> So, the arm memcpy code of aligned data isn’t as good as it can be.
>>>> 
>>>> void *memcpy(void *dest, const void *src, unsigned int n);
>>>> 
>>>> void foo(char *dst, int i) {
>>>>     memcpy (dst, &i, sizeof (i));
>>>> }
>>>> 
>>>> generates horrible code, but, it we are willing to notice the src or the destination are aligned, we can do much better:
>>>> 
>>>> $ ./cc1 -fschedule-fusion -fdump-tree-all-all -da -march=armv7ve -mcpu=cortex-m4 -fomit-frame-pointer -quiet -O2 /tmp/t.c -o t.s
>>>> $ cat t.s
>>>> [ … ]
>>>> foo:
>>>> 	@ args = 0, pretend = 0, frame = 4
>>>> 	@ frame_needed = 0, uses_anonymous_args = 0
>>>> 	@ link register save eliminated.
>>>> 	sub	sp, sp, #4
>>>> 	str	r1, [r0]	@ unaligned
>>>> 	add	sp, sp, #4
>>> I think there's something to do with cpu tuning here as well.
>> That being said, I do think this is a good idea.
>> I'll give it a test.
> 
> The patch passes bootstrap and testing ok and I've seen it
> improve codegen in a few places in SPEC.
> I've added a testcase all marked up.
> 
> Mike, I'll commit the attached patch in 24 hours unless somebody objects.

Was this ever applied?

  parent reply	other threads:[~2015-08-16 19:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 21:36 Mike Stump
2015-05-29  8:22 ` Oleg Endo
2015-05-29 10:15 ` Kyrill Tkachov
2015-05-29 10:40   ` Kyrill Tkachov
2015-06-15 14:41     ` Kyrill Tkachov
2015-06-15 15:25       ` Richard Earnshaw
2015-08-16 19:24       ` Mike Stump [this message]
2015-08-17 10:01         ` Kyrill Tkachov

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=177C53C9-4F9A-4C11-A9CC-B8965FFCFA1B@comcast.net \
    --to=mikestump@comcast.net \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kyrylo.tkachov@arm.com \
    /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).