]> Cypherpunks repositories - gostls13.git/commit
runtime: improve equal on ppc64x/power10
authorArchana R <aravind5@in.ibm.com>
Mon, 6 Mar 2023 09:17:47 +0000 (03:17 -0600)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Thu, 16 Mar 2023 17:29:04 +0000 (17:29 +0000)
commit8377f2014d868f60065b9244c4a84cf78c80f415
tree42b4ba437a1e1fdc2b384ae545658ae6e4efbe6d
parentb4ac4b4b42bd2b8014cba57991d43f09eb6292f6
runtime: improve equal on ppc64x/power10

Rewrite equal asm function to use the new power10 instruction lxvl
and stxvl- load and store with variable length which can simplify
the tail end bytes comparison process. Cleaned up code on CR
register usage.

On power9 and power8 the code remains unchanged. The performance
for multiple sizes<=16 improve on power10 with the change.

name      old time/op    new time/op    delta
Equal/1     5.28ns ± 0%    4.19ns ± 9%  -20.80%
Equal/2     5.30ns ± 0%    4.29ns ± 6%  -19.06%
Equal/3     5.10ns ± 5%    4.20ns ± 6%  -17.73%
Equal/4     5.05ns ± 0%    4.42ns ± 4%  -12.50%
Equal/5     5.27ns ± 1%    4.44ns ± 4%  -15.69%
Equal/6     5.30ns ± 0%    4.38ns ±12%  -17.44%
Equal/7     5.02ns ± 6%    4.48ns ± 2%  -10.64%
Equal/9     4.53ns ± 0%    4.34ns ± 7%   -4.21%
Equal/16    4.52ns ± 0%    4.29ns ± 6%   -5.16%

Change-Id: Ie124906e3a5012dfe634bfe09af06be42f1b178b
Reviewed-on: https://go-review.googlesource.com/c/go/+/473536
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Paul Murphy <murp@ibm.com>
src/internal/bytealg/equal_ppc64x.s