]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: intrinsify math.Sqrt on 386
authorAlberto Donizetti <alb.donizetti@gmail.com>
Fri, 23 Feb 2018 09:40:12 +0000 (10:40 +0100)
committerAlberto Donizetti <alb.donizetti@gmail.com>
Fri, 23 Feb 2018 13:49:55 +0000 (13:49 +0000)
commit9ee78af806954e90ba8c9947b66742d210200002
tree555adda0951c97abaa586aec34b059dbe83ea5cf
parentf6c67813025305c1dfab61b43e416474ca56a45b
cmd/compile: intrinsify math.Sqrt on 386

It seems like all the pieces were already there, it only needed the
final plumbing.

Before:

0x001b 00027 (test.go:9) MOVSD X0, (SP)
0x0020 00032 (test.go:9) CALL math.Sqrt(SB)
0x0025 00037 (test.go:9) MOVSD 8(SP), X0

After:

0x0018 00024 (test.go:9) SQRTSD X0, X0

name    old time/op  new time/op  delta
Sqrt-4  4.60ns ± 2%  0.45ns ± 1%  -90.33%  (p=0.000 n=10+10)

Change-Id: I0f623958e19e726840140bf9b495d3f3a9184b9d
Reviewed-on: https://go-review.googlesource.com/96615
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/gc/ssa.go