]> Cypherpunks repositories - gostls13.git/commitdiff
math, math/big: add support for GOARCH=mips{,le}
authorVladimir Stefanovic <vladimir.stefanovic@imgtec.com>
Tue, 18 Oct 2016 21:50:55 +0000 (23:50 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 3 Nov 2016 22:55:06 +0000 (22:55 +0000)
Change-Id: I54e100cced5b49674937fb87d1e0f585f962aeb7
Reviewed-on: https://go-review.googlesource.com/31484
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/math/big/arith_mipsx.s [new file with mode: 0644]
src/math/sqrt_mipsx.s [new file with mode: 0644]
src/math/stubs_mipsx.s [new file with mode: 0644]

diff --git a/src/math/big/arith_mipsx.s b/src/math/big/arith_mipsx.s
new file mode 100644 (file)
index 0000000..ac23114
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright 2016 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 !math_big_pure_go,mips !math_big_pure_go,mipsle
+
+#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
+       JMP     ·mulWW_g(SB)
+
+TEXT ·divWW(SB),NOSPLIT,$0
+       JMP     ·divWW_g(SB)
+
+TEXT ·addVV(SB),NOSPLIT,$0
+       JMP     ·addVV_g(SB)
+
+TEXT ·subVV(SB),NOSPLIT,$0
+       JMP     ·subVV_g(SB)
+
+TEXT ·addVW(SB),NOSPLIT,$0
+       JMP     ·addVW_g(SB)
+
+TEXT ·subVW(SB),NOSPLIT,$0
+       JMP     ·subVW_g(SB)
+
+TEXT ·shlVU(SB),NOSPLIT,$0
+       JMP     ·shlVU_g(SB)
+
+TEXT ·shrVU(SB),NOSPLIT,$0
+       JMP     ·shrVU_g(SB)
+
+TEXT ·mulAddVWW(SB),NOSPLIT,$0
+       JMP     ·mulAddVWW_g(SB)
+
+TEXT ·addMulVVW(SB),NOSPLIT,$0
+       JMP     ·addMulVVW_g(SB)
+
+TEXT ·divWVW(SB),NOSPLIT,$0
+       JMP     ·divWVW_g(SB)
+
+TEXT ·bitLen(SB),NOSPLIT,$0
+       JMP     ·bitLen_g(SB)
diff --git a/src/math/sqrt_mipsx.s b/src/math/sqrt_mipsx.s
new file mode 100644 (file)
index 0000000..1b27d49
--- /dev/null
@@ -0,0 +1,14 @@
+// Copyright 2016 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 mips mipsle
+
+#include "textflag.h"
+
+// func Sqrt(x float64) float64
+TEXT ·Sqrt(SB),NOSPLIT,$0
+       MOVD    x+0(FP), F0
+       SQRTD   F0, F0
+       MOVD    F0, ret+8(FP)
+       RET
diff --git a/src/math/stubs_mipsx.s b/src/math/stubs_mipsx.s
new file mode 100644 (file)
index 0000000..48df75a
--- /dev/null
@@ -0,0 +1,88 @@
+// Copyright 2016 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 mips mipsle
+
+#include "textflag.h"
+
+TEXT ·Asin(SB),NOSPLIT,$0
+       JMP     ·asin(SB)
+
+TEXT ·Acos(SB),NOSPLIT,$0
+       JMP     ·acos(SB)
+
+TEXT ·Atan2(SB),NOSPLIT,$0
+       JMP     ·atan2(SB)
+
+TEXT ·Atan(SB),NOSPLIT,$0
+       JMP     ·atan(SB)
+
+TEXT ·Dim(SB),NOSPLIT,$0
+       JMP     ·dim(SB)
+
+TEXT ·Min(SB),NOSPLIT,$0
+       JMP     ·min(SB)
+
+TEXT ·Max(SB),NOSPLIT,$0
+       JMP     ·max(SB)
+
+TEXT ·Exp2(SB),NOSPLIT,$0
+       JMP     ·exp2(SB)
+
+TEXT ·Expm1(SB),NOSPLIT,$0
+       JMP     ·expm1(SB)
+
+TEXT ·Exp(SB),NOSPLIT,$0
+       JMP     ·exp(SB)
+
+TEXT ·Floor(SB),NOSPLIT,$0
+       JMP     ·floor(SB)
+
+TEXT ·Ceil(SB),NOSPLIT,$0
+       JMP     ·ceil(SB)
+
+TEXT ·Trunc(SB),NOSPLIT,$0
+       JMP     ·trunc(SB)
+
+TEXT ·Frexp(SB),NOSPLIT,$0
+       JMP     ·frexp(SB)
+
+TEXT ·Hypot(SB),NOSPLIT,$0
+       JMP     ·hypot(SB)
+
+TEXT ·Ldexp(SB),NOSPLIT,$0
+       JMP     ·ldexp(SB)
+
+TEXT ·Log10(SB),NOSPLIT,$0
+       JMP     ·log10(SB)
+
+TEXT ·Log2(SB),NOSPLIT,$0
+       JMP     ·log2(SB)
+
+TEXT ·Log1p(SB),NOSPLIT,$0
+       JMP     ·log1p(SB)
+
+TEXT ·Log(SB),NOSPLIT,$0
+       JMP     ·log(SB)
+
+TEXT ·Modf(SB),NOSPLIT,$0
+       JMP     ·modf(SB)
+
+TEXT ·Mod(SB),NOSPLIT,$0
+       JMP     ·mod(SB)
+
+TEXT ·Remainder(SB),NOSPLIT,$0
+       JMP     ·remainder(SB)
+
+TEXT ·Sincos(SB),NOSPLIT,$0
+       JMP     ·sincos(SB)
+
+TEXT ·Sin(SB),NOSPLIT,$0
+       JMP     ·sin(SB)
+
+TEXT ·Cos(SB),NOSPLIT,$0
+       JMP     ·cos(SB)
+
+TEXT ·Tan(SB),NOSPLIT,$0
+       JMP     ·tan(SB)