Skip to content

Commit 731b3ed

Browse files
committed
math: make sqrt smaller on AMD64
This makes function fit in 16 bytes, saving 16 bytes. Change-Id: Iac5d2add42f6dae985b2a5cbe19ad4bd4bcc92ec Reviewed-on: https://go-review.googlesource.com/29151 Run-TryBot: Ilya Tocar <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Keith Randall <[email protected]>
1 parent fedb0b3 commit 731b3ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/math/sqrt_amd64.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
// func Sqrt(x float64) float64
88
TEXT ·Sqrt(SB), NOSPLIT, $0
9-
MOVSD x+0(FP), X0
10-
SQRTSD X0, X1
11-
MOVSD X1, ret+8(FP)
9+
XORPS X0, X0 // break dependency
10+
SQRTSD x+0(FP), X0
11+
MOVSD X0, ret+8(FP)
1212
RET

0 commit comments

Comments
 (0)