upstream-v0.10.1 eaff005

asm_ppc64le.s RawHistoryFolder

1// Copyright 2014 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 "abi_ppc64x.h"
7
8// Called by C code generated by cmd/cgo.
9// func crosscall2(fn, a unsafe.Pointer, n int32, ctxt uintptr)
10// Saves C callee-saved registers and calls cgocallback with three arguments.
11// fn is the PC of a func(a unsafe.Pointer) function.
12//
13// This is a simplified version that only saves GPR and FPR registers,
14// not vector registers. This keeps the stack frame smaller to avoid
15// exceeding the nosplit stack limit.
16//
17// On PPC64LE ELFv2, callee-save registers are:
18//   R14-R31 (18 GPRs = 144 bytes)
19//   F14-F31 (18 FPRs = 144 bytes)
20//   CR2-CR4 (saved in CR field)
21//
22// Stack layout (must be 16-byte aligned):
23//   32 (FIXED_FRAME) + 24 (args) + 144 (GPR) + 144 (FPR) = 344
24//   Rounded to 352 for 16-byte alignment.
25
26#define FIXED_FRAME 32
27#define SAVE_SIZE    352
28#define GPR_OFFSET   (FIXED_FRAME+24)
29#define FPR_OFFSET   (GPR_OFFSET+SAVE_GPR_SIZE)
30
31TEXT crosscall2(SB), NOSPLIT|NOFRAME, $0
32	// Save LR and CR in caller's frame per ELFv2 ABI
33	MOVD LR, R0
34	MOVD R0, 16(R1)
35	MOVW CR, R0
36	MOVD R0, 8(R1)
37
38	// Allocate our stack frame
39	MOVDU R1, -SAVE_SIZE(R1)
40
41	// Save TOC (R2) in case needed
42	MOVD R2, 24(R1)
43
44	// Save callee-save GPRs
45	SAVE_GPR(GPR_OFFSET)
46
47	// Save callee-save FPRs
48	SAVE_FPR(FPR_OFFSET)
49
50	// Initialize R0 to 0 as expected by Go
51	MOVD $0, R0
52
53	// Load the current g.
54	BL runtime·load_g(SB)
55
56	// Set up arguments for cgocallback
57	MOVD R3, FIXED_FRAME+0(R1) // fn unsafe.Pointer
58	MOVD R4, FIXED_FRAME+8(R1) // a unsafe.Pointer
59
60	// Skip R5 = n uint32
61	MOVD R6, FIXED_FRAME+16(R1)  // ctxt uintptr
62	BL   runtime·cgocallback(SB)
63
64	// Restore callee-save FPRs
65	RESTORE_FPR(FPR_OFFSET)
66
67	// Restore callee-save GPRs
68	RESTORE_GPR(GPR_OFFSET)
69
70	// Restore TOC
71	MOVD 24(R1), R2
72
73	// Deallocate stack frame
74	ADD $SAVE_SIZE, R1
75
76	// Restore LR and CR from caller's frame
77	MOVD 16(R1), R0
78	MOVD R0, LR
79	MOVD 8(R1), R0
80	MOVW R0, CR
81
82	RET

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close