• Ben Shi's avatar
    cmd/compile: optimize arm64's comparison · 0e9f1de0
    Ben Shi authored
    Add more optimization with TST/CMN.
    
    1. A tiny benchmark shows more than 12% improvement.
    TSTCMN-4                    378µs ± 0%     332µs ± 0%  -12.15%  (p=0.000 n=30+27)
    (https://github.com/benshi001/ugo1/blob/master/tstcmn_test.go)
    
    2. There is little regression in the go1 benchmark, excluding noise.
    
    name                     old time/op    new time/op    delta
    BinaryTree17-4              19.1s ± 0%     19.1s ± 0%    ~     (p=0.994 n=28+29)
    Fannkuch11-4                10.0s ± 0%     10.0s ± 0%    ~     (p=0.198 n=30+25)
    FmtFprintfEmpty-4           233ns ± 0%     233ns ± 0%  +0.14%  (p=0.002 n=24+30)
    FmtFprintfString-4          428ns ± 0%     428ns ± 0%    ~     (all equal)
    FmtFprintfInt-4             472ns ± 0%     472ns ± 0%    ~     (all equal)
    FmtFprintfIntInt-4          725ns ± 0%     725ns ± 0%    ~     (all equal)
    FmtFprintfPrefixedInt-4     889ns ± 0%     888ns ± 0%    ~     (p=0.632 n=28+30)
    FmtFprintfFloat-4          1.20µs ± 0%    1.20µs ± 0%  +0.05%  (p=0.001 n=18+30)
    FmtManyArgs-4              3.00µs ± 0%    2.99µs ± 0%  -0.07%  (p=0.001 n=27+30)
    GobDecode-4                42.1ms ± 0%    42.2ms ± 0%  +0.29%  (p=0.000 n=28+28)
    GobEncode-4                38.6ms ± 9%    38.8ms ± 9%    ~     (p=0.912 n=30+30)
    Gzip-4                      2.07s ± 1%     2.05s ± 1%  -0.64%  (p=0.000 n=29+30)
    Gunzip-4                    175ms ± 0%     175ms ± 0%  -0.15%  (p=0.001 n=30+30)
    HTTPClientServer-4          872µs ± 5%     880µs ± 6%    ~     (p=0.196 n=30+29)
    JSONEncode-4               88.5ms ± 1%    89.8ms ± 1%  +1.49%  (p=0.000 n=23+24)
    JSONDecode-4                393ms ± 1%     390ms ± 1%  -0.89%  (p=0.000 n=28+30)
    Mandelbrot200-4            19.5ms ± 0%    19.5ms ± 0%    ~     (p=0.405 n=29+28)
    GoParse-4                  19.9ms ± 0%    20.0ms ± 0%  +0.27%  (p=0.000 n=30+30)
    RegexpMatchEasy0_32-4       431ns ± 0%     431ns ± 0%    ~     (p=1.000 n=30+30)
    RegexpMatchEasy0_1K-4      1.61µs ± 0%    1.61µs ± 0%    ~     (p=0.527 n=26+26)
    RegexpMatchEasy1_32-4       443ns ± 0%     443ns ± 0%    ~     (all equal)
    RegexpMatchEasy1_1K-4      2.58µs ± 1%    2.58µs ± 1%    ~     (p=0.578 n=27+25)
    RegexpMatchMedium_32-4      740ns ± 0%     740ns ± 0%    ~     (p=0.357 n=30+30)
    RegexpMatchMedium_1K-4      223µs ± 0%     223µs ± 0%  +0.16%  (p=0.000 n=30+29)
    RegexpMatchHard_32-4       12.3µs ± 0%    12.3µs ± 0%    ~     (p=0.236 n=27+27)
    RegexpMatchHard_1K-4        371µs ± 0%     371µs ± 0%  +0.09%  (p=0.000 n=30+27)
    Revcomp-4                   2.85s ± 0%     2.85s ± 0%    ~     (p=0.057 n=28+25)
    Template-4                  408ms ± 1%     409ms ± 1%    ~     (p=0.117 n=29+29)
    TimeParse-4                1.93µs ± 0%    1.93µs ± 0%    ~     (p=0.535 n=29+28)
    TimeFormat-4               1.99µs ± 0%    1.99µs ± 0%    ~     (p=0.168 n=29+28)
    [Geo mean]                  306µs          307µs       +0.07%
    
    name                     old speed      new speed      delta
    GobDecode-4              18.3MB/s ± 0%  18.2MB/s ± 0%  -0.31%  (p=0.000 n=28+29)
    GobEncode-4              19.9MB/s ± 8%  19.8MB/s ± 9%    ~     (p=0.923 n=30+30)
    Gzip-4                   9.39MB/s ± 1%  9.45MB/s ± 1%  +0.65%  (p=0.000 n=29+30)
    Gunzip-4                  111MB/s ± 0%   111MB/s ± 0%  +0.15%  (p=0.001 n=30+30)
    JSONEncode-4             21.9MB/s ± 1%  21.6MB/s ± 1%  -1.45%  (p=0.000 n=23+23)
    JSONDecode-4             4.94MB/s ± 1%  4.98MB/s ± 1%  +0.84%  (p=0.000 n=27+30)
    GoParse-4                2.91MB/s ± 0%  2.90MB/s ± 0%  -0.34%  (p=0.000 n=21+22)
    RegexpMatchEasy0_32-4    74.1MB/s ± 0%  74.1MB/s ± 0%    ~     (p=0.469 n=29+28)
    RegexpMatchEasy0_1K-4     634MB/s ± 0%   634MB/s ± 0%    ~     (p=0.978 n=24+28)
    RegexpMatchEasy1_32-4    72.2MB/s ± 0%  72.2MB/s ± 0%    ~     (p=0.064 n=27+29)
    RegexpMatchEasy1_1K-4     396MB/s ± 1%   396MB/s ± 1%    ~     (p=0.583 n=27+25)
    RegexpMatchMedium_32-4   1.35MB/s ± 0%  1.35MB/s ± 0%    ~     (all equal)
    RegexpMatchMedium_1K-4   4.60MB/s ± 0%  4.59MB/s ± 0%  -0.14%  (p=0.000 n=30+26)
    RegexpMatchHard_32-4     2.61MB/s ± 0%  2.61MB/s ± 0%    ~     (all equal)
    RegexpMatchHard_1K-4     2.76MB/s ± 0%  2.76MB/s ± 0%    ~     (all equal)
    Revcomp-4                89.1MB/s ± 0%  89.1MB/s ± 0%    ~     (p=0.059 n=28+25)
    Template-4               4.75MB/s ± 1%  4.75MB/s ± 1%    ~     (p=0.106 n=29+29)
    [Geo mean]               18.3MB/s       18.3MB/s       -0.07%
    
    Change-Id: I3cd76ce63e84b0c3cebabf9fa3573b76a7343899
    Reviewed-on: https://go-review.googlesource.com/124935
    Run-TryBot: Ben Shi <powerman1st@163.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
    0e9f1de0
Name
Last commit
Last update
..
gen Loading commit data...
testdata Loading commit data...
README.md Loading commit data...
TODO Loading commit data...
biasedsparsemap.go Loading commit data...
block.go Loading commit data...
branchelim.go Loading commit data...
branchelim_test.go Loading commit data...
cache.go Loading commit data...
check.go Loading commit data...
checkbce.go Loading commit data...
compile.go Loading commit data...
config.go Loading commit data...
copyelim.go Loading commit data...
copyelim_test.go Loading commit data...
critical.go Loading commit data...
cse.go Loading commit data...
cse_test.go Loading commit data...
deadcode.go Loading commit data...
deadcode_test.go Loading commit data...
deadstore.go Loading commit data...
deadstore_test.go Loading commit data...
debug.go Loading commit data...
debug_test.go Loading commit data...
decompose.go Loading commit data...
dom.go Loading commit data...
dom_test.go Loading commit data...
export_test.go Loading commit data...
flagalloc.go Loading commit data...
func.go Loading commit data...
func_test.go Loading commit data...
fuse.go Loading commit data...
fuse_test.go Loading commit data...
html.go Loading commit data...
id.go Loading commit data...
layout.go Loading commit data...
lca.go Loading commit data...
lca_test.go Loading commit data...
likelyadjust.go Loading commit data...
location.go Loading commit data...
loop_test.go Loading commit data...
loopbce.go Loading commit data...
loopreschedchecks.go Loading commit data...
looprotate.go Loading commit data...
lower.go Loading commit data...
magic.go Loading commit data...
magic_test.go Loading commit data...
nilcheck.go Loading commit data...
nilcheck_test.go Loading commit data...
numberlines.go Loading commit data...
op.go Loading commit data...
opGen.go Loading commit data...
opt.go Loading commit data...
passbm_test.go Loading commit data...
phielim.go Loading commit data...
phiopt.go Loading commit data...
poset.go Loading commit data...
poset_test.go Loading commit data...
print.go Loading commit data...
prove.go Loading commit data...
redblack32.go Loading commit data...
redblack32_test.go Loading commit data...
regalloc.go Loading commit data...
regalloc_test.go Loading commit data...
rewrite.go Loading commit data...
rewrite386.go Loading commit data...
rewriteAMD64.go Loading commit data...
rewriteARM.go Loading commit data...
rewriteARM64.go Loading commit data...
rewriteMIPS.go Loading commit data...
rewriteMIPS64.go Loading commit data...
rewritePPC64.go Loading commit data...
rewriteS390X.go Loading commit data...
rewriteWasm.go Loading commit data...
rewrite_test.go Loading commit data...
rewritedec.go Loading commit data...
rewritedec64.go Loading commit data...
rewritegeneric.go Loading commit data...
schedule.go Loading commit data...
schedule_test.go Loading commit data...
shift_test.go Loading commit data...
shortcircuit.go Loading commit data...
shortcircuit_test.go Loading commit data...
sizeof_test.go Loading commit data...
softfloat.go Loading commit data...
sparsemap.go Loading commit data...
sparseset.go Loading commit data...
sparsetree.go Loading commit data...
sparsetreemap.go Loading commit data...
stackalloc.go Loading commit data...
stackframe.go Loading commit data...
stmtlines_test.go Loading commit data...
tighten.go Loading commit data...
trim.go Loading commit data...
value.go Loading commit data...
writebarrier.go Loading commit data...
writebarrier_test.go Loading commit data...
zcse.go Loading commit data...
zeroextension_test.go Loading commit data...