diff options
author | Russ Cox <rsc@golang.org> | 2009-09-24 14:27:52 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-09-24 14:27:52 -0700 |
commit | ec551bf8ac64f4e83c1362fe40f950fe6961d047 (patch) | |
tree | 1f920b43a5f9d7e3954b173e737eefb60d71acb5 /src/pkg/math | |
parent | f2f970d8e42dcb973cd1926d2a5c1bb39be53d57 (diff) | |
download | golang-ec551bf8ac64f4e83c1362fe40f950fe6961d047.tar.gz |
install assembly math.Sqrt on amd64
R=r
DELTA=33 (32 added, 0 deleted, 1 changed)
OCL=34983
CL=34986
Diffstat (limited to 'src/pkg/math')
-rw-r--r-- | src/pkg/math/Makefile | 16 | ||||
-rw-r--r-- | src/pkg/math/sqrt_amd64.s | 10 | ||||
-rw-r--r-- | src/pkg/math/sqrt_decl.go | 8 |
3 files changed, 33 insertions, 1 deletions
diff --git a/src/pkg/math/Makefile b/src/pkg/math/Makefile index f062a7468..bf8d99a60 100644 --- a/src/pkg/math/Makefile +++ b/src/pkg/math/Makefile @@ -5,7 +5,14 @@ include $(GOROOT)/src/Make.$(GOARCH) TARG=math -GOFILES=\ + +OFILES_amd64=\ + sqrt_amd64.$O\ + +OFILES=\ + $(OFILES_$(GOARCH)) + +ALLGOFILES=\ asin.go\ atan.go\ atan2.go\ @@ -25,4 +32,11 @@ GOFILES=\ tan.go\ tanh.go\ +NOGOFILES=\ + $(subst _$(GOARCH).$O,.go,$(OFILES_$(GOARCH))) + +GOFILES=\ + $(filter-out $(NOGOFILES),$(ALLGOFILES))\ + $(subst .go,_decl.go,$(NOGOFILES))\ + include $(GOROOT)/src/Make.pkg diff --git a/src/pkg/math/sqrt_amd64.s b/src/pkg/math/sqrt_amd64.s new file mode 100644 index 000000000..5972fafe8 --- /dev/null +++ b/src/pkg/math/sqrt_amd64.s @@ -0,0 +1,10 @@ +// Copyright 2009 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 math·Sqrt(SB),7,$0 + MOVSD x+0(FP), X0 + SQRTSD X0, X0 + MOVSD X0, r+8(FP) + RET diff --git a/src/pkg/math/sqrt_decl.go b/src/pkg/math/sqrt_decl.go new file mode 100644 index 000000000..4e9112d26 --- /dev/null +++ b/src/pkg/math/sqrt_decl.go @@ -0,0 +1,8 @@ +// Copyright 2009 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. + +package math + +func Sqrt(x float64) float64 + |