mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Natanael Copa <ncopa@alpinelinux.org>
To: Andre McCurdy <armccurdy@gmail.com>
Cc: musl@lists.openwall.com
Subject: Re: [musl] [PATCH 2/2] Add big-endian support to ARM assembler memcpy
Date: Thu, 16 Jan 2020 16:21:20 +0100	[thread overview]
Message-ID: <20200116162120.5c1a90ba@ncopa-desktop.copa.dup.pw> (raw)
In-Reply-To: <CAJ86T=Wtvj3E9vGuxHGHmAoJU-0kSUqvL_hntt0zN2a8NT8sLw@mail.gmail.com>

On Wed, 15 Jan 2020 10:41:08 -0800
Andre McCurdy <armccurdy@gmail.com> wrote:

> On Wed, Jan 15, 2020 at 7:46 AM Rich Felker <dalias@libc.org> wrote:
> > On Fri, Sep 13, 2019 at 01:38:34PM -0700, Andre McCurdy wrote:  
> > > On Fri, Sep 13, 2019 at 11:59 AM Rich Felker <dalias@libc.org> wrote:  
> > > > On Fri, Sep 13, 2019 at 11:44:32AM -0700, Andre McCurdy wrote:  
> > > > > Allow the existing ARM assembler memcpy implementation to be used for
> > > > > both big and little endian targets.  
> > > >
> > > > Nice. I don't want to merge this just before release, but as long as
> > > > it looks ok I should be able to review and merge it afterward.
> > > >
> > > > Note that I'd really like to replace this giant file with C using
> > > > inline asm just for the inner block copies and C for all the flow
> > > > control, but I don't mind merging this first as long as it's correct.  
> > >
> > > Sounds good. I'll wait for your feedback after the upcoming release.  
> >
> > Sorry this dropped off my radar. I'd like to merge at least the thumb
> > part since it's simple enough to review quickly and users have
> > actually complained about memcpy being slow on armv7 with -mthumb as
> > default.  
> 
> Interesting. I wonder what the reference was against which the musl C
> code was compared? From my own benchmarking I didn't find the musl
> assembler to be much faster than the C code. There are armv6 and maybe
> early armv7 CPUs where explicit prefetch instructions make a huge
> difference (much more so than C -vs- assembler). Did the users who
> complained about musl memcpy() compare against a memcpy() which uses
> prefetch? For armv7 using NEON may help, although the latest armv7
> cores seem to perform very well with plain old C code too. There are
> lots of trade offs so it's impossible for a single implementation to
> be universally optimal. The "arm-mem" routines used on Raspberry Pi
> seem to be a very fast for many targets, but unfortunately the armv6
> memcpy generates mis-aligned accesses so isn't suitable for armv5.
> 
>   https://github.com/bavison/arm-mem/

The Alpine user reported it here:
https://gitlab.alpinelinux.org/alpine/aports/issues/11128

I don't know if you got the __builtin_memcpy or the libc version. I do
know that qemu once got surprised that `memcpy` used libc's non-atomic
version instead of gcc's atomic __builtin_memcpy. This happened due to
alpine users fortify-headers as FORTIFY_SOURCE implementation.

Not sure if something similar happened here.

-nc

  parent reply	other threads:[~2020-01-16 15:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-13 18:44 [PATCH 1/2] Add Thumb2 " Andre McCurdy
2019-09-13 18:44 ` [PATCH 2/2] Add big-endian " Andre McCurdy
2019-09-13 18:59   ` Rich Felker
2019-09-13 20:38     ` Andre McCurdy
2020-01-15 15:45       ` [musl] " Rich Felker
2020-01-15 18:41         ` Andre McCurdy
2020-01-15 19:22           ` Rich Felker
2020-01-15 20:54             ` Andre McCurdy
2020-01-16 15:21           ` Natanael Copa [this message]
2020-01-15 16:35 ` [musl] [PATCH 1/2] Add Thumb2 " Rich Felker
2020-01-15 18:49   ` Andre McCurdy
2020-01-15 19:24     ` Rich Felker
2020-01-15 20:20       ` Andre McCurdy
2020-01-15 20:38         ` Rich Felker

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=20200116162120.5c1a90ba@ncopa-desktop.copa.dup.pw \
    --to=ncopa@alpinelinux.org \
    --cc=armccurdy@gmail.com \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).