summaryrefslogtreecommitdiff
path: root/src/pkg/math
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-06-30 15:34:22 +0200
committerOndřej Surý <ondrej@sury.org>2011-06-30 15:34:22 +0200
commitd39f5aa373a4422f7a5f3ee764fb0f6b0b719d61 (patch)
tree1833f8b72a4b3a8f00d0d143b079a8fcad01c6ae /src/pkg/math
parent8652e6c371b8905498d3d314491d36c58d5f68d5 (diff)
downloadgolang-upstream/58.tar.gz
Imported Upstream version 58upstream/58
Diffstat (limited to 'src/pkg/math')
-rw-r--r--src/pkg/math/Makefile3
-rw-r--r--src/pkg/math/log.go2
-rw-r--r--src/pkg/math/sqrt_arm.s10
-rw-r--r--src/pkg/math/sqrt_port.go6
4 files changed, 19 insertions, 2 deletions
diff --git a/src/pkg/math/Makefile b/src/pkg/math/Makefile
index 71347b7fa..8e8e74ae4 100644
--- a/src/pkg/math/Makefile
+++ b/src/pkg/math/Makefile
@@ -6,6 +6,9 @@ include ../../Make.inc
TARG=math
+OFILES_arm=\
+ sqrt_arm.$O\
+
OFILES_amd64=\
exp_amd64.$O\
fabs_amd64.$O\
diff --git a/src/pkg/math/log.go b/src/pkg/math/log.go
index 39d94512d..a786c8ce3 100644
--- a/src/pkg/math/log.go
+++ b/src/pkg/math/log.go
@@ -23,7 +23,7 @@ package math
// ====================================================
//
// __ieee754_log(x)
-// Return the logrithm of x
+// Return the logarithm of x
//
// Method :
// 1. Argument Reduction: find k and f such that
diff --git a/src/pkg/math/sqrt_arm.s b/src/pkg/math/sqrt_arm.s
new file mode 100644
index 000000000..befbb8a89
--- /dev/null
+++ b/src/pkg/math/sqrt_arm.s
@@ -0,0 +1,10 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// func Sqrt(x float64) float64
+TEXT ·Sqrt(SB),7,$0
+ MOVD x+0(FP),F0
+ SQRTD F0,F0
+ MOVD F0,r+8(FP)
+ RET
diff --git a/src/pkg/math/sqrt_port.go b/src/pkg/math/sqrt_port.go
index 6f35a383d..148239bcf 100644
--- a/src/pkg/math/sqrt_port.go
+++ b/src/pkg/math/sqrt_port.go
@@ -50,7 +50,7 @@ package math
// If (2) is false, then q = q ; otherwise q = q + 2 .
// i+1 i i+1 i
//
-// With some algebric manipulation, it is not difficult to see
+// With some algebraic manipulation, it is not difficult to see
// that (2) is equivalent to
// -(i+1)
// s + 2 <= y (3)
@@ -141,3 +141,7 @@ func sqrtGo(x float64) float64 {
ix = q>>1 + uint64(exp-1+bias)<<shift // significand + biased exponent
return Float64frombits(ix)
}
+
+func sqrtGoC(f float64, r *float64) {
+ *r = sqrtGo(f)
+}