]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
amd64: depessimize bcmp for small buffers
authormjg <mjg@FreeBSD.org>
Wed, 9 May 2018 15:16:25 +0000 (15:16 +0000)
committermjg <mjg@FreeBSD.org>
Wed, 9 May 2018 15:16:25 +0000 (15:16 +0000)
commitc6c875dd412db3ea9f5daa9d3af20059c3471bea
tree22cb252d629f8a5bb88df2d2d72cd990efd24221
parent4895cdf08943fe10212e91027d7d198711716c38
amd64: depessimize bcmp for small buffers

Adapt assembly generated by clang for memcmp and use it for <= 64 sized
compares (which are the vast majority).

Sample result of doing stats on Broadwell (% of samples):
before: 4.0 kernel     bcmp                 cache_lookup
after : 0.7 kernel     bcmp                 cache_lookup

The routine is most definitely still not optimal. Anyone interested in
spending time improving it is welcome to take over.

Reviewed by: kib
sys/amd64/amd64/support.S