Source file
src/runtime/export_debug_regabiargs_on_test.go
Documentation: runtime
1
2
3
4
5
6
7
8 package runtime
9
10 import "internal/abi"
11
12
13
14
15
16 func storeRegArgs(dst *sigcontext, src *abi.RegArgs) {
17 dst.rax = uint64(src.Ints[0])
18 dst.rbx = uint64(src.Ints[1])
19 dst.rcx = uint64(src.Ints[2])
20 dst.rdi = uint64(src.Ints[3])
21 dst.rsi = uint64(src.Ints[4])
22 dst.r8 = uint64(src.Ints[5])
23 dst.r9 = uint64(src.Ints[6])
24 dst.r10 = uint64(src.Ints[7])
25 dst.r11 = uint64(src.Ints[8])
26 for i := range src.Floats {
27 dst.fpstate._xmm[i].element[0] = uint32(src.Floats[i] >> 0)
28 dst.fpstate._xmm[i].element[1] = uint32(src.Floats[i] >> 32)
29 }
30 }
31
32 func loadRegArgs(dst *abi.RegArgs, src *sigcontext) {
33 dst.Ints[0] = uintptr(src.rax)
34 dst.Ints[1] = uintptr(src.rbx)
35 dst.Ints[2] = uintptr(src.rcx)
36 dst.Ints[3] = uintptr(src.rdi)
37 dst.Ints[4] = uintptr(src.rsi)
38 dst.Ints[5] = uintptr(src.r8)
39 dst.Ints[6] = uintptr(src.r9)
40 dst.Ints[7] = uintptr(src.r10)
41 dst.Ints[8] = uintptr(src.r11)
42 for i := range dst.Floats {
43 dst.Floats[i] = uint64(src.fpstate._xmm[i].element[0]) << 0
44 dst.Floats[i] |= uint64(src.fpstate._xmm[i].element[1]) << 32
45 }
46 }
47
View as plain text