]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: intrinsify math.{Trunc/Ceil/Floor} on amd64
authorIlya Tocar <ilya.tocar@intel.com>
Thu, 5 Oct 2017 20:45:46 +0000 (15:45 -0500)
committerIlya Tocar <ilya.tocar@intel.com>
Tue, 31 Oct 2017 19:30:54 +0000 (19:30 +0000)
commit94484d8ed5155873306ab41f49b0b30be19031a9
treedf33fd2c192b105944a1ef594bfc2f808cac5750
parent8684534321b0ebbc7ee0c5bf3bc3a3c19a196621
cmd/compile: intrinsify math.{Trunc/Ceil/Floor} on amd64

This significantly speed-ups Trunc.
Ceil/Floor are using the same instruction, so do them too.

name     old time/op  new time/op  delta
Floor-6  3.33ns ± 1%  3.22ns ± 0%   -3.39%  (p=0.000 n=10+10)
Ceil-6   3.33ns ± 1%  3.22ns ± 0%   -3.16%  (p=0.000 n=10+7)
Trunc-6  4.83ns ± 0%  3.22ns ± 0%  -33.36%  (p=0.000 n=6+8)

Change-Id: If848790e458eedfe38a6a0407bb4f589c68ac254
Reviewed-on: https://go-review.googlesource.com/68630
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/amd64/ssa.go
src/cmd/compile/internal/gc/builtin.go
src/cmd/compile/internal/gc/builtin/runtime.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/opGen.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/math/floor_amd64.s