Text file
src/runtime/cgo/trampoline_test_mips64x.s
1 // Copyright 2026 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 //go:build goexperiment.runtimecgopurego && !msan && !tsan && unix && (mips64 || mips64le)
6
7 #include "textflag.h"
8
9 // Called on g0 by cgoCallTrampoline with a PC buffer in R4, its size
10 // in R5, and runtime.Callers in R6. Call Callers(0, buf) using the
11 // MIPS64 stack ABI while preserving C callee-saved registers.
12 #ifndef GOMIPS64_softfloat
13 TEXT ·trampolineCallers(SB),NOSPLIT,$184-0
14 #else
15 TEXT ·trampolineCallers(SB),NOSPLIT,$120-0
16 #endif
17 MOVV R16, (8*6)(R29)
18 MOVV R17, (8*7)(R29)
19 MOVV R18, (8*8)(R29)
20 MOVV R19, (8*9)(R29)
21 MOVV R20, (8*10)(R29)
22 MOVV R21, (8*11)(R29)
23 MOVV R22, (8*12)(R29)
24 MOVV R23, (8*13)(R29)
25 MOVV RSB, (8*14)(R29)
26 MOVV g, (8*15)(R29)
27 #ifndef GOMIPS64_softfloat
28 MOVD F24, (8*16)(R29)
29 MOVD F25, (8*17)(R29)
30 MOVD F26, (8*18)(R29)
31 MOVD F27, (8*19)(R29)
32 MOVD F28, (8*20)(R29)
33 MOVD F29, (8*21)(R29)
34 MOVD F30, (8*22)(R29)
35 MOVD F31, (8*23)(R29)
36 #endif
37 MOVV R0, 8(R29)
38 MOVV R4, 16(R29)
39 MOVV R5, 24(R29)
40 MOVV R5, 32(R29)
41 MOVV R6, R25
42 JAL (R25)
43 MOVV 40(R29), R2
44 #ifndef GOMIPS64_softfloat
45 MOVD (8*16)(R29), F24
46 MOVD (8*17)(R29), F25
47 MOVD (8*18)(R29), F26
48 MOVD (8*19)(R29), F27
49 MOVD (8*20)(R29), F28
50 MOVD (8*21)(R29), F29
51 MOVD (8*22)(R29), F30
52 MOVD (8*23)(R29), F31
53 #endif
54 MOVV (8*6)(R29), R16
55 MOVV (8*7)(R29), R17
56 MOVV (8*8)(R29), R18
57 MOVV (8*9)(R29), R19
58 MOVV (8*10)(R29), R20
59 MOVV (8*11)(R29), R21
60 MOVV (8*12)(R29), R22
61 MOVV (8*13)(R29), R23
62 MOVV (8*14)(R29), RSB
63 MOVV (8*15)(R29), g
64 RET
65
View as plain text