view test/gen-masm/call_x64.masm @ 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 3e629dc19168
children
line wrap: on
line source

.CODE

dcCall_x64_sysv PROC
OPTION PROLOGUE:NONE, EPILOGUE:NONE
 push rbp
 push rbx
 mov rbp, rsp
 mov rbx, r8
 movsd xmm0, qword ptr[rcx ]
 movsd xmm1, qword ptr[rcx+ 8]
 movsd xmm2, qword ptr[rcx+16]
 movsd xmm3, qword ptr[rcx+24]
 movsd xmm4, qword ptr[rcx+32]
 movsd xmm5, qword ptr[rcx+40]
 movsd xmm6, qword ptr[rcx+48]
 movsd xmm7, qword ptr[rcx+56]
 sub rsp, rdi
 mov rax, rdi
 add rax, 8
 and rax, 15
 sub rsp, rax
 mov rcx, rdi
 mov rdi, rsp
 rep movsb
 mov rdi, qword ptr[rdx ]
 mov rsi, qword ptr[rdx+ 8]
 mov rcx, qword ptr[rdx+24]
 mov r8, qword ptr[rdx+32]
 mov r9, qword ptr[rdx+40]
 mov rdx, qword ptr[rdx+16]
 mov al, 8
 call rbx
 mov rsp, rbp
 pop rbx
 pop rbp
 ret
dcCall_x64_sysv ENDP
dcCall_x64_win64 PROC
OPTION PROLOGUE:NONE, EPILOGUE:NONE
 push rbp
 push rsi
 push rdi
 mov rbp, rsp
 sub rsp, rcx
 mov rax, rcx
 add rax, 8
 and rax, 15
 sub rsp, rax
 mov rsi, rdx
 mov rdi, rsp
 mov rax, r9
 rep movsb
 mov rcx, qword ptr[r8 ]
 mov rdx, qword ptr[r8+ 8]
 mov r9, qword ptr[r8+24]
 mov r8, qword ptr[r8+16]
 movd xmm0, rcx
 movd xmm1, rdx
 movd xmm2, r8
 movd xmm3, r9
 push r9
 push r8
 push rdx
 push rcx
 call rax
 mov rsp, rbp
 pop rdi
 pop rsi
 pop rbp
 ret
dcCall_x64_win64 ENDP
END