view dyncallback/dyncall_callback_x64_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 3e629dc19168
children
line wrap: on
line source

; auto-generated by gen-masm.sh
.CODE
DCThunk_size = 24
DCArgs_size_win64 = 96
DCArgs_size_sysv = 144
DCValue_size = 8
DCRetRegs_SystemV_size = 32
FRAME_arg0_win64 = 48
FRAME_arg0_sysv = 16
FRAME_return = 8
FRAME_parent = 0
CTX_thunk = 0
CTX_handler = 24
CTX_userdata = 32
CTX_aggr_ret_reg = 40
CTX_pad = 44
CTX_aggrs_pp = 48
DCCallback_size = 56
dcCallback_x64_sysv PROC
OPTION PROLOGUE:NONE, EPILOGUE:NONE
 push RBP
 mov RBP,RSP
 sub RSP,8*8
 movsd qword ptr [RSP+8*7],XMM7
 movsd qword ptr [RSP+8*6],XMM6
 movsd qword ptr [RSP+8*5],XMM5
 movsd qword ptr [RSP+8*4],XMM4
 movsd qword ptr [RSP+8*3],XMM3
 movsd qword ptr [RSP+8*2],XMM2
 movsd qword ptr [RSP+8*1],XMM1
 movsd qword ptr [RSP+8*0],XMM0
 push R9
 push R8
 push RCX
 push RDX
 push RSI
 push RDI
 mov R8,qword ptr [RAX+CTX_aggrs_pp]
 push R8
 mov R8D,dword ptr [RAX+CTX_aggr_ret_reg]
 push R8
 push 0
 lea RDX,qword ptr [RBP+FRAME_arg0_sysv]
 push RDX
 mov RSI,RSP
 sub RSP,4*8
 mov RDI,RAX
 mov RCX,qword ptr [RDI+CTX_userdata]
 mov RDX,RSP
 call qword ptr [RAX+CTX_handler]
 cmp dword ptr [RSP+48],-2
 je scalar_retval
  mov RAX,qword ptr [RSP+0]
  mov RDX,qword ptr [RSP+8]
  movsd XMM0,qword ptr [RSP+16]
  movsd XMM1,qword ptr [RSP+24]
 jmp epilog
scalar_retval:
  mov RAX,qword ptr [RSP+0]
  movd XMM0,RAX
epilog:
 mov RSP,RBP
 pop RBP
 ret
dcCallback_x64_sysv ENDP
dcCallback_x64_win64 PROC FRAME
OPTION EPILOGUE:NONE
 push RBP
 .pushreg RBP
 mov RBP,RSP
 .setframe RBP, 0
 .endprolog
 sub RSP,4*8
 movsd qword ptr [RSP+8*3],XMM3
 movsd qword ptr [RSP+8*2],XMM2
 movsd qword ptr [RSP+8*1],XMM1
 movsd qword ptr [RSP+8*0],XMM0
 push R9
 push R8
 push RDX
 push RCX
 mov R8,qword ptr [RAX+CTX_aggrs_pp]
 push R8
 mov R8D,dword ptr [RAX+CTX_aggr_ret_reg]
 push R8
 push 0
 lea RDX,qword ptr [RBP+FRAME_arg0_win64]
 push RDX
 mov RDX,RSP
 sub RSP,2*8
 mov RCX,RAX
 mov R9,qword ptr [RAX+CTX_userdata]
 mov R8,RSP
 sub RSP,4*8
 call qword ptr [RAX+CTX_handler]
 mov RAX,qword ptr [RSP+4*8]
 movd XMM0,RAX
 mov RSP,RBP
 pop RBP
 ret
dcCallback_x64_win64 ENDP
END