Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit 9f6e53f

Browse files
vadimcnalexcrichton
authored andcommitted
Windows does not have the ".const" directive and the function type must be declared differently.
1 parent adaf95f commit 9f6e53f

File tree

7 files changed

+14
-20
lines changed

7 files changed

+14
-20
lines changed

lib/builtins/assembly.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,16 @@
2727
#define LOCAL_LABEL(name) L_##name
2828
#define FILE_LEVEL_DIRECTIVE .subsections_via_symbols
2929
#define SYMBOL_IS_FUNC(name)
30+
#define CONST_SECTION .const
3031
#else
3132
#define HIDDEN_DIRECTIVE .hidden
3233
#define LOCAL_LABEL(name) .L_##name
3334
#define FILE_LEVEL_DIRECTIVE
35+
#define CONST_SECTION .text
3436
# if defined(__arm__)
3537
# define SYMBOL_IS_FUNC(name) .type name, %function
38+
# elif __WIN32__
39+
# define SYMBOL_IS_FUNC(name) .def name; .scl 3; .type 32; .endef
3640
# else
3741
# define SYMBOL_IS_FUNC(name) .type name, @function
3842
# endif

lib/builtins/i386/floatdidf.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
#ifdef __i386__
99

10-
#ifndef __ELF__
11-
.const
12-
#endif
10+
CONST_SECTION
1311
.align 4
1412
twop52: .quad 0x4330000000000000
1513
twop32: .quad 0x41f0000000000000

lib/builtins/i386/floatundidf.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717

1818
#ifdef __i386__
1919

20-
#ifndef __ELF__
21-
.const
22-
#endif
20+
CONST_SECTION
2321
.align 4
2422
twop52: .quad 0x4330000000000000
2523
twop84_plus_twop52:

lib/builtins/i386/floatundisf.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1919
#ifdef __i386__
2020
21-
.const
21+
CONST_SECTION
2222
.align 3
2323
2424
.quad 0x43f0000000000000
@@ -52,8 +52,8 @@ END_COMPILERRT_FUNCTION(__floatundisf)
5252

5353
#ifdef __i386__
5454

55-
#ifndef __ELF__
56-
.const
55+
CONST_SECTION
56+
#if !defined(__ELF__) && !defined(__WIN32__)
5757
.align 3
5858
#else
5959
.align 8
@@ -74,7 +74,7 @@ DEFINE_COMPILERRT_FUNCTION(__floatundisf)
7474
movd 8(%esp), %xmm1
7575
movd 4(%esp), %xmm0
7676
punpckldq %xmm1, %xmm0
77-
77+
7878
calll 0f
7979
0: popl %ecx
8080
shrl %eax // high 31 bits of input as sint32

lib/builtins/i386/floatundixf.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
#ifdef __i386__
99

10-
#ifndef __ELF__
11-
.const
12-
#endif
10+
CONST_SECTION
1311
.align 4
1412
twop52: .quad 0x4330000000000000
1513
twop84_plus_twop52_neg:

lib/builtins/x86_64/floatundidf.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717

1818
#ifdef __x86_64__
1919

20-
#ifndef __ELF__
21-
.const
22-
#endif
20+
CONST_SECTION
2321
.align 4
2422
twop52: .quad 0x4330000000000000
2523
twop84_plus_twop52:

lib/builtins/x86_64/floatundixf.S

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
#ifdef __x86_64__
99

10-
#ifndef __ELF__
11-
.const
12-
#endif
10+
CONST_SECTION
1311
.align 4
1412
twop64: .quad 0x43f0000000000000
1513

@@ -35,7 +33,7 @@ END_COMPILERRT_FUNCTION(__floatundixf)
3533
3634
#ifdef __x86_64__
3735
38-
.const
36+
CONST_SECTION
3937
.align 4
4038
twop52: .quad 0x4330000000000000
4139
twop84_plus_twop52_neg:

0 commit comments

Comments
 (0)