summaryrefslogtreecommitdiff
path: root/lib/alloca86.S
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@celest.fr>2010-03-13 11:03:40 +0100
committerThomas Preud'homme <thomas.preudhomme@celest.fr>2010-03-13 11:03:40 +0100
commit406bee985de85229e0ba54a9efa767c194262d0c (patch)
tree2dee8785db170e33b235771ebdf7d43985b80c31 /lib/alloca86.S
parentfa3f0c7c00c4e5da92e4e4f1a06f193507d56261 (diff)
Imported Upstream version 0.9.25
Diffstat (limited to 'lib/alloca86.S')
-rw-r--r--lib/alloca86.S33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/alloca86.S b/lib/alloca86.S
new file mode 100644
index 0000000..fb208a0
--- /dev/null
+++ b/lib/alloca86.S
@@ -0,0 +1,33 @@
+/* ---------------------------------------------- */
+/* alloca86.S */
+
+#include "../config.h"
+
+.globl alloca
+
+alloca:
+ pop %edx
+ pop %eax
+ add $3,%eax
+ and $-4,%eax
+ jz p3
+
+#ifdef TCC_TARGET_PE
+p1:
+ cmp $4096,%eax
+ jle p2
+ sub $4096,%esp
+ sub $4096,%eax
+ test %eax,(%esp)
+ jmp p1
+p2:
+#endif
+
+ sub %eax,%esp
+ mov %esp,%eax
+p3:
+ push %edx
+ push %edx
+ ret
+
+/* ---------------------------------------------- */