Skip to content

Commit

Permalink
math, math/big: add support for GOARCH=arm64
Browse files Browse the repository at this point in the history
Change-Id: Ief12e1435a40dd2eaddc3f97f63be44c4dd2e050
Reviewed-on: https://go-review.googlesource.com/7144
Reviewed-by: Minux Ma <[email protected]>
Reviewed-by: Dave Cheney <[email protected]>
Reviewed-by: Rob Pike <[email protected]>
Reviewed-by: Russ Cox <[email protected]>
  • Loading branch information
4ad committed Mar 16, 2015
1 parent d0d9310 commit f0aef42
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/math/abs_arm64.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// 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.

#include "textflag.h"

TEXT ·Abs(SB),NOSPLIT,$0-16
FMOVD x+0(FP), F3
FABSD F3, F3
FMOVD F3, ret+8(FP)
RET
44 changes: 44 additions & 0 deletions src/math/big/arith_arm64.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2013 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.

#include "textflag.h"

// This file provides fast assembly versions for the elementary
// arithmetic operations on vectors implemented in arith.go.

TEXT ·mulWW(SB),NOSPLIT,$0
B ·mulWW_g(SB)

TEXT ·divWW(SB),NOSPLIT,$0
B ·divWW_g(SB)

TEXT ·addVV(SB),NOSPLIT,$0
B ·addVV_g(SB)

TEXT ·subVV(SB),NOSPLIT,$0
B ·subVV_g(SB)

TEXT ·addVW(SB),NOSPLIT,$0
B ·addVW_g(SB)

TEXT ·subVW(SB),NOSPLIT,$0
B ·subVW_g(SB)

TEXT ·shlVU(SB),NOSPLIT,$0
B ·shlVU_g(SB)

TEXT ·shrVU(SB),NOSPLIT,$0
B ·shrVU_g(SB)

TEXT ·mulAddVWW(SB),NOSPLIT,$0
B ·mulAddVWW_g(SB)

TEXT ·addMulVVW(SB),NOSPLIT,$0
B ·addMulVVW_g(SB)

TEXT ·divWVW(SB),NOSPLIT,$0
B ·divWVW_g(SB)

TEXT ·bitLen(SB),NOSPLIT,$0
B ·bitLen_g(SB)
91 changes: 91 additions & 0 deletions src/math/stubs_arm64.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// Copyright 2014 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.

// +build arm64

#include "textflag.h"

TEXT ·Asin(SB),NOSPLIT,$0
B ·asin(SB)

TEXT ·Acos(SB),NOSPLIT,$0
B ·acos(SB)

TEXT ·Atan2(SB),NOSPLIT,$0
B ·atan2(SB)

TEXT ·Atan(SB),NOSPLIT,$0
B ·atan(SB)

TEXT ·Dim(SB),NOSPLIT,$0
B ·dim(SB)

TEXT ·Min(SB),NOSPLIT,$0
B ·min(SB)

TEXT ·Max(SB),NOSPLIT,$0
B ·max(SB)

TEXT ·Exp2(SB),NOSPLIT,$0
B ·exp2(SB)

TEXT ·Expm1(SB),NOSPLIT,$0
B ·expm1(SB)

TEXT ·Exp(SB),NOSPLIT,$0
B ·exp(SB)

TEXT ·Floor(SB),NOSPLIT,$0
B ·floor(SB)

TEXT ·Ceil(SB),NOSPLIT,$0
B ·ceil(SB)

TEXT ·Trunc(SB),NOSPLIT,$0
B ·trunc(SB)

TEXT ·Frexp(SB),NOSPLIT,$0
B ·frexp(SB)

TEXT ·Hypot(SB),NOSPLIT,$0
B ·hypot(SB)

TEXT ·Ldexp(SB),NOSPLIT,$0
B ·ldexp(SB)

TEXT ·Log10(SB),NOSPLIT,$0
B ·log10(SB)

TEXT ·Log2(SB),NOSPLIT,$0
B ·log2(SB)

TEXT ·Log1p(SB),NOSPLIT,$0
B ·log1p(SB)

TEXT ·Log(SB),NOSPLIT,$0
B ·log(SB)

TEXT ·Modf(SB),NOSPLIT,$0
B ·modf(SB)

TEXT ·Mod(SB),NOSPLIT,$0
B ·mod(SB)

TEXT ·Remainder(SB),NOSPLIT,$0
B ·remainder(SB)

TEXT ·Sincos(SB),NOSPLIT,$0
B ·sincos(SB)

TEXT ·Sin(SB),NOSPLIT,$0
B ·sin(SB)

TEXT ·Cos(SB),NOSPLIT,$0
B ·cos(SB)

TEXT ·Sqrt(SB),NOSPLIT,$0
B ·sqrt(SB)

TEXT ·Tan(SB),NOSPLIT,$0
B ·tan(SB)

0 comments on commit f0aef42

Please sign in to comment.