diff options
| author | Carlos Eduardo Seo <cseo@linux.vnet.ibm.com> | 2018-03-02 16:47:54 -0300 |
|---|---|---|
| committer | Lynn Boger <laboger@linux.vnet.ibm.com> | 2018-04-26 14:12:09 +0000 |
| commit | ebb67d993a55f8084f8175a326b481ff1725ea4a (patch) | |
| tree | e91f91bcb38a9bcf836f173f4c7901cb331d21fd /test/codegen/math.go | |
| parent | 736390c2bd2d7f00d62ca62f18836f82eb1f51a3 (diff) | |
| download | go-ebb67d993a55f8084f8175a326b481ff1725ea4a.tar.xz | |
cmd/compile, cmd/internal/obj/ppc64: make math.Round an intrinsic on ppc64x
This change implements math.Round as an intrinsic on ppc64x so it can be
done using a single instruction.
benchmark old ns/op new ns/op delta
BenchmarkRound-16 2.60 0.69 -73.46%
Change-Id: I9408363e96201abdfc73ced7bcd5f0c29db006a8
Reviewed-on: https://go-review.googlesource.com/109395
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Diffstat (limited to 'test/codegen/math.go')
| -rw-r--r-- | test/codegen/math.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/codegen/math.go b/test/codegen/math.go index efa3a2bc8f..f73321200b 100644 --- a/test/codegen/math.go +++ b/test/codegen/math.go @@ -13,18 +13,22 @@ var sink64 [8]float64 func approx(x float64) { // s390x:"FIDBR\t[$]6" // arm64:"FRINTPD" + // ppc64le:"FRIP" sink64[0] = math.Ceil(x) // s390x:"FIDBR\t[$]7" // arm64:"FRINTMD" + // ppc64le:"FRIM" sink64[1] = math.Floor(x) // s390x:"FIDBR\t[$]1" // arm64:"FRINTAD" + // ppc64le:"FRIN" sink64[2] = math.Round(x) // s390x:"FIDBR\t[$]5" // arm64:"FRINTZD" + // ppc64le:"FRIZ" sink64[3] = math.Trunc(x) // s390x:"FIDBR\t[$]4" |
