Fix return_uc.c test case on windows.

This commit is contained in:
Peter Rosin
2012-04-03 07:40:31 -04:00
committed by Anthony Green
parent 65f40c35a2
commit 3afaa9a34a
8 changed files with 6490 additions and 46 deletions

View File

@@ -6,3 +6,4 @@ win32_tests
vararg_float_test_fix vararg_float_test_fix
vfp-eabi vfp-eabi
msvc-changes msvc-changes
win32-return-sign

View File

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,11 @@
2012-04-02 Peter Rosin <peda@lysator.liu.se>
* src/x86/win32.S (ffi_call_win32): Sign/zero extend the return
value in the Intel version as is already done for the AT&T version.
(ffi_closure_SYSV): Likewise.
(ffi_closure_raw_SYSV): Likewise.
(ffi_closure_STDCALL): Likewise.
2012-03-29 Peter Rosin <peda@lysator.liu.se> 2012-03-29 Peter Rosin <peda@lysator.liu.se>
* src/x86/win32.S (ffi_closure_raw_THISCALL): Unify the frame * src/x86/win32.S (ffi_closure_raw_THISCALL): Unify the frame

View File

@@ -7,3 +7,4 @@ win32_tests
vararg_float_test_fix vararg_float_test_fix
vfp-eabi vfp-eabi
msvc-changes msvc-changes
win32-return-sign

231
patches/win32-return-sign Normal file
View File

