Mercurial > pub > dyncall > dyncall
comparison dyncallback/dyncall_args_x86.c @ 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 | f5577f6bf97a |
children | 111236b31c75 |
comparison
equal
deleted
inserted
replaced
532:d4bf63ab9164 | 533:71c884e610f0 |
---|---|
4 Library: dyncallback | 4 Library: dyncallback |
5 File: dyncallback/dyncall_args_x86.c | 5 File: dyncallback/dyncall_args_x86.c |
6 Description: Callback's Arguments VM - Implementation for x86 | 6 Description: Callback's Arguments VM - Implementation for x86 |
7 License: | 7 License: |
8 | 8 |
9 Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>, | 9 Copyright (c) 2007-2022 Daniel Adler <dadler@uni-goettingen.de>, |
10 Tassilo Philipp <tphilipp@potion-studios.com> | 10 Tassilo Philipp <tphilipp@potion-studios.com> |
11 | 11 |
12 Permission to use, copy, modify, and distribute this software for any | 12 Permission to use, copy, modify, and distribute this software for any |
13 purpose with or without fee is hereby granted, provided that the above | 13 purpose with or without fee is hereby granted, provided that the above |
14 copyright notice and this permission notice appear in all copies. | 14 copyright notice and this permission notice appear in all copies. |
24 */ | 24 */ |
25 | 25 |
26 | 26 |
27 #include "dyncall_args_x86.h" | 27 #include "dyncall_args_x86.h" |
28 | 28 |
29 /* ---------------------------------------------------------------------------- */ | |
30 /* C API implementation: */ | |
31 | 29 |
32 /* base operations */ | |
33 | 30 |
34 DCint dcbArgInt (DCArgs* p) { return p->vt->i32(p); } | 31 DCint dcbArgInt (DCArgs* p) { return p->vt->i32(p); } |
35 DClonglong dcbArgLongLong(DCArgs* p) { return p->vt->i64(p); } | 32 DClonglong dcbArgLongLong(DCArgs* p) { return p->vt->i64(p); } |
36 DCfloat dcbArgFloat (DCArgs* p) { return p->vt->f32(p); } | 33 DCfloat dcbArgFloat (DCArgs* p) { return p->vt->f32(p); } |
37 DCdouble dcbArgDouble (DCArgs* p) { return p->vt->f64(p); } | 34 DCdouble dcbArgDouble (DCArgs* p) { return p->vt->f64(p); } |
50 DCuchar dcbArgUChar (DCArgs* p) { return (DCuchar) dcbArgChar(p); } | 47 DCuchar dcbArgUChar (DCArgs* p) { return (DCuchar) dcbArgChar(p); } |
51 DCushort dcbArgUShort (DCArgs* p) { return (DCushort) dcbArgShort(p); } | 48 DCushort dcbArgUShort (DCArgs* p) { return (DCushort) dcbArgShort(p); } |
52 DCulong dcbArgULong (DCArgs* p) { return (DCulong) dcbArgLong(p); } | 49 DCulong dcbArgULong (DCArgs* p) { return (DCulong) dcbArgLong(p); } |
53 DCulonglong dcbArgULongLong(DCArgs* p) { return (DCulonglong) dcbArgLongLong(p); } | 50 DCulonglong dcbArgULongLong(DCArgs* p) { return (DCulonglong) dcbArgLongLong(p); } |
54 | 51 |
55 /* ---------------------------------------------------------------------------- */ | 52 void dcbArgAggr (DCArgs* p, DCpointer target) { /* @@@AGGR not impl */ } |
56 /* virtual tables: */ | 53 void dcbReturnAggr (DCArgs *args, DCValue *result, DCpointer ret) { /* @@@AGGR not impl */ } |
54 | |
55 | |
57 | 56 |
58 /* cdecl calling convention */ | 57 /* cdecl calling convention */ |
59 | 58 |
60 static int default_i32(DCArgs* args) | 59 static int default_i32(DCArgs* args) |
61 { | 60 { |
118 args->fast_count += 2; | 117 args->fast_count += 2; |
119 return default_i64(args); | 118 return default_i64(args); |
120 } | 119 } |
121 | 120 |
122 DCArgsVT dcArgsVT_fast_gnu = { fast_i32, fast_gnu_i64, default_f32, default_f64 }; | 121 DCArgsVT dcArgsVT_fast_gnu = { fast_i32, fast_gnu_i64, default_f32, default_f64 }; |
122 |