aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/ia32
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2015-03-20 16:51:55 +0100
committerXavier Leroy <xavier.leroy@inria.fr>2015-03-20 16:51:55 +0100
commitc1205952ab7e3be09cd1a0a9a4d4ee9ddeefe1ea (patch)
tree49f4f1dbfb193d9c777759e07559f8a30f233066 /runtime/ia32
parenta90ffe0a21a3a813df4eb9a4dc23b06f50699cde (diff)
downloadcompcert-c1205952ab7e3be09cd1a0a9a4d4ee9ddeefe1ea.tar.gz
compcert-c1205952ab7e3be09cd1a0a9a4d4ee9ddeefe1ea.zip
Support va_arg for vararg arguments of composite (struct/union) types.
Now for IA32 and PowerPC as well.
Diffstat (limited to 'runtime/ia32')
-rw-r--r--runtime/ia32/vararg.S12
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/ia32/vararg.S b/runtime/ia32/vararg.S
index ec55a454..78666c70 100644
--- a/runtime/ia32/vararg.S
+++ b/runtime/ia32/vararg.S
@@ -67,3 +67,15 @@ FUNCTION(__compcert_va_float64)
movl %edx, 0(%ecx)
ret
ENDFUNCTION(__compcert_va_float64)
+
+FUNCTION(__compcert_va_composite)
+ movl 4(%esp), %ecx // %ecx = ap parameter
+ movl 8(%esp), %edx // %edx = size of composite in bytes
+ movl 0(%ecx), %eax // %eax = current argument pointer
+ leal 3(%eax, %edx), %edx // advance by size
+ andl $0xfffffffc, %edx // and round up to multiple of 4
+ movl %edx, 0(%ecx) // update argument pointer
+ ret
+ENDFUNCTION(__compcert_va_composite)
+
+