@@ -0,0 +1,231 @@
Index: libffi/ChangeLog
===================================================================
--- libffi.orig/ChangeLog
+++ libffi/ChangeLog
@@ -1,3 +1,11 @@
+2012-04-02 Peter Rosin <peda@lysator.liu.se>
+
+ * src/x86/win32.S (ffi_call_win32): Sign/zero extend the return
+ value in the Intel version as is already done for the AT&T version.
+ (ffi_closure_SYSV): Likewise.
+ (ffi_closure_raw_SYSV): Likewise.
+ (ffi_closure_STDCALL): Likewise.
+
2012-03-29 Peter Rosin <peda@lysator.liu.se>
* src/x86/win32.S (ffi_closure_raw_THISCALL): Unify the frame
Index: libffi/src/x86/win32.S
===================================================================
--- libffi.orig/src/x86/win32.S
+++ libffi/src/x86/win32.S
@@ -108,32 +108,37 @@ ca_jumpdata:
dd offset ca_retfloat ;; FFI_TYPE_FLOAT
dd offset ca_retdouble ;; FFI_TYPE_DOUBLE
dd offset ca_retlongdouble ;; FFI_TYPE_LONGDOUBLE
- dd offset ca_retint8 ;; FFI_TYPE_UINT8
- dd offset ca_retint8 ;; FFI_TYPE_SINT8
- dd offset ca_retint16 ;; FFI_TYPE_UINT16
- dd offset ca_retint16 ;; FFI_TYPE_SINT16
+ dd offset ca_retuint8 ;; FFI_TYPE_UINT8
+ dd offset ca_retsint8 ;; FFI_TYPE_SINT8
+ dd offset ca_retuint16 ;; FFI_TYPE_UINT16
+ dd offset ca_retsint16 ;; FFI_TYPE_SINT16
dd offset ca_retint ;; FFI_TYPE_UINT32
dd offset ca_retint ;; FFI_TYPE_SINT32
dd offset ca_retint64 ;; FFI_TYPE_UINT64
dd offset ca_retint64 ;; FFI_TYPE_SINT64
dd offset ca_epilogue ;; FFI_TYPE_STRUCT
dd offset ca_retint ;; FFI_TYPE_POINTER
- dd offset ca_retint8 ;; FFI_TYPE_SMALL_STRUCT_1B
- dd offset ca_retint16 ;; FFI_TYPE_SMALL_STRUCT_2B
+ dd offset ca_retstruct1b ;; FFI_TYPE_SMALL_STRUCT_1B
+ dd offset ca_retstruct2b ;; FFI_TYPE_SMALL_STRUCT_2B
dd offset ca_retint ;; FFI_TYPE_SMALL_STRUCT_4B
dd offset ca_epilogue ;; FFI_TYPE_MS_STRUCT
-ca_retint8:
- ;; Load %ecx with the pointer to storage for the return value
- mov ecx, rvalue
- mov [ecx + 0], al
- jmp ca_epilogue
-
-ca_retint16:
- ;; Load %ecx with the pointer to storage for the return value
- mov ecx, rvalue
- mov [ecx + 0], ax
- jmp ca_epilogue
+ /* Sign/zero extend as appropriate. */
+ca_retuint8:
+ movzx eax, al
+ jmp ca_retint
+
+ca_retsint8:
+ movsx eax, al
+ jmp ca_retint
+
+ca_retuint16:
+ movzx eax, ax
+ jmp ca_retint
+
+ca_retsint16:
+ movsx eax, ax
+ jmp ca_retint
ca_retint:
;; Load %ecx with the pointer to storage for the return value
@@ -166,6 +171,18 @@ ca_retlongdouble:
fstp TBYTE PTR [ecx]
jmp ca_epilogue
+ca_retstruct1b:
+ ;; Load %ecx with the pointer to storage for the return value
+ mov ecx, rvalue
+ mov [ecx + 0], al
+ jmp ca_epilogue
+
+ca_retstruct2b:
+ ;; Load %ecx with the pointer to storage for the return value
+ mov ecx, rvalue
+ mov [ecx + 0], ax
+ jmp ca_epilogue
+
ca_epilogue:
;; Epilogue code is autogenerated.
ret
@@ -203,27 +220,35 @@ cs_jumpdata:
dd offset cs_retfloat ;; FFI_TYPE_FLOAT
dd offset cs_retdouble ;; FFI_TYPE_DOUBLE
dd offset cs_retlongdouble ;; FFI_TYPE_LONGDOUBLE
- dd offset cs_retint8 ;; FFI_TYPE_UINT8
- dd offset cs_retint8 ;; FFI_TYPE_SINT8
- dd offset cs_retint16 ;; FFI_TYPE_UINT16
- dd offset cs_retint16 ;; FFI_TYPE_SINT16
+ dd offset cs_retuint8 ;; FFI_TYPE_UINT8
+ dd offset cs_retsint8 ;; FFI_TYPE_SINT8
+ dd offset cs_retuint16 ;; FFI_TYPE_UINT16
+ dd offset cs_retsint16 ;; FFI_TYPE_SINT16
dd offset cs_retint ;; FFI_TYPE_UINT32
dd offset cs_retint ;; FFI_TYPE_SINT32
dd offset cs_retint64 ;; FFI_TYPE_UINT64
dd offset cs_retint64 ;; FFI_TYPE_SINT64
dd offset cs_retstruct ;; FFI_TYPE_STRUCT
dd offset cs_retint ;; FFI_TYPE_POINTER
- dd offset cs_retint8 ;; FFI_TYPE_SMALL_STRUCT_1B
- dd offset cs_retint16 ;; FFI_TYPE_SMALL_STRUCT_2B
+ dd offset cs_retsint8 ;; FFI_TYPE_SMALL_STRUCT_1B
+ dd offset cs_retsint16 ;; FFI_TYPE_SMALL_STRUCT_2B
dd offset cs_retint ;; FFI_TYPE_SMALL_STRUCT_4B
dd offset cs_retmsstruct ;; FFI_TYPE_MS_STRUCT
-cs_retint8:
- mov al, [ecx]
+cs_retuint8:
+ movzx eax, BYTE PTR [ecx]
+ jmp cs_epilogue
+
+cs_retsint8:
+ movsx eax, BYTE PTR [ecx]
+ jmp cs_epilogue
+
+cs_retuint16:
+ movzx eax, WORD PTR [ecx]
jmp cs_epilogue
-cs_retint16:
- mov ax, [ecx]
+cs_retsint16:
+ movsx eax, WORD PTR [ecx]
jmp cs_epilogue
cs_retint:
@@ -305,27 +330,35 @@ cr_jumpdata:
dd offset cr_retfloat ;; FFI_TYPE_FLOAT
dd offset cr_retdouble ;; FFI_TYPE_DOUBLE
dd offset cr_retlongdouble ;; FFI_TYPE_LONGDOUBLE
- dd offset cr_retint8 ;; FFI_TYPE_UINT8
- dd offset cr_retint8 ;; FFI_TYPE_SINT8
- dd offset cr_retint16 ;; FFI_TYPE_UINT16
- dd offset cr_retint16 ;; FFI_TYPE_SINT16
+ dd offset cr_retuint8 ;; FFI_TYPE_UINT8
+ dd offset cr_retsint8 ;; FFI_TYPE_SINT8
+ dd offset cr_retuint16 ;; FFI_TYPE_UINT16
+ dd offset cr_retsint16 ;; FFI_TYPE_SINT16
dd offset cr_retint ;; FFI_TYPE_UINT32
dd offset cr_retint ;; FFI_TYPE_SINT32
dd offset cr_retint64 ;; FFI_TYPE_UINT64
dd offset cr_retint64 ;; FFI_TYPE_SINT64
dd offset cr_epilogue ;; FFI_TYPE_STRUCT
dd offset cr_retint ;; FFI_TYPE_POINTER
- dd offset cr_retint8 ;; FFI_TYPE_SMALL_STRUCT_1B
- dd offset cr_retint16 ;; FFI_TYPE_SMALL_STRUCT_2B
+ dd offset cr_retsint8 ;; FFI_TYPE_SMALL_STRUCT_1B
+ dd offset cr_retsint16 ;; FFI_TYPE_SMALL_STRUCT_2B
dd offset cr_retint ;; FFI_TYPE_SMALL_STRUCT_4B
dd offset cr_epilogue ;; FFI_TYPE_MS_STRUCT
-cr_retint8:
- mov al, [ecx]
+cr_retuint8:
+ movzx eax, BYTE PTR [ecx]
jmp cr_epilogue
-cr_retint16:
- mov ax, [ecx]
+cr_retsint8:
+ movsx eax, BYTE PTR [ecx]
+ jmp cr_epilogue
+
+cr_retuint16:
+ movzx eax, WORD PTR [ecx]
+ jmp cr_epilogue
+
+cr_retsint16:
+ movsx eax, WORD PTR [ecx]
jmp cr_epilogue
cr_retint:
@@ -379,26 +412,34 @@ cd_jumpdata:
dd offset cd_retfloat ;; FFI_TYPE_FLOAT
dd offset cd_retdouble ;; FFI_TYPE_DOUBLE
dd offset cd_retlongdouble ;; FFI_TYPE_LONGDOUBLE
- dd offset cd_retint8 ;; FFI_TYPE_UINT8
- dd offset cd_retint8 ;; FFI_TYPE_SINT8
- dd offset cd_retint16 ;; FFI_TYPE_UINT16
- dd offset cd_retint16 ;; FFI_TYPE_SINT16
+ dd offset cd_retuint8 ;; FFI_TYPE_UINT8
+ dd offset cd_retsint8 ;; FFI_TYPE_SINT8
+ dd offset cd_retuint16 ;; FFI_TYPE_UINT16
+ dd offset cd_retsint16 ;; FFI_TYPE_SINT16
dd offset cd_retint ;; FFI_TYPE_UINT32
dd offset cd_retint ;; FFI_TYPE_SINT32
dd offset cd_retint64 ;; FFI_TYPE_UINT64
dd offset cd_retint64 ;; FFI_TYPE_SINT64
dd offset cd_epilogue ;; FFI_TYPE_STRUCT
dd offset cd_retint ;; FFI_TYPE_POINTER
- dd offset cd_retint8 ;; FFI_TYPE_SMALL_STRUCT_1B
- dd offset cd_retint16 ;; FFI_TYPE_SMALL_STRUCT_2B
+ dd offset cd_retsint8 ;; FFI_TYPE_SMALL_STRUCT_1B
+ dd offset cd_retsint16 ;; FFI_TYPE_SMALL_STRUCT_2B
dd offset cd_retint ;; FFI_TYPE_SMALL_STRUCT_4B
-cd_retint8:
- mov al, [ecx]
+cd_retuint8:
+ movzx eax, BYTE PTR [ecx]
+ jmp cd_epilogue
+
+cd_retsint8:
+ movsx eax, BYTE PTR [ecx]
+ jmp cd_epilogue
+
+cd_retuint16:
+ movzx eax, WORD PTR [ecx]
jmp cd_epilogue
-cd_retint16:
- mov ax, [ecx]
+cd_retsint16:
+ movsx eax, WORD PTR [ecx]
jmp cd_epilogue
cd_retint:

