diff options
-rw-r--r-- | src/math/sincos_amd64.s | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/math/sincos_amd64.s b/src/math/sincos_amd64.s index dae636b24..59bf55f58 100644 --- a/src/math/sincos_amd64.s +++ b/src/math/sincos_amd64.s @@ -15,9 +15,7 @@ // The README file says, "The software is in public domain. // You can use the software without any obligation." // -// This code is a simplified version of the original. The CMPSD -// instruction, not generated by the compiler, eliminates jumps in the -// body of the calculation. +// This code is a simplified version of the original. #define PosOne 0x3FF0000000000000 #define PosInf 0x7FF0000000000000 @@ -96,11 +94,10 @@ TEXT ·Sincos(SB),NOSPLIT,$0 // if ((q + 1) & 2) != 0 { sin, cos = cos, sin } MOVQ $1, DX ADDQ BX, DX - MOVQ $2, AX - ANDQ AX, DX - MOVQ DX, X0 - MOVSD $0.0, X3 - CMPSD X0, X3, 0 // cmpeq; x1= x, x2= z, x3 = y, x7= d, bx= q + ANDQ $2, DX + SHRQ $1, DX + SUBQ $1, DX + MOVQ DX, X3 // sin = (y & z) | (^y & x) MOVAPD X2, X0 ANDPD X3, X0 // x0= sin |