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
77 # define _(s) s
88 #endif
99
10−.globl _(alloca)
10+.globl _(alloca), _(__alloca)
1111 _(alloca):
12− pop %edx
13− pop %eax
12+_(__alloca):
13+ push %ebp
14+ mov %esp,%ebp
15+ mov 8(%ebp),%eax
1416 add $3,%eax
1517 and $-4,%eax
16− jz p3
17−
1818 #ifdef _WIN32
19+ jmp .+16 #p2
1920 p1:
20− cmp $4096,%eax
21− jbe p2
22− test %eax,-4096(%esp)
2321 sub $4096,%esp
2422 sub $4096,%eax
25− jmp p1
23+ test %eax,(%esp)
2624 p2:
25+ cmp $4096,%eax
26+ jae p1
2727 #endif
28−
2928 sub %eax,%esp
30− mov %esp,%eax
31−p3:
32− push %edx
33− push %edx
29+ mov 4(%ebp),%eax
30+ mov 0(%ebp),%ebp
31+ add $8,%esp
32+ push %eax
33+ lea 8(%esp),%eax
3434 ret
3535
3636 /* ---------------------------------------------- */
lib/libtcc1.c+6−0
@@ -625,3 +625,9 @@ long long __fixxfdi (long double a1) · 624 unmodified lines
625625 return s ? ret : -ret;
626626 }
627627 #endif /* !ARM */
628+
629+#if defined __x86_64__
630+/* float constants used for unary minus operation */
631+const float __mzerosf = -0.0;
632+const 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