Mercurial > pub > dyncall > dyncall
annotate dyncall/dyncall_call_x64_generic_masm.asm @ 533:71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
* integration of aggregate-by-value (struct, union) support patch for x64 (win and sysv)
* windows/x64 asm additions to specify how stack unwinds (help for debuggers, exception handling, etc.)
* see Changelog for details
- new calling convention modes for thiscalls (platform agnostic, was specific before)
* new signature character for platform agnostic thiscalls ('*' / DC_SIGCHAR_CC_THISCALL)
- dcCallF(), dcVCallF(), dcArgF() and dcVArgF():
* added support for aggregates-by-value (wasn't part of patch)
* change that those functions don't implicitly call dcReset() anymore, which was unflexible (breaking change)
- added macros to feature test implementation for aggregate-by-value and syscall support
- changed libdyncall_s.lib and libdyncallback_s.lib order in callback test makefiles, as some toolchains are picky about order
- doc:
* man page updates to describe aggregate interface
* manual overview changes to highlight platforms with aggregate-by-value support
- test/plain: replaced tests w/ old/stale sctruct interface with new aggregate one
author | Tassilo Philipp |
---|---|
date | Thu, 21 Apr 2022 13:35:47 +0200 |
parents | ab2d78e48ca2 |
children |
rev | line source |
---|---|
0 | 1 ; auto-generated by gen-masm.sh |
2 .CODE | |
3 dcCall_x64_sysv PROC | |
4 OPTION PROLOGUE:NONE, EPILOGUE:NONE | |
5 push RBP | |
6 push RBX | |
7 mov RBP,RSP | |
8 mov RBX,R8 | |
9 movsd XMM0,qword ptr [RCX+0] | |
10 movsd XMM1,qword ptr [RCX+8] | |
11 movsd XMM2,qword ptr [RCX+16] | |
12 movsd XMM3,qword ptr [RCX+24] | |
13 movsd XMM4,qword ptr [RCX+32] | |
14 movsd XMM5,qword ptr [RCX+40] | |
15 movsd XMM6,qword ptr [RCX+48] | |
16 movsd XMM7,qword ptr [RCX+56] | |
17 add RDI,31 | |
18 and RDI,-32 | |
19 add RDI,8 | |
20 sub RSP,RDI | |
21 mov RCX,RDI | |
22 mov RDI,RSP | |
23 rep movsb | |
24 mov RDI,qword ptr [RDX+0] | |
25 mov RSI,qword ptr [RDX+8] | |
26 mov RCX,qword ptr [RDX+24] | |
27 mov R8,qword ptr [RDX+32] | |
28 mov R9,qword ptr [RDX+40] | |
29 mov RDX,qword ptr [RDX+16] | |
30 mov AL,8 | |
31 call RBX | |
32 mov RSP,RBP | |
33 pop RBX | |
34 pop RBP | |
35 ret | |
341 | 36 dcCall_x64_sysv ENDP |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
37 dcCall_x64_sysv_aggr PROC |
0 | 38 OPTION PROLOGUE:NONE, EPILOGUE:NONE |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
39 push R9 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
40 call dcCall_x64_sysv |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
41 pop R9 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
42 mov qword ptr [R9+0],RAX |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
43 mov qword ptr [R9+8],RDX |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
44 movsd qword ptr [R9+16],XMM0 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
45 movsd qword ptr [R9+24],XMM1 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
46 ret |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
47 dcCall_x64_sysv_aggr ENDP |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
48 dcCall_x64_win64 PROC FRAME |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
49 OPTION EPILOGUE:NONE |
0 | 50 push RBP |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
51 .pushreg RBP |
0 | 52 push RSI |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
53 .pushreg RSI |
0 | 54 push RDI |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
55 .pushreg RDI |
0 | 56 mov RBP,RSP |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
57 .setframe RBP, 0 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
58 .endprolog |
0 | 59 add RCX,15 |
60 and RCX,-16 | |
61 sub RSP,RCX | |
62 mov RSI,RDX | |
63 mov RDI,RSP | |
64 mov RAX,R9 | |
65 rep movsb | |
66 mov RCX,qword ptr [R8+0] | |
67 mov RDX,qword ptr [R8+8] | |
68 mov R9,qword ptr [R8+24] | |
69 mov R8,qword ptr [R8+16] | |
70 movd XMM0,RCX | |
71 movd XMM1,RDX | |
72 movd XMM2,R8 | |
73 movd XMM3,R9 | |
74 push R9 | |
75 push R8 | |
76 push RDX | |
77 push RCX | |
78 call RAX | |
79 mov RSP,RBP | |
80 pop RDI | |
81 pop RSI | |
82 pop RBP | |
83 ret | |
84 dcCall_x64_win64 ENDP | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
85 dcCall_x64_win64_aggr PROC |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
86 OPTION PROLOGUE:NONE, EPILOGUE:NONE |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
87 sub RSP,8 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
88 call dcCall_x64_win64 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
89 add RSP,8 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
90 mov R8,qword ptr [RSP+40] |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
91 mov qword ptr [R8+0],RAX |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
92 ret |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
341
diff
changeset
|
93 dcCall_x64_win64_aggr ENDP |
341 | 94 dcCall_x64_syscall_sysv PROC |
95 OPTION PROLOGUE:NONE, EPILOGUE:NONE | |
96 mov RAX,RSI | |
97 mov R9,qword ptr [RDI+40] | |
98 mov R8,qword ptr [RDI+32] | |
99 mov R10,qword ptr [RDI+24] | |
100 mov RDX,qword ptr [RDI+16] | |
101 mov RSI,qword ptr [RDI+8] | |
102 mov RDI,qword ptr [RDI+0] | |
103 SYSCALL | |
104 ret | |
105 dcCall_x64_syscall_sysv ENDP | |
0 | 106 END |