Files
OpenCellular/common
Daisuke Nojiri d3facbd92f Optimize memcpy
This speeds up memcpy by copying a word at a time if source and destination are
aligned in mod 4. That is, if n and m are a positive integer:

  4n -> 4m: aligned, 4x speed.
  4n -> 4m+1: misaligned.
  4n+1 -> 4m+1: aligned in mod 4, 4x speed.

Ran the unit test on Peppy:

  > runtest
  ...
  Running test_memcpy... (speed gain: 120300 -> 38103 us) OK
  ...

Ran make buildall -j:

  ...
  Running test_memcpy... (speed gain: 2084 -> 549 us) OK
  ...

Note misaligned case is also optimized. Unit test runs in 298 us on Peppy while
it takes about 475 with the original memcpy.

TEST=Described above.
BUG=chrome-os-partner:23720
BRANCH=none
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: Ic12260451c5efd0896d6353017cd45d29cb672db
Tested-by: Daisuke Nojiri <dnojiri@google.com>
Reviewed-on: https://chromium-review.googlesource.com/185618
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Daisuke Nojiri <dnojiri@google.com>
2014-02-12 19:40:52 +00:00
..
2014-02-08 00:14:48 +00:00
2013-12-20 05:07:58 +00:00
2013-10-25 20:12:49 +00:00
2013-12-10 04:40:39 +00:00
2013-12-10 02:13:52 +00:00
2013-12-19 00:12:28 +00:00
2013-12-17 21:27:53 +00:00
2013-10-30 23:10:13 +00:00
2014-01-14 09:19:45 +00:00
2013-12-19 00:12:28 +00:00
2013-09-10 23:46:07 +00:00
2013-12-05 22:30:58 +00:00
2012-10-26 09:49:38 -07:00
2013-12-19 00:12:28 +00:00
2013-06-10 01:48:44 -07:00
2013-12-19 00:12:28 +00:00
2013-11-01 20:07:24 +00:00
2014-02-12 19:40:52 +00:00