From 731b3ed18dcb854912cb06b3486bb633917e4cb7 Mon Sep 17 00:00:00 2001 From: Ilya Tocar Date: Wed, 14 Sep 2016 15:23:41 +0300 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/math/sqrt_amd64.s | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/math/sqrt_amd64.s b/src/math/sqrt_amd64.s index d72000fccb..1102903055 100644 --- a/src/math/sqrt_amd64.s +++ b/src/math/sqrt_amd64.s @@ -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