Skip to content

Commit 1371339

Browse files
XiaodongLoonggopherbot
authored andcommitted
go, math, os, reflect: support standard library for loong64
Contributors to the loong64 port are: Weining Lu <[email protected]> Lei Wang <[email protected]> Lingqin Gong <[email protected]> Xiaolin Zhao <[email protected]> Meidan Li <[email protected]> Xiaojuan Zhai <[email protected]> Qiyuan Pu <[email protected]> Guoqi Chen <[email protected]> This port has been updated to Go 1.15.6: https://github.com/loongson/go Updates #46229 Change-Id: I2ad9ed01fc913b90e75023ac0fa70de87a9f5de1 Reviewed-on: https://go-review.googlesource.com/c/go/+/342324 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
1 parent ae3ee9a commit 1371339

File tree

4 files changed

+76
-1
lines changed

4 files changed

+76
-1
lines changed

src/go/types/gccgosizes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var gccgoArchSizes = map[string]*StdSizes{
1717
"arm64": {8, 8},
1818
"arm64be": {8, 8},
1919
"ia64": {8, 8},
20+
"loong64": {8, 8},
2021
"m68k": {4, 2},
2122
"mips": {4, 8},
2223
"mipsle": {4, 8},

src/math/big/arith_loong64.s

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2022 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,loong64
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 ·addVV(SB),NOSPLIT,$0
13+
JMP ·addVV_g(SB)
14+
15+
TEXT ·subVV(SB),NOSPLIT,$0
16+
JMP ·subVV_g(SB)
17+
18+
TEXT ·addVW(SB),NOSPLIT,$0
19+
JMP ·addVW_g(SB)
20+
21+
TEXT ·subVW(SB),NOSPLIT,$0
22+
JMP ·subVW_g(SB)
23+
24+
TEXT ·shlVU(SB),NOSPLIT,$0
25+
JMP ·shlVU_g(SB)
26+
27+
TEXT ·shrVU(SB),NOSPLIT,$0
28+
JMP ·shrVU_g(SB)
29+
30+
TEXT ·mulAddVWW(SB),NOSPLIT,$0
31+
JMP ·mulAddVWW_g(SB)
32+
33+
TEXT ·addMulVVW(SB),NOSPLIT,$0
34+
JMP ·addMulVVW_g(SB)

src/os/endian_little.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44
//
5-
//go:build 386 || amd64 || arm || arm64 || ppc64le || mips64le || mipsle || riscv64 || wasm
5+
//go:build 386 || amd64 || arm || arm64 || loong64 || ppc64le || mips64le || mipsle || riscv64 || wasm
66

77
package os
88

src/reflect/asm_loong64.s

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright 2022 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+
#include "textflag.h"
6+
#include "funcdata.h"
7+
8+
#define REGCTXT R29
9+
10+
// makeFuncStub is the code half of the function returned by MakeFunc.
11+
// See the comment on the declaration of makeFuncStub in makefunc.go
12+
// for more details.
13+
// No arg size here, runtime pulls arg map out of the func value.
14+
TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$40
15+
NO_LOCAL_POINTERS
16+
MOVV REGCTXT, 8(R3)
17+
MOVV $argframe+0(FP), R19
18+
MOVV R19, 16(R3)
19+
MOVB R0, 40(R3)
20+
ADDV $40, R3, R19
21+
MOVV R19, 24(R3)
22+
MOVV R0, 32(R3)
23+
JAL ·callReflect(SB)
24+
RET
25+
26+
// methodValueCall is the code half of the function returned by makeMethodValue.
27+
// See the comment on the declaration of methodValueCall in makefunc.go
28+
// for more details.
29+
// No arg size here; runtime pulls arg map out of the func value.
30+
TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$40
31+
NO_LOCAL_POINTERS
32+
MOVV REGCTXT, 8(R3)
33+
MOVV $argframe+0(FP), R19
34+
MOVV R19, 16(R3)
35+
MOVB R0, 40(R3)
36+
ADDV $40, R3, R19
37+
MOVV R19, 24(R3)
38+
MOVV R0, 32(R3)
39+
JAL ·callMethod(SB)
40+
RET

0 commit comments

Comments
 (0)