Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 31 Jul 2013 05:13:47 +0200
From: Harald Becker <ralda@....de>
Cc: musl@...ts.openwall.com, dalias@...ifal.cx
Subject: Re: ARM memcpy post-0.9.12-release thread

Hi Rich !

30-07-2013 22:26 Rich Felker <dalias@...ifal.cx>:

> Some rough times (128k copy repeated 10000 times):
> 
> Aligned case:
> Current C code: 1.2s
> My best-attempt C code: 0.75s
> My best-attempt inline asm: 0.57s
> Bionic asm: 0.63s
> Bionic asm without prefetch: 0.57s
> 
> Misaligned case:
> Current C code: 4.7s
> My best-attempt inline asm: 2.9s
> Bionic asm: 1.1s

I like to throw in a question, as my cent to this topic:

Does modern C Compiler not try to align all data types? So
following this path in most cases aligned data structures are
used and copying them around usually hit the aligned case. The
misaligned case happens mostly due to working with strings, and
those are usually short. Can't we consider other misaligned cases
violation of the programmer or code generator? If so, I would
prefer the best-attempt inline asm versions of code or even
best attempt C code over arch specific asm versions ... and add
a warning for performance lose on misaligned data in
documentation, with giving a rough percentage of this lose.

Those who really need to work with misaligned data may follow
the link and consider to add an optimized memcpy to there work.

May be, musl archive or web sit may hold a contribution directory
with such optimized replacement functions, (nearly) ready for
inclusion in other projects, but as officially unmaintained code.

--
Harald

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.