View File

@@ -108,32 +108,37 @@ ca_jumpdata:
dd offset ca_retfloat ;; FFI_TYPE_FLOAT dd offset ca_retfloat ;; FFI_TYPE_FLOAT
dd offset ca_retdouble ;; FFI_TYPE_DOUBLE dd offset ca_retdouble ;; FFI_TYPE_DOUBLE
dd offset ca_retlongdouble ;; FFI_TYPE_LONGDOUBLE dd offset ca_retlongdouble ;; FFI_TYPE_LONGDOUBLE
dd offset ca_retint8 ;; FFI_TYPE_UINT8 dd offset ca_retuint8 ;; FFI_TYPE_UINT8
dd offset ca_retint8 ;; FFI_TYPE_SINT8 dd offset ca_retsint8 ;; FFI_TYPE_SINT8
dd offset ca_retint16 ;; FFI_TYPE_UINT16 dd offset ca_retuint16 ;; FFI_TYPE_UINT16
dd offset ca_retint16 ;; FFI_TYPE_SINT16 dd offset ca_retsint16 ;; FFI_TYPE_SINT16
dd offset ca_retint ;; FFI_TYPE_UINT32 dd offset ca_retint ;; FFI_TYPE_UINT32
dd offset ca_retint ;; FFI_TYPE_SINT32 dd offset ca_retint ;; FFI_TYPE_SINT32
dd offset ca_retint64 ;; FFI_TYPE_UINT64 dd offset ca_retint64 ;; FFI_TYPE_UINT64
dd offset ca_retint64 ;; FFI_TYPE_SINT64 dd offset ca_retint64 ;; FFI_TYPE_SINT64
dd offset ca_epilogue ;; FFI_TYPE_STRUCT dd offset ca_epilogue ;; FFI_TYPE_STRUCT
dd offset ca_retint ;; FFI_TYPE_POINTER dd offset ca_retint ;; FFI_TYPE_POINTER
dd offset ca_retint8 ;; FFI_TYPE_SMALL_STRUCT_1B dd offset ca_retstruct1b ;; FFI_TYPE_SMALL_STRUCT_1B
dd offset ca_retint16 ;; FFI_TYPE_SMALL_STRUCT_2B dd offset ca_retstruct2b ;; FFI_TYPE_SMALL_STRUCT_2B
dd offset ca_retint ;; FFI_TYPE_SMALL_STRUCT_4B dd offset ca_retint ;; FFI_TYPE_SMALL_STRUCT_4B
dd offset ca_epilogue ;; FFI_TYPE_MS_STRUCT dd offset ca_epilogue ;; FFI_TYPE_MS_STRUCT
ca_retint8: /* Sign/zero extend as appropriate. */
;; Load %ecx with the pointer to storage for the return value ca_retuint8:
mov ecx, rvalue movzx eax, al
mov [ecx + 0], al jmp ca_retint
jmp ca_epilogue
ca_retint16: ca_retsint8:
;; Load %ecx with the pointer to storage for the return value movsx eax, al
mov ecx, rvalue jmp ca_retint
mov [ecx + 0], ax
jmp ca_epilogue ca_retuint16:
movzx eax, ax
jmp ca_retint
ca_retsint16:
movsx eax, ax
jmp ca_retint
ca_retint: ca_retint:
;; Load %ecx with the pointer to storage for the return value ;; Load %ecx with the pointer to storage for the return value
@@ -166,6 +171,18 @@ ca_retlongdouble:
fstp TBYTE PTR [ecx] fstp TBYTE PTR [ecx]
jmp ca_epilogue jmp ca_epilogue
ca_retstruct1b:
;; Load %ecx with the pointer to storage for the return value
mov ecx, rvalue
mov [ecx + 0], al
jmp ca_epilogue
ca_retstruct2b:
;; Load %ecx with the pointer to storage for the return value
mov ecx, rvalue
mov [ecx + 0], ax
jmp ca_epilogue
ca_epilogue: ca_epilogue:
;; Epilogue code is autogenerated. ;; Epilogue code is autogenerated.
ret ret
@@ -203,27 +220,35 @@ cs_jumpdata:
dd offset cs_retfloat ;; FFI_TYPE_FLOAT dd offset cs_retfloat ;; FFI_TYPE_FLOAT
dd offset cs_retdouble ;; FFI_TYPE_DOUBLE dd offset cs_retdouble ;; FFI_TYPE_DOUBLE
dd offset cs_retlongdouble ;; FFI_TYPE_LONGDOUBLE dd offset cs_retlongdouble ;; FFI_TYPE_LONGDOUBLE
dd offset cs_retint8 ;; FFI_TYPE_UINT8 dd offset cs_retuint8 ;; FFI_TYPE_UINT8
dd offset cs_retint8 ;; FFI_TYPE_SINT8 dd offset cs_retsint8 ;; FFI_TYPE_SINT8
dd offset cs_retint16 ;; FFI_TYPE_UINT16 dd offset cs_retuint16 ;; FFI_TYPE_UINT16
dd offset cs_retint16 ;; FFI_TYPE_SINT16 dd offset cs_retsint16 ;; FFI_TYPE_SINT16
dd offset cs_retint ;; FFI_TYPE_UINT32 dd offset cs_retint ;; FFI_TYPE_UINT32
dd offset cs_retint ;; FFI_TYPE_SINT32 dd offset cs_retint ;; FFI_TYPE_SINT32
dd offset cs_retint64 ;; FFI_TYPE_UINT64 dd offset cs_retint64 ;; FFI_TYPE_UINT64
dd offset cs_retint64 ;; FFI_TYPE_SINT64 dd offset cs_retint64 ;; FFI_TYPE_SINT64
dd offset cs_retstruct ;; FFI_TYPE_STRUCT dd offset cs_retstruct ;; FFI_TYPE_STRUCT
dd offset cs_retint ;; FFI_TYPE_POINTER dd offset cs_retint ;; FFI_TYPE_POINTER
dd offset cs_retint8 ;; FFI_TYPE_SMALL_STRUCT_1B dd offset cs_retsint8 ;; FFI_TYPE_SMALL_STRUCT_1B
dd offset cs_retint16 ;; FFI_TYPE_SMALL_STRUCT_2B dd offset cs_retsint16 ;; FFI_TYPE_SMALL_STRUCT_2B
dd offset cs_retint ;; FFI_TYPE_SMALL_STRUCT_4B dd offset cs_retint ;; FFI_TYPE_SMALL_STRUCT_4B
dd offset cs_retmsstruct ;; FFI_TYPE_MS_STRUCT dd offset cs_retmsstruct ;; FFI_TYPE_MS_STRUCT
cs_retint8: cs_retuint8:
mov al, [ecx] movzx eax, BYTE PTR [ecx]
jmp cs_epilogue jmp cs_epilogue
cs_retint16: cs_retsint8:
mov ax, [ecx] movsx eax, BYTE PTR [ecx]
jmp cs_epilogue
cs_retuint16:
movzx eax, WORD PTR [ecx]
jmp cs_epilogue
cs_retsint16:
movsx eax, WORD PTR [ecx]
jmp cs_epilogue jmp cs_epilogue
cs_retint: cs_retint:
@@ -305,27 +330,35 @@ cr_jumpdata:
dd offset cr_retfloat ;; FFI_TYPE_FLOAT dd offset cr_retfloat ;; FFI_TYPE_FLOAT
dd offset cr_retdouble ;; FFI_TYPE_DOUBLE dd offset cr_retdouble ;; FFI_TYPE_DOUBLE
dd offset cr_retlongdouble ;; FFI_TYPE_LONGDOUBLE dd offset cr_retlongdouble ;; FFI_TYPE_LONGDOUBLE
dd offset cr_retint8 ;; FFI_TYPE_UINT8 dd offset cr_retuint8 ;; FFI_TYPE_UINT8
dd offset cr_retint8 ;; FFI_TYPE_SINT8 dd offset cr_retsint8 ;; FFI_TYPE_SINT8
dd offset cr_retint16 ;; FFI_TYPE_UINT16 dd offset cr_retuint16 ;; FFI_TYPE_UINT16
dd offset cr_retint16 ;; FFI_TYPE_SINT16 dd offset cr_retsint16 ;; FFI_TYPE_SINT16
dd offset cr_retint ;; FFI_TYPE_UINT32 dd offset cr_retint ;; FFI_TYPE_UINT32
dd offset cr_retint ;; FFI_TYPE_SINT32 dd offset cr_retint ;; FFI_TYPE_SINT32
dd offset cr_retint64 ;; FFI_TYPE_UINT64 dd offset cr_retint64 ;; FFI_TYPE_UINT64
dd offset cr_retint64 ;; FFI_TYPE_SINT64 dd offset cr_retint64 ;; FFI_TYPE_SINT64
dd offset cr_epilogue ;; FFI_TYPE_STRUCT dd offset cr_epilogue ;; FFI_TYPE_STRUCT
dd offset cr_retint ;; FFI_TYPE_POINTER dd offset cr_retint ;; FFI_TYPE_POINTER
dd offset cr_retint8 ;; FFI_TYPE_SMALL_STRUCT_1B dd offset cr_retsint8 ;; FFI_TYPE_SMALL_STRUCT_1B
dd offset cr_retint16 ;; FFI_TYPE_SMALL_STRUCT_2B dd offset cr_retsint16 ;; FFI_TYPE_SMALL_STRUCT_2B
dd offset cr_retint ;; FFI_TYPE_SMALL_STRUCT_4B dd offset cr_retint ;; FFI_TYPE_SMALL_STRUCT_4B
dd offset cr_epilogue ;; FFI_TYPE_MS_STRUCT dd offset cr_epilogue ;; FFI_TYPE_MS_STRUCT
cr_retint8: cr_retuint8:
mov al, [ecx] movzx eax, BYTE PTR [ecx]
jmp cr_epilogue jmp cr_epilogue
cr_retint16: cr_retsint8:
mov ax, [ecx] movsx eax, BYTE PTR [ecx]
jmp cr_epilogue
cr_retuint16:
movzx eax, WORD PTR [ecx]
jmp cr_epilogue
cr_retsint16:
movsx eax, WORD PTR [ecx]
jmp cr_epilogue jmp cr_epilogue
cr_retint: cr_retint:
@@ -379,26 +412,34 @@ cd_jumpdata:
dd offset cd_retfloat ;; FFI_TYPE_FLOAT dd offset cd_retfloat ;; FFI_TYPE_FLOAT
dd offset cd_retdouble ;; FFI_TYPE_DOUBLE dd offset cd_retdouble ;; FFI_TYPE_DOUBLE
dd offset cd_retlongdouble ;; FFI_TYPE_LONGDOUBLE dd offset cd_retlongdouble ;; FFI_TYPE_LONGDOUBLE
dd offset cd_retint8 ;; FFI_TYPE_UINT8 dd offset cd_retuint8 ;; FFI_TYPE_UINT8
dd offset cd_retint8 ;; FFI_TYPE_SINT8 dd offset cd_retsint8 ;; FFI_TYPE_SINT8
dd offset cd_retint16 ;; FFI_TYPE_UINT16 dd offset cd_retuint16 ;; FFI_TYPE_UINT16
dd offset cd_retint16 ;; FFI_TYPE_SINT16 dd offset cd_retsint16 ;; FFI_TYPE_SINT16
dd offset cd_retint ;; FFI_TYPE_UINT32 dd offset cd_retint ;; FFI_TYPE_UINT32
dd offset cd_retint ;; FFI_TYPE_SINT32 dd offset cd_retint ;; FFI_TYPE_SINT32
dd offset cd_retint64 ;; FFI_TYPE_UINT64 dd offset cd_retint64 ;; FFI_TYPE_UINT64
dd offset cd_retint64 ;; FFI_TYPE_SINT64 dd offset cd_retint64 ;; FFI_TYPE_SINT64
dd offset cd_epilogue ;; FFI_TYPE_STRUCT dd offset cd_epilogue ;; FFI_TYPE_STRUCT
dd offset cd_retint ;; FFI_TYPE_POINTER dd offset cd_retint ;; FFI_TYPE_POINTER
dd offset cd_retint8 ;; FFI_TYPE_SMALL_STRUCT_1B dd offset cd_retsint8 ;; FFI_TYPE_SMALL_STRUCT_1B
dd offset cd_retint16 ;; FFI_TYPE_SMALL_STRUCT_2B dd offset cd_retsint16 ;; FFI_TYPE_SMALL_STRUCT_2B
dd offset cd_retint ;; FFI_TYPE_SMALL_STRUCT_4B dd offset cd_retint ;; FFI_TYPE_SMALL_STRUCT_4B
cd_retint8: cd_retuint8:
mov al, [ecx] movzx eax, BYTE PTR [ecx]
jmp cd_epilogue jmp cd_epilogue
cd_retint16: cd_retsint8:
mov ax, [ecx] movsx eax, BYTE PTR [ecx]
jmp cd_epilogue
cd_retuint16:
movzx eax, WORD PTR [ecx]
jmp cd_epilogue
cd_retsint16:
movsx eax, WORD PTR [ecx]
jmp cd_epilogue jmp cd_epilogue
cd_retint: cd_retint: