History

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'

grischka committed 5 years ago

Commit aeb8f421 parent a5865fa11 files · +145 −100Browse files

Showing the changes to lib (2 of 11 files). Show all

Unified · Split

2 files
  1. lib/alloca86.S +14 −14
  2. lib/libtcc1.c +6 −0
lib/alloca86.S+14−14
@@ -7,30 +7,30 @@ · 6 unmodified lines
7# define _(s) s7# define _(s) s
8#endif8#endif
9 9
10.globl _(alloca)10.globl _(alloca), _(__alloca)
11_(alloca):11_(alloca):
12 pop %edx12_(__alloca):
13 pop %eax13 push %ebp
14 mov %esp,%ebp
15 mov 8(%ebp),%eax
14 add $3,%eax16 add $3,%eax
15 and $-4,%eax17 and $-4,%eax
16 jz p3
17
18#ifdef _WIN3218#ifdef _WIN32
19 jmp .+16 #p2
19p1:20p1:
20 cmp $4096,%eax
21 jbe p2
22 test %eax,-4096(%esp)
23 sub $4096,%esp21 sub $4096,%esp
24 sub $4096,%eax22 sub $4096,%eax
25 jmp p123 test %eax,(%esp)
26p2:24p2:
25 cmp $4096,%eax
26 jae p1
27#endif27#endif
28
29 sub %eax,%esp28 sub %eax,%esp
30 mov %esp,%eax29 mov 4(%ebp),%eax
31p3:30 mov 0(%ebp),%ebp
32 push %edx31 add $8,%esp
33 push %edx32 push %eax
33 lea 8(%esp),%eax
34 ret34 ret
35 35
36/* ---------------------------------------------- */36/* ---------------------------------------------- */
lib/libtcc1.c+6−0
@@ -625,3 +625,9 @@ long long __fixxfdi (long double a1) · 624 unmodified lines
625 return s ? ret : -ret;625 return s ? ret : -ret;
626}626}
627#endif /* !ARM */627#endif /* !ARM */
628
629#if defined __x86_64__
630/* float constants used for unary minus operation */
631const float __mzerosf = -0.0;
632const double __mzerodf = -0.0;
633#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t