authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-03 01:26:07-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-03 01:26:07-04:00
logf86684f4100c1dcc886357b79108df1e8f9e3f2e
treeae7a4da31310f7f025804b9545058822d0adb112
parent8d4668231a9812067d5b12ebabd78871dfb8517a

fix duplicated symbols in compiler-rt tests


2 files changed, 119 insertions(+), 117 deletions(-)

std/special/compiler_rt/aulldiv.zig+59-58
......@@ -1,65 +1,66 @@
11const builtin = @import("builtin");
2const linkage = if (builtin.is_test) builtin.GlobalLinkage.Internal else builtin.GlobalLinkage.Strong;
3const is_win32 = builtin.os == builtin.Os.windows and builtin.arch == builtin.Arch.i386;
24
35export nakedcc fn _aulldiv() {
4 @setDebugSafety(this, false);
5
6 if (comptime builtin.os == builtin.Os.windows) {
7 if (comptime builtin.arch == builtin.Arch.i386) {
8 asm volatile (
9 \\.intel_syntax noprefix
10 \\
11 \\ push ebx
12 \\ push esi
13 \\ mov eax,dword ptr [esp+18h]
14 \\ or eax,eax
15 \\ jne L1
16 \\ mov ecx,dword ptr [esp+14h]
17 \\ mov eax,dword ptr [esp+10h]
18 \\ xor edx,edx
19 \\ div ecx
20 \\ mov ebx,eax
21 \\ mov eax,dword ptr [esp+0Ch]
22 \\ div ecx
23 \\ mov edx,ebx
24 \\ jmp L2
25 \\ L1:
26 \\ mov ecx,eax
27 \\ mov ebx,dword ptr [esp+14h]
28 \\ mov edx,dword ptr [esp+10h]
29 \\ mov eax,dword ptr [esp+0Ch]
30 \\ L3:
31 \\ shr ecx,1
32 \\ rcr ebx,1
33 \\ shr edx,1
34 \\ rcr eax,1
35 \\ or ecx,ecx
36 \\ jne L3
37 \\ div ebx
38 \\ mov esi,eax
39 \\ mul dword ptr [esp+18h]
40 \\ mov ecx,eax
41 \\ mov eax,dword ptr [esp+14h]
42 \\ mul esi
43 \\ add edx,ecx
44 \\ jb L4
45 \\ cmp edx,dword ptr [esp+10h]
46 \\ ja L4
47 \\ jb L5
48 \\ cmp eax,dword ptr [esp+0Ch]
49 \\ jbe L5
50 \\ L4:
51 \\ dec esi
52 \\ L5:
53 \\ xor edx,edx
54 \\ mov eax,esi
55 \\ L2:
56 \\ pop esi
57 \\ pop ebx
58 \\ ret 10h
59 );
60 unreachable;
61 }
6 if (is_win32) {
7 @setDebugSafety(this, false);
8 @setGlobalLinkage(_aulldiv, linkage);
9 asm volatile (
10 \\.intel_syntax noprefix
11 \\
12 \\ push ebx
13 \\ push esi
14 \\ mov eax,dword ptr [esp+18h]
15 \\ or eax,eax
16 \\ jne L1
17 \\ mov ecx,dword ptr [esp+14h]
18 \\ mov eax,dword ptr [esp+10h]
19 \\ xor edx,edx
20 \\ div ecx
21 \\ mov ebx,eax
22 \\ mov eax,dword ptr [esp+0Ch]
23 \\ div ecx
24 \\ mov edx,ebx
25 \\ jmp L2
26 \\ L1:
27 \\ mov ecx,eax
28 \\ mov ebx,dword ptr [esp+14h]
29 \\ mov edx,dword ptr [esp+10h]
30 \\ mov eax,dword ptr [esp+0Ch]
31 \\ L3:
32 \\ shr ecx,1
33 \\ rcr ebx,1
34 \\ shr edx,1
35 \\ rcr eax,1
36 \\ or ecx,ecx
37 \\ jne L3
38 \\ div ebx
39 \\ mov esi,eax
40 \\ mul dword ptr [esp+18h]
41 \\ mov ecx,eax
42 \\ mov eax,dword ptr [esp+14h]
43 \\ mul esi
44 \\ add edx,ecx
45 \\ jb L4
46 \\ cmp edx,dword ptr [esp+10h]
47 \\ ja L4
48 \\ jb L5
49 \\ cmp eax,dword ptr [esp+0Ch]
50 \\ jbe L5
51 \\ L4:
52 \\ dec esi
53 \\ L5:
54 \\ xor edx,edx
55 \\ mov eax,esi
56 \\ L2:
57 \\ pop esi
58 \\ pop ebx
59 \\ ret 10h
60 );
61 unreachable;
6262 }
6363
6464 @setGlobalLinkage(_aulldiv, builtin.GlobalLinkage.Internal);
65 unreachable;
6566}
std/special/compiler_rt/aullrem.zig+60-59
......@@ -1,66 +1,67 @@
11const builtin = @import("builtin");
2const linkage = if (builtin.is_test) builtin.GlobalLinkage.Internal else builtin.GlobalLinkage.Strong;
3const is_win32 = builtin.os == builtin.Os.windows and builtin.arch == builtin.Arch.i386;
24
35export nakedcc fn _aullrem() {
4 @setDebugSafety(this, false);
5
6 if (comptime builtin.os == builtin.Os.windows) {
7 if (comptime builtin.arch == builtin.Arch.i386) {
8 asm volatile (
9 \\.intel_syntax noprefix
10 \\
11 \\ push ebx
12 \\ mov eax,dword ptr [esp+14h]
13 \\ or eax,eax
14 \\ jne L1a
15 \\ mov ecx,dword ptr [esp+10h]
16 \\ mov eax,dword ptr [esp+0Ch]
17 \\ xor edx,edx
18 \\ div ecx
19 \\ mov eax,dword ptr [esp+8]
20 \\ div ecx
21 \\ mov eax,edx
22 \\ xor edx,edx
23 \\ jmp L2a
24 \\ L1a:
25 \\ mov ecx,eax
26 \\ mov ebx,dword ptr [esp+10h]
27 \\ mov edx,dword ptr [esp+0Ch]
28 \\ mov eax,dword ptr [esp+8]
29 \\ L3a:
30 \\ shr ecx,1
31 \\ rcr ebx,1
32 \\ shr edx,1
33 \\ rcr eax,1
34 \\ or ecx,ecx
35 \\ jne L3a
36 \\ div ebx
37 \\ mov ecx,eax
38 \\ mul dword ptr [esp+14h]
39 \\ xchg eax,ecx
40 \\ mul dword ptr [esp+10h]
41 \\ add edx,ecx
42 \\ jb L4a
43 \\ cmp edx,dword ptr [esp+0Ch]
44 \\ ja L4a
45 \\ jb L5a
46 \\ cmp eax,dword ptr [esp+8]
47 \\ jbe L5a
48 \\ L4a:
49 \\ sub eax,dword ptr [esp+10h]
50 \\ sbb edx,dword ptr [esp+14h]
51 \\ L5a:
52 \\ sub eax,dword ptr [esp+8]
53 \\ sbb edx,dword ptr [esp+0Ch]
54 \\ neg edx
55 \\ neg eax
56 \\ sbb edx,0
57 \\ L2a:
58 \\ pop ebx
59 \\ ret 10h
60 );
61 unreachable;
62 }
6 if (is_win32) {
7 @setDebugSafety(this, false);
8 @setGlobalLinkage(_aullrem, linkage);
9 asm volatile (
10 \\.intel_syntax noprefix
11 \\
12 \\ push ebx
13 \\ mov eax,dword ptr [esp+14h]
14 \\ or eax,eax
15 \\ jne L1a
16 \\ mov ecx,dword ptr [esp+10h]
17 \\ mov eax,dword ptr [esp+0Ch]
18 \\ xor edx,edx
19 \\ div ecx
20 \\ mov eax,dword ptr [esp+8]
21 \\ div ecx
22 \\ mov eax,edx
23 \\ xor edx,edx
24 \\ jmp L2a
25 \\ L1a:
26 \\ mov ecx,eax
27 \\ mov ebx,dword ptr [esp+10h]
28 \\ mov edx,dword ptr [esp+0Ch]
29 \\ mov eax,dword ptr [esp+8]
30 \\ L3a:
31 \\ shr ecx,1
32 \\ rcr ebx,1
33 \\ shr edx,1
34 \\ rcr eax,1
35 \\ or ecx,ecx
36 \\ jne L3a
37 \\ div ebx
38 \\ mov ecx,eax
39 \\ mul dword ptr [esp+14h]
40 \\ xchg eax,ecx
41 \\ mul dword ptr [esp+10h]
42 \\ add edx,ecx
43 \\ jb L4a
44 \\ cmp edx,dword ptr [esp+0Ch]
45 \\ ja L4a
46 \\ jb L5a
47 \\ cmp eax,dword ptr [esp+8]
48 \\ jbe L5a
49 \\ L4a:
50 \\ sub eax,dword ptr [esp+10h]
51 \\ sbb edx,dword ptr [esp+14h]
52 \\ L5a:
53 \\ sub eax,dword ptr [esp+8]
54 \\ sbb edx,dword ptr [esp+0Ch]
55 \\ neg edx
56 \\ neg eax
57 \\ sbb edx,0
58 \\ L2a:
59 \\ pop ebx
60 \\ ret 10h
61 );
62 unreachable;
6363 }
6464
6565 @setGlobalLinkage(_aullrem, builtin.GlobalLinkage.Internal);
66 unreachable;
6667}