]> Cypherpunks repositories - gostls13.git/commit
math: optimize Ceil, Floor and Trunc on s390x
authorMichael Munday <munday@ca.ibm.com>
Fri, 26 Aug 2016 15:39:47 +0000 (11:39 -0400)
committerMichael Munday <munday@ca.ibm.com>
Fri, 26 Aug 2016 17:27:13 +0000 (17:27 +0000)
commit9f7ea616742f8d58ecc140afcb0fa53bcb84fe9b
treef9392e941446d4fed75eb4dbf25a601f5bbc9813
parentd2dd0dfda813deb27415962656e7a6496170cef3
math: optimize Ceil, Floor and Trunc on s390x

Use the FIDBR instruction to round floating-point numbers to integers.

name   old time/op  new time/op  delta
Ceil   14.1ns ± 0%   3.0ns ± 0%  -78.89%  (p=0.000 n=10+10)
Floor  6.42ns ± 0%  3.03ns ± 0%  -52.80%  (p=0.000 n=10+10)
Trunc  6.67ns ± 0%  3.03ns ± 0%  -54.57%   (p=0.000 n=10+9)

Change-Id: I3b416f6d0bccaaa9b547de86356471365862399c
Reviewed-on: https://go-review.googlesource.com/27827
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/math/floor_s390x.s [new file with mode: 0644]
src/math/stubs_s390x.s