tinycc/lib/alloca86.S
grischka aeb8f427e2 tccgen: introduce TOK_NEG for unary minus
for floats (currently only).  On x86_64 uses built-in fp
constants (in libtcc1.c) to avoid multiple anonymous
instances.

Also: win32/i386: use __alloca for big struct stack store
- use new function int tok_alloc_const(const char*);
- change alloca86.S to preserve EDX

tccelf.c: fix a warning with 'roinf_use'
2021-01-06 01:44:22 +01:00

37 lines
661 B
ArmAsm

/* ---------------------------------------------- */
/* alloca86.S */
#ifdef __leading_underscore
# define _(s) _##s
#else
# define _(s) s
#endif
.globl _(alloca), _(__alloca)
_(alloca):
_(__alloca):
push %ebp
mov %esp,%ebp
mov 8(%ebp),%eax
add $3,%eax
and $-4,%eax
#ifdef _WIN32
jmp .+16 #p2
p1:
sub $4096,%esp
sub $4096,%eax
test %eax,(%esp)
p2:
cmp $4096,%eax
jae p1
#endif
sub %eax,%esp
mov 4(%ebp),%eax
mov 0(%ebp),%ebp
add $8,%esp
push %eax
lea 8(%esp),%eax
ret
/* ---------------------------------------------- */