public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@gotplt.org>
To: Wilco Dijkstra <Wilco.Dijkstra@arm.com>,
	Andrew Pinski <pinskia@gmail.com>
Cc: Szabolcs Nagy <Szabolcs.Nagy@arm.com>,
	"Ellcey, Steve" <Steve.Ellcey@cavium.com>,
	libc-alpha <libc-alpha@sourceware.org>, nd <nd@arm.com>
Subject: Re: Ping: [Patch] aarch64: Thunderx specific memcpy and memmove
Date: Thu, 25 May 2017 19:26:00 -0000	[thread overview]
Message-ID: <135198a3-ad77-5117-9c13-b4456268e74a@gotplt.org> (raw)
In-Reply-To: <AM5PR0802MB26104227EC9F325E95C80D0883FF0@AM5PR0802MB2610.eurprd08.prod.outlook.com>

On Thursday 25 May 2017 11:19 PM, Wilco Dijkstra wrote:
> Given the number of micro architectures already existing, it would be a really
> bad situation to end up with one memcpy per micro architecture...

It's not just per micro-architecture...

> Micro architectures will tend to converge rather than diverge as performance
> level increases. So I believe it's generally best to use the same instructions for
> memcpy as for compiled code as that is what CPUs will actually encounter
> and optimize for. For the rare, very large copies we could do something different
> if it helps (eg. prefetch, non-temporals, SIMD registers etc).

... because as you say, micro-architectures may well converge over time
to some extent, but you will still end up having multiple memcpy
implementation taking advantage of different features in aarch64
architecture over time.  For example, SVE routines vs non-SVE routines.
You'll need both and looking at how x86 has evolved, there will be much
more to come.

> An ifunc has a measurable overhead unfortunately, and that would no longer
> be trivially avoidable via static linking. Most calls to memcpy tend to be very
> small copies. Maybe we should investigate statically linking the small copy part
> of memcpy with say -O3?

Sure, that might be something to look at as a data point, but again
getting rid of multiarch is not the option for desktop/server
implementations, especially if micro-architecture specific routines give
measurable gains over generic implementations in the general case, i.e.
dynamically linked programs that need to run out of the box and
optimally on multiple types of hardware.  Static binaries unfortunately
become the edge case here.

Siddhesh

  reply	other threads:[~2017-05-25 19:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-01 18:27 Steve Ellcey
2017-05-01 21:20 ` Wainer dos Santos Moschetta
2017-05-03 14:01 ` Szabolcs Nagy
2017-05-09  3:17   ` Siddhesh Poyarekar
2017-05-09 21:45     ` Steve Ellcey
2017-05-18 21:48       ` Steve Ellcey
2017-05-19  7:41       ` Siddhesh Poyarekar
     [not found]         ` <DM5PR07MB34662F805C1EDE45882B82F6F5F90@DM5PR07MB3466.namprd07.prod.outlook.com>
2017-05-24 17:04           ` Szabolcs Nagy
2017-05-25  6:42             ` Siddhesh Poyarekar
2017-05-25 16:28               ` Andrew Pinski
2017-05-25 16:43                 ` Ramana Radhakrishnan
2017-05-25 17:49                 ` Wilco Dijkstra
2017-05-25 19:26                   ` Siddhesh Poyarekar [this message]
2017-05-25 21:04                     ` Ramana Radhakrishnan
2017-05-25 21:12                       ` Florian Weimer
2017-05-26  5:42                         ` Siddhesh Poyarekar
2017-05-26  5:34                       ` Siddhesh Poyarekar
2017-05-26  5:38                         ` Andrew Pinski
2017-05-25 16:22             ` Steve Ellcey

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=135198a3-ad77-5117-9c13-b4456268e74a@gotplt.org \
    --to=siddhesh@gotplt.org \
    --cc=Steve.Ellcey@cavium.com \
    --cc=Szabolcs.Nagy@arm.com \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=libc-alpha@sourceware.org \
    --cc=nd@arm.com \
    --cc=pinskia@gmail.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).