Mercurial > pub > dyncall > dyncall
annotate dyncallback/dyncall_callback_x64_masm.asm @ 542:a73a5cd50c19
- fix passing aggregate-by-val on x64/sysv: subaggr classification for
aggr *arrays* was wrong (was problematic when there ware exactly 2 8bytes to
be classified, potentially be passed via registers)
author | Tassilo Philipp |
---|---|
date | Mon, 02 May 2022 15:32:41 +0200 |
parents | 71c884e610f0 |
children |
rev | line source |
---|---|
0 | 1 ; auto-generated by gen-masm.sh |
2 .CODE | |
3 DCThunk_size = 24 | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
4 DCArgs_size_win64 = 96 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
5 DCArgs_size_sysv = 144 |
0 | 6 DCValue_size = 8 |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
7 DCRetRegs_SystemV_size = 32 |
0 | 8 FRAME_arg0_win64 = 48 |
9 FRAME_arg0_sysv = 16 | |
10 FRAME_return = 8 | |
11 FRAME_parent = 0 | |
12 CTX_thunk = 0 | |
13 CTX_handler = 24 | |
14 CTX_userdata = 32 | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
15 CTX_aggr_ret_reg = 40 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
16 CTX_pad = 44 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
17 CTX_aggrs_pp = 48 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
18 DCCallback_size = 56 |
0 | 19 dcCallback_x64_sysv PROC |
20 OPTION PROLOGUE:NONE, EPILOGUE:NONE | |
21 push RBP | |
22 mov RBP,RSP | |
23 sub RSP,8*8 | |
24 movsd qword ptr [RSP+8*7],XMM7 | |
25 movsd qword ptr [RSP+8*6],XMM6 | |
26 movsd qword ptr [RSP+8*5],XMM5 | |
27 movsd qword ptr [RSP+8*4],XMM4 | |
28 movsd qword ptr [RSP+8*3],XMM3 | |
29 movsd qword ptr [RSP+8*2],XMM2 | |
30 movsd qword ptr [RSP+8*1],XMM1 | |
31 movsd qword ptr [RSP+8*0],XMM0 | |
32 push R9 | |
33 push R8 | |
34 push RCX | |
35 push RDX | |
36 push RSI | |
37 push RDI | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
38 mov R8,qword ptr [RAX+CTX_aggrs_pp] |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
39 push R8 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
40 mov R8D,dword ptr [RAX+CTX_aggr_ret_reg] |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
41 push R8 |
0 | 42 push 0 |
43 lea RDX,qword ptr [RBP+FRAME_arg0_sysv] | |
44 push RDX | |
45 mov RSI,RSP | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
46 sub RSP,4*8 |
0 | 47 mov RDI,RAX |
48 mov RCX,qword ptr [RDI+CTX_userdata] | |
49 mov RDX,RSP | |
50 call qword ptr [RAX+CTX_handler] | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
51 cmp dword ptr [RSP+48],-2 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
52 je scalar_retval |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
53 mov RAX,qword ptr [RSP+0] |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
54 mov RDX,qword ptr [RSP+8] |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
55 movsd XMM0,qword ptr [RSP+16] |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
56 movsd XMM1,qword ptr [RSP+24] |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
57 jmp epilog |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
58 scalar_retval: |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
59 mov RAX,qword ptr [RSP+0] |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
60 movd XMM0,RAX |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
61 epilog: |
0 | 62 mov RSP,RBP |
63 pop RBP | |
64 ret | |
65 dcCallback_x64_sysv ENDP | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
66 dcCallback_x64_win64 PROC FRAME |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
67 OPTION EPILOGUE:NONE |
0 | 68 push RBP |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
69 .pushreg RBP |
0 | 70 mov RBP,RSP |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
71 .setframe RBP, 0 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
72 .endprolog |
0 | 73 sub RSP,4*8 |
74 movsd qword ptr [RSP+8*3],XMM3 | |
75 movsd qword ptr [RSP+8*2],XMM2 | |
76 movsd qword ptr [RSP+8*1],XMM1 | |
77 movsd qword ptr [RSP+8*0],XMM0 | |
78 push R9 | |
79 push R8 | |
80 push RDX | |
81 push RCX | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
82 mov R8,qword ptr [RAX+CTX_aggrs_pp] |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
83 push R8 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
84 mov R8D,dword ptr [RAX+CTX_aggr_ret_reg] |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
85 push R8 |
0 | 86 push 0 |
87 lea RDX,qword ptr [RBP+FRAME_arg0_win64] | |
88 push RDX | |
89 mov RDX,RSP | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
90 sub RSP,2*8 |
0 | 91 mov RCX,RAX |
92 mov R9,qword ptr [RAX+CTX_userdata] | |
93 mov R8,RSP | |
94 sub RSP,4*8 | |
95 call qword ptr [RAX+CTX_handler] | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
0
diff
changeset
|
96 mov RAX,qword ptr [RSP+4*8] |
0 | 97 movd XMM0,RAX |
98 mov RSP,RBP | |
99 pop RBP | |
100 ret | |
101 dcCallback_x64_win64 ENDP | |
102 END |