FFI: Compile calls to stdcall, fastcall and vararg functions.

This commit is contained in:
Mike Pall
2011-10-27 01:52:37 +02:00
parent 1d190c99a2
commit 2dc574d06b
14 changed files with 263 additions and 79 deletions

View File

@@ -85,6 +85,7 @@ enum {
#define REGARG_GPRS \
(RID_ECX|((RID_EDX|((RID_R8D|(RID_R9D<<5))<<5))<<5))
#define REGARG_NUMGPR 4
#define REGARG_NUMFPR 4
#define REGARG_FIRSTFPR RID_XMM0
#define REGARG_LASTFPR RID_XMM3
#define STACKARG_OFS (4*8)
@@ -96,6 +97,7 @@ enum {
(RID_EDI|((RID_ESI|((RID_EDX|((RID_ECX|((RID_R8D|(RID_R9D \
<<5))<<5))<<5))<<5))<<5))
#define REGARG_NUMGPR 6
#define REGARG_NUMFPR 8
#define REGARG_FIRSTFPR RID_XMM0
#define REGARG_LASTFPR RID_XMM7
#define STACKARG_OFS 0
@@ -105,6 +107,7 @@ enum {
#define RSET_SCRATCH (RSET_ACD|RSET_FPR)
#define REGARG_GPRS (RID_ECX|(RID_EDX<<5)) /* Fastcall only. */
#define REGARG_NUMGPR 2 /* Fastcall only. */
#define REGARG_NUMFPR 0
#define STACKARG_OFS 0
#endif
@@ -192,6 +195,7 @@ typedef enum {
XI_JCCs = 0x70, /* Really 7x. */
XI_JCCn = 0x80, /* Really 0f8x. */
XI_LEA = 0x8d,
XI_MOVrib = 0xb0, /* Really b0+r. */
XI_MOVri = 0xb8, /* Really b8+r. */
XI_ARITHib = 0x80,
XI_ARITHi = 0x81,