]> Cypherpunks repositories - gostls13.git/commit
math: improve sqrt for ppc64le,ppc64
authorLynn Boger <laboger@linux.vnet.ibm.com>
Tue, 16 Feb 2016 18:24:12 +0000 (12:24 -0600)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 10 Mar 2016 15:01:21 +0000 (15:01 +0000)
commitb4b2ddb86771753aebd4383847e708cb61e94c73
treed31608c0577446bba57946f08db81a6d0093a353
parent6cb2e1d015b87f4627f40d7b208b58ecb4e102e1
math: improve sqrt for ppc64le,ppc64

The existing implementation uses code written in Go to
implement Sqrt; this adds the assembler to use the sqrt
instruction for Power and makes the necessary changes to
allow it to be inlined.

The following tests showed this relative improvement:

benchmark                 delta
BenchmarkSqrt             -97.91%
BenchmarkSqrtIndirect     -96.65%
BenchmarkSqrtGo           -35.93%
BenchmarkSqrtPrime        -96.94%

Fixes #14349

Change-Id: I8074f4dc63486e756587564ceb320aca300bf5fa
Reviewed-on: https://go-review.googlesource.com/19515
Reviewed-by: Minux Ma <minux@golang.org>
src/cmd/compile/internal/gc/walk.go
src/cmd/compile/internal/ppc64/gsubr.go
src/cmd/compile/internal/ppc64/peep.go
src/cmd/compile/internal/ppc64/prog.go
src/math/sqrt_ppc64x.s [new file with mode: 0644]
src/math/stubs_ppc64x.s