From ebb67d993a55f8084f8175a326b481ff1725ea4a Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Seo Date: Fri, 2 Mar 2018 16:47:54 -0300 Subject: 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 TryBot-Result: Gobot Gobot Reviewed-by: Lynn Boger --- test/codegen/math.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/codegen') 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" -- cgit v1.3-5-g9baa