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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
1 ; auto-generated by gen-masm.sh
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
2 .CODE
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
3 dcCall_x64_sysv PROC
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
4 OPTION PROLOGUE:NONE, EPILOGUE:NONE
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
5 push RBP
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
6 push RBX
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
7 mov RBP,RSP
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
8 mov RBX,R8
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
9 movsd XMM0,qword ptr [RCX+0]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
10 movsd XMM1,qword ptr [RCX+8]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
11 movsd XMM2,qword ptr [RCX+16]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
12 movsd XMM3,qword ptr [RCX+24]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
13 movsd XMM4,qword ptr [RCX+32]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
14 movsd XMM5,qword ptr [RCX+40]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
15 movsd XMM6,qword ptr [RCX+48]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
16 movsd XMM7,qword ptr [RCX+56]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
17 add RDI,31
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
18 and RDI,-32
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
19 add RDI,8
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
20 sub RSP,RDI
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
21 mov RCX,RDI
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
22 mov RDI,RSP
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
23 rep movsb
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
24 mov RDI,qword ptr [RDX+0]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
25 mov RSI,qword ptr [RDX+8]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
26 mov RCX,qword ptr [RDX+24]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
27 mov R8,qword ptr [RDX+32]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
28 mov R9,qword ptr [RDX+40]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
29 mov RDX,qword ptr [RDX+16]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
30 mov AL,8
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
31 call RBX
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
32 mov RSP,RBP
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
33 pop RBX
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
34 pop RBP
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
35 ret
341
ab2d78e48ca2 - gen-masm
Tassilo Philipp
parents: 0
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
50 push RBP
533
71c884e610f0 - integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents: 341
diff changeset
51 .pushreg RBP
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
52 push RSI
533
71c884e610f0 - integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents: 341
diff changeset
53 .pushreg RSI
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
54 push RDI
533
71c884e610f0 - integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents: 341
diff changeset
55 .pushreg RDI
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
59 add RCX,15
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
60 and RCX,-16
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
61 sub RSP,RCX
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
62 mov RSI,RDX
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
63 mov RDI,RSP
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
64 mov RAX,R9
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
65 rep movsb
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
66 mov RCX,qword ptr [R8+0]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
67 mov RDX,qword ptr [R8+8]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
68 mov R9,qword ptr [R8+24]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
69 mov R8,qword ptr [R8+16]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
70 movd XMM0,RCX
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
71 movd XMM1,RDX
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
72 movd XMM2,R8
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
73 movd XMM3,R9
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
74 push R9
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
75 push R8
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
76 push RDX
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
77 push RCX
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
78 call RAX
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
79 mov RSP,RBP
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
80 pop RDI
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
81 pop RSI
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
82 pop RBP
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
83 ret
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
ab2d78e48ca2 - gen-masm
Tassilo Philipp
parents: 0
diff changeset
94 dcCall_x64_syscall_sysv PROC
ab2d78e48ca2 - gen-masm
Tassilo Philipp
parents: 0
diff changeset
95 OPTION PROLOGUE:NONE, EPILOGUE:NONE
ab2d78e48ca2 - gen-masm
Tassilo Philipp
parents: 0
diff changeset
96 mov RAX,RSI
ab2d78e48ca2 - gen-masm
Tassilo Philipp
parents: 0
diff changeset
97 mov R9,qword ptr [RDI+40]
ab2d78e48ca2 - gen-masm
Tassilo Philipp
parents: 0
diff changeset
98 mov R8,qword ptr [RDI+32]
ab2d78e48ca2 - gen-masm
Tassilo Philipp
parents: 0
diff changeset
99 mov R10,qword ptr [RDI+24]
ab2d78e48ca2 - gen-masm
Tassilo Philipp
parents: 0
diff changeset
100 mov RDX,qword ptr [RDI+16]
ab2d78e48ca2 - gen-masm
Tassilo Philipp
parents: 0
diff changeset
101 mov RSI,qword ptr [RDI+8]
ab2d78e48ca2 - gen-masm
Tassilo Philipp
parents: 0
diff changeset
102 mov RDI,qword ptr [RDI+0]
ab2d78e48ca2 - gen-masm
Tassilo Philipp
parents: 0
diff changeset
103 SYSCALL
ab2d78e48ca2 - gen-masm
Tassilo Philipp
parents: 0
diff changeset
104 ret
ab2d78e48ca2 - gen-masm
Tassilo Philipp
parents: 0
diff changeset
105 dcCall_x64_syscall_sysv ENDP
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
106 END