aboutsummaryrefslogtreecommitdiff
path: root/src/math
diff options
context:
space:
mode:
authorroot <vishwanatha.hd@ibm.com>2023-02-23 06:44:23 +0000
committerGopher Robot <gobot@golang.org>2023-07-27 23:30:00 +0000
commita8a6f90a237a19b32bd82dc4c314859e24f8cd95 (patch)
tree3bec5c6818c3891ed1b8c4ac9883e14aab713543 /src/math
parent93ec88160ecd6da1d2bf5b9c029abf0e256484e9 (diff)
downloadgo-a8a6f90a237a19b32bd82dc4c314859e24f8cd95.tar.xz
math: support to handle huge arguments in tan function on s390x
Currently on s390x, tan assembly implementation is not handling huge arguments at all. This change is to check for large arguments and revert back to native go implantation from assembly code in case of huge arguments. The changes are implemented in assembly code to get better performance over native go implementation. Benchmark details of tan function with table driven inputs are updated as part of the issue link. Fixes #37854 Change-Id: I4e5321e65c27b7ce8c497fc9d3991ca8604753d2 Reviewed-on: https://go-review.googlesource.com/c/go/+/470595 Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/math')
-rw-r--r--src/math/tan_s390x.s9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/math/tan_s390x.s b/src/math/tan_s390x.s
index 82267608b9..6a4c449b0d 100644
--- a/src/math/tan_s390x.s
+++ b/src/math/tan_s390x.s
@@ -49,10 +49,9 @@ TEXT ·tanAsm(SB), NOSPLIT, $0-16
FMOVD F0, F2
L2:
MOVD $·tanxlim<>+0(SB), R1
- WORD $0xED201000 //cdb %f2,0(%r1)
- BYTE $0x00
- BYTE $0x19
- BGE L11
+ FMOVD 0(R1), F1
+ FCMPU F2, F1
+ BGT L9
BVS L11
MOVD $·tanxadd<>+0(SB), R1
FMOVD 88(R5), F6
@@ -105,6 +104,8 @@ L11:
L10:
WORD $0xB3130020 //lcdbr %f2,%f0
BR L2
+L9:
+ BR ·tan(SB)
atanIsZero:
FMOVD F0, ret+8(FP)
RET