]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: intrinsify math/bits.Add on amd64
authorKeith Randall <khr@google.com>
Tue, 23 Oct 2018 21:05:38 +0000 (14:05 -0700)
committerKeith Randall <khr@golang.org>
Thu, 25 Oct 2018 19:47:00 +0000 (19:47 +0000)
commit899f3a2892b0a6e06a2e5f54c0a196d15944b99e
treeb7111d4b4af1564c5ec64267569a4a7584ef4137
parentf6b554fec75ff1a36c6204755db8c1f638255b64
cmd/compile: intrinsify math/bits.Add on amd64

name             old time/op  new time/op  delta
Add-8            1.11ns ± 0%  1.18ns ± 0%   +6.31%  (p=0.029 n=4+4)
Add32-8          1.02ns ± 0%  1.02ns ± 1%     ~     (p=0.333 n=4+5)
Add64-8          1.11ns ± 1%  1.17ns ± 0%   +5.79%  (p=0.008 n=5+5)
Add64multiple-8  4.35ns ± 1%  0.86ns ± 0%  -80.22%  (p=0.000 n=5+4)

The individual ops are a bit slower (but still very fast).
Using the ops in carry chains is very fast.

Update #28273

Change-Id: Id975f76df2b930abf0e412911d327b6c5b1befe5
Reviewed-on: https://go-review.googlesource.com/c/144257
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/amd64/ssa.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/gen/genericOps.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/compile/internal/ssa/schedule.go
src/math/bits/bits_test.go
test/codegen/mathbits.go