• Lynn Boger's avatar
    runtime: improve memmove performance ppc64,ppc64le · c4807d4c
    Lynn Boger authored
    This change improves the performance of memmove
    on ppc64 & ppc64le mainly for moves >=32 bytes.
    In addition, the test to detect backward moves
     was enhanced to avoid backward moves if source
    and dest were in different types of storage, since
    backward moves might not always be efficient.
    
    Fixes #14507
    
    The following shows some of the improvements from the test
    in the runtime package:
    
    BenchmarkMemmove32                   4229.56      4717.13      1.12x
    BenchmarkMemmove64                   6156.03      7810.42      1.27x
    BenchmarkMemmove128                  7521.69      12468.54     1.66x
    BenchmarkMemmove256                  6729.90      18260.33     2.71x
    BenchmarkMemmove512                  8521.59      18033.81     2.12x
    BenchmarkMemmove1024                 9760.92      25762.61     2.64x
    BenchmarkMemmove2048                 10241.00     29584.94     2.89x
    BenchmarkMemmove4096                 10399.37     31882.31     3.07x
    
    BenchmarkMemmoveUnalignedDst16       1943.69      2258.33      1.16x
    BenchmarkMemmoveUnalignedDst32       3885.08      3965.81      1.02x
    BenchmarkMemmoveUnalignedDst64       5121.63      6965.54      1.36x
    BenchmarkMemmoveUnalignedDst128      7212.34      11372.68     1.58x
    BenchmarkMemmoveUnalignedDst256      6564.52      16913.59     2.58x
    BenchmarkMemmoveUnalignedDst512      8364.35      17782.57     2.13x
    BenchmarkMemmoveUnalignedDst1024     9539.87      24914.72     2.61x
    BenchmarkMemmoveUnalignedDst2048     9199.23      21235.11     2.31x
    BenchmarkMemmoveUnalignedDst4096     10077.39     25231.99     2.50x
    
    BenchmarkMemmoveUnalignedSrc32       3249.83      3742.52      1.15x
    BenchmarkMemmoveUnalignedSrc64       5562.35      6627.96      1.19x
    BenchmarkMemmoveUnalignedSrc128      6023.98      10200.84     1.69x
    BenchmarkMemmoveUnalignedSrc256      6921.83      15258.43     2.20x
    BenchmarkMemmoveUnalignedSrc512      8593.13      16541.97     1.93x
    BenchmarkMemmoveUnalignedSrc1024     9730.95      22927.84     2.36x
    BenchmarkMemmoveUnalignedSrc2048     9793.28      21537.73     2.20x
    BenchmarkMemmoveUnalignedSrc4096     10132.96     26295.06     2.60x
    
    Change-Id: I73af59970d4c97c728deabb9708b31ec7e01bdf2
    Reviewed-on: https://go-review.googlesource.com/21990Reviewed-by: 's avatarBill O'Farrell <billotosyr@gmail.com>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    c4807d4c
memmove_ppc64x.s 2.71 KB