]> Cypherpunks repositories - gostls13.git/commitdiff
math: make sqrt smaller on AMD64
authorIlya Tocar <ilya.tocar@intel.com>
Wed, 14 Sep 2016 12:23:41 +0000 (15:23 +0300)
committerIlya Tocar <ilya.tocar@intel.com>
Thu, 29 Sep 2016 15:56:52 +0000 (15:56 +0000)
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 <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/math/sqrt_amd64.s

index d72000fccbfa3f37593ead3b9d54c31ef26e15f1..1102903055c19801d48fd3dd45dfbd123ca006e6 100644 (file)
@@ -6,7 +6,7 @@
 
 // func Sqrt(x float64) float64
 TEXT ·Sqrt(SB), NOSPLIT, $0
-       MOVSD  x+0(FP), X0
-       SQRTSD X0, X1
-       MOVSD  X1, ret+8(FP)
+       XORPS  X0, X0 // break dependency
+       SQRTSD x+0(FP), X0
+       MOVSD  X0, ret+8(FP)
        RET