[ccache] [PATCH] Speed up "copy4", "copy64" on little-endian systems.

Andrew Stubbs ams at codesourcery.com
Wed Nov 21 10:46:05 MST 2012


The copy64 function implements an endian-safe copy routine for
an array of 16 32-bit integers, but this is sub-optimal on machines
where the byte-order is already correct. Likewise for copy4.

This patch replaces the implementation with a simple memcpy when
appropriate, and retains the old implementation otherwise.

Note that the compiler will always inline calls to memcpy for small
byte-counts, so this is a big win.

Signed-off-by: Andrew Stubbs <ams at codesourcery.com>
---
  configure.ac |    2 ++
  mdfour.c     |    8 ++++++++
  2 files changed, 10 insertions(+)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Speed-up-copy4-copy64-on-little-endian-systems.patch
Type: text/x-patch
Size: 836 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/ccache/attachments/20121121/239c87cc/attachment.bin>


More information about the ccache mailing list