linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: Mark Nelson <markn@au1.ibm.com>,
	"linuxppc-dev@ozlabs.org list" <linuxppc-dev@ozlabs.org>
Subject: Re: misaligned load/store in ppc32 memcpy
Date: Thu, 2 Jul 2009 13:40:33 +1000	[thread overview]
Message-ID: <19020.11313.853279.666065@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <6ABDC992-9D67-4C9C-A3A7-59F408FC9E50@kernel.crashing.org>

Kumar Gala writes:

>    Ben pointed me to you regarding my question if we should be expecting
>    misaligned load/store operations in the ppc32 mempcy that exists in
>    copy_32.S.
>    (To be more specific, I'm seeing this behavior and wondering if we
>    really should have memcpy avoid doing word size ld/st if the addresses
>    aren't also aligned)

We align the destination to a word boundary using byte-by-byte copies,
then copy words using word loads and stores.  The loads may be
misaligned, but they are still faster than doing aligned loads and
shuffling the bits around - or at least they were when measured the
speed 10 years or so ago, which would have been on 750 or 74xx cpus.

If the penalty for unaligned loads on Freescale embedded cores is high
enough that it's faster to shuffle the bits or to copy byte-by-byte
then we can have an alternative version for them.

Paul.

      parent reply	other threads:[~2009-07-02  3:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-30 21:56 misaligned load/store in ppc32 memcpy Kumar Gala
2009-07-02  1:32 ` Mark Nelson
2009-07-02  3:40 ` Paul Mackerras [this message]

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=19020.11313.853279.666065@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=galak@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=markn@au1.ibm.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 NNTP newsgroup(s).