aboutsummaryrefslogtreecommitdiff
path: root/lib/alloca86_64.S
diff options
context:
space:
mode:
Diffstat (limited to 'lib/alloca86_64.S')
-rw-r--r--lib/alloca86_64.S9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/alloca86_64.S b/lib/alloca86_64.S
index 684a3e9..13c4672 100644
--- a/lib/alloca86_64.S
+++ b/lib/alloca86_64.S
@@ -7,13 +7,16 @@
alloca:
pop %rdx
+#ifdef TCC_TARGET_PE
+ mov %rcx,%rax
+#else
mov %rdi,%rax
+#endif
add $15,%rax
and $-16,%rax
jz p3
#ifdef TCC_TARGET_PE
- /* XXX: not tested */
p1:
cmp $4096,%rax
jle p2
@@ -26,6 +29,10 @@ p2:
sub %rax,%rsp
mov %rsp,%rax
+#ifdef TCC_TARGET_PE
+ add $32,%rax
+#endif
+
p3:
push %rdx
ret