Skip to content

Commit a8a6f90

Browse files
Vishwanatha-HDgopherbot
authored andcommitted
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 <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Keith Randall <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Run-TryBot: Keith Randall <[email protected]>
1 parent 93ec881 commit a8a6f90

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/math/tan_s390x.s

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ TEXT ·tanAsm(SB), NOSPLIT, $0-16
4949
FMOVD F0, F2
5050
L2:
5151
MOVD $·tanxlim<>+0(SB), R1
52-
WORD $0xED201000 //cdb %f2,0(%r1)
53-
BYTE $0x00
54-
BYTE $0x19
55-
BGE L11
52+
FMOVD 0(R1), F1
53+
FCMPU F2, F1
54+
BGT L9
5655
BVS L11
5756
MOVD $·tanxadd<>+0(SB), R1
5857
FMOVD 88(R5), F6
@@ -105,6 +104,8 @@ L11:
105104
L10:
106105
WORD $0xB3130020 //lcdbr %f2,%f0
107106
BR L2
107+
L9:
108+
BR ·tan(SB)
108109
atanIsZero:
109110
FMOVD F0, ret+8(FP)
110111
RET

0 commit comments

Comments
 (0)