]> Cypherpunks repositories - gostls13.git/commit
runtime: use MOVSB instead of MOVSQ for unaligned moves
authorKeith Randall <khr@golang.org>
Mon, 7 Mar 2016 00:58:30 +0000 (16:58 -0800)
committerKeith Randall <khr@golang.org>
Mon, 21 Mar 2016 19:10:24 +0000 (19:10 +0000)
commit6a33f7765f79cf2f00f5ca55832d2cfab8beb289
treed1cd6a803e32d952e60290c4c863c65bd88db808
parentb07a214d39814545bbcd1d30f1850a95752dac65
runtime: use MOVSB instead of MOVSQ for unaligned moves

MOVSB is quite a bit faster for unaligned moves.
Possibly we should use MOVSB all of the time, but Intel folks
say it might be a bit faster to use MOVSQ on some processors
(but not any I have access to at the moment).

benchmark                              old ns/op     new ns/op     delta
BenchmarkMemmove4096-8                 93.9          93.2          -0.75%
BenchmarkMemmoveUnalignedDst4096-8     256           151           -41.02%
BenchmarkMemmoveUnalignedSrc4096-8     175           90.5          -48.29%

Fixes #14630

Change-Id: I568e6d6590eb3615e6a699fb474020596be665ff
Reviewed-on: https://go-review.googlesource.com/20293
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/memmove_386.s
src/runtime/memmove_amd64.s
src/runtime/memmove_test.go