Skip to content

Commit d1e9104

Browse files
Vladimir Stefanovicbradfitz
Vladimir Stefanovic
authored andcommitted
math, math/big: add support for GOARCH=mips{,le}
Change-Id: I54e100cced5b49674937fb87d1e0f585f962aeb7 Reviewed-on: https://go-review.googlesource.com/31484 Reviewed-by: Cherry Zhang <[email protected]>
1 parent 9788e3d commit d1e9104

File tree

3 files changed

+148
-0
lines changed

3 files changed

+148
-0
lines changed

src/math/big/arith_mipsx.s

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright 2016 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
// +build !math_big_pure_go,mips !math_big_pure_go,mipsle
6+
7+
#include "textflag.h"
8+
9+
// This file provides fast assembly versions for the elementary
10+
// arithmetic operations on vectors implemented in arith.go.
11+
12+
TEXT ·mulWW(SB),NOSPLIT,$0
13+
JMP ·mulWW_g(SB)
14+
15+
TEXT ·divWW(SB),NOSPLIT,$0
16+
JMP ·divWW_g(SB)
17+
18+
TEXT ·addVV(SB),NOSPLIT,$0
19+
JMP ·addVV_g(SB)
20+
21+
TEXT ·subVV(SB),NOSPLIT,$0
22+
JMP ·subVV_g(SB)
23+
24+
TEXT ·addVW(SB),NOSPLIT,$0
25+
JMP ·addVW_g(SB)
26+
27+
TEXT ·subVW(SB),NOSPLIT,$0
28+
JMP ·subVW_g(SB)
29+
30+
TEXT ·shlVU(SB),NOSPLIT,$0
31+
JMP ·shlVU_g(SB)
32+
33+
TEXT ·shrVU(SB),NOSPLIT,$0
34+
JMP ·shrVU_g(SB)
35+
36+
TEXT ·mulAddVWW(SB),NOSPLIT,$0
37+
JMP ·mulAddVWW_g(SB)
38+
39+
TEXT ·addMulVVW(SB),NOSPLIT,$0
40+
JMP ·addMulVVW_g(SB)
41+
42+
TEXT ·divWVW(SB),NOSPLIT,$0
43+
JMP ·divWVW_g(SB)
44+
45+
TEXT ·bitLen(SB),NOSPLIT,$0
46+
JMP ·bitLen_g(SB)

src/math/sqrt_mipsx.s

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2016 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
// +build mips mipsle
6+
7+
#include "textflag.h"
8+
9+
// func Sqrt(x float64) float64
10+
TEXT ·Sqrt(SB),NOSPLIT,$0
11+
MOVD x+0(FP), F0
12+
SQRTD F0, F0
13+
MOVD F0, ret+8(FP)
14+
RET

src/math/stubs_mipsx.s

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
// Copyright 2016 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
// +build mips mipsle
6+
7+
#include "textflag.h"
8+
9+
TEXT ·Asin(SB),NOSPLIT,$0
10+
JMP ·asin(SB)
11+
12+
TEXT ·Acos(SB),NOSPLIT,$0
13+
JMP ·acos(SB)
14+
15+
TEXT ·Atan2(SB),NOSPLIT,$0
16+
JMP ·atan2(SB)
17+
18+
TEXT ·Atan(SB),NOSPLIT,$0
19+
JMP ·atan(SB)
20+
21+
TEXT ·Dim(SB),NOSPLIT,$0
22+
JMP ·dim(SB)
23+
24+
TEXT ·Min(SB),NOSPLIT,$0
25+
JMP ·min(SB)
26+
27+
TEXT ·Max(SB),NOSPLIT,$0
28+
JMP ·max(SB)
29+
30+
TEXT ·Exp2(SB),NOSPLIT,$0
31+
JMP ·exp2(SB)
32+
33+
TEXT ·Expm1(SB),NOSPLIT,$0
34+
JMP ·expm1(SB)
35+
36+
TEXT ·Exp(SB),NOSPLIT,$0
37+
JMP ·exp(SB)
38+
39+
TEXT ·Floor(SB),NOSPLIT,$0
40+
JMP ·floor(SB)
41+
42+
TEXT ·Ceil(SB),NOSPLIT,$0
43+
JMP ·ceil(SB)
44+
45+
TEXT ·Trunc(SB),NOSPLIT,$0
46+
JMP ·trunc(SB)
47+
48+
TEXT ·Frexp(SB),NOSPLIT,$0
49+
JMP ·frexp(SB)
50+
51+
TEXT ·Hypot(SB),NOSPLIT,$0
52+
JMP ·hypot(SB)
53+
54+
TEXT ·Ldexp(SB),NOSPLIT,$0
55+
JMP ·ldexp(SB)
56+
57+
TEXT ·Log10(SB),NOSPLIT,$0
58+
JMP ·log10(SB)
59+
60+
TEXT ·Log2(SB),NOSPLIT,$0
61+
JMP ·log2(SB)
62+
63+
TEXT ·Log1p(SB),NOSPLIT,$0
64+
JMP ·log1p(SB)
65+
66+
TEXT ·Log(SB),NOSPLIT,$0
67+
JMP ·log(SB)
68+
69+
TEXT ·Modf(SB),NOSPLIT,$0
70+
JMP ·modf(SB)
71+
72+
TEXT ·Mod(SB),NOSPLIT,$0
73+
JMP ·mod(SB)
74+
75+
TEXT ·Remainder(SB),NOSPLIT,$0
76+
JMP ·remainder(SB)
77+
78+
TEXT ·Sincos(SB),NOSPLIT,$0
79+
JMP ·sincos(SB)
80+
81+
TEXT ·Sin(SB),NOSPLIT,$0
82+
JMP ·sin(SB)
83+
84+
TEXT ·Cos(SB),NOSPLIT,$0
85+
JMP ·cos(SB)
86+
87+
TEXT ·Tan(SB),NOSPLIT,$0
88+
JMP ·tan(SB)

0 commit comments

Comments
 (0)