summaryrefslogtreecommitdiffstats
path: root/toolchain/uClibc/patches-0.9.30.1/430-i386_copysign.patch
blob: 8cc15b70320bc78c3fa19311c178199b9a3f824a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
--- a/libc/sysdeps/linux/i386/Makefile.arch
+++ b/libc/sysdeps/linux/i386/Makefile.arch
@@ -9,6 +9,7 @@ CSRC := brk.c sigaction.c __syscall_erro
 
 SSRC := \
 	__longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
-	sync_file_range.S syscall.S mmap.S mmap64.S posix_fadvise64.S
+	sync_file_range.S syscall.S mmap.S mmap64.S posix_fadvise64.S \
+	s_copysign.S s_copysignf.S s_copysignl.S
 
 include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch
--- /dev/null
+++ b/libc/sysdeps/linux/i386/s_copysign.S
@@ -0,0 +1,25 @@
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#define _ERRNO_H	1
+#include <features.h>
+#include <bits/errno.h>
+
+.text
+.global copysign
+.type   copysign,%function
+copysign:
+	movl	16(%esp),%edx
+	movl	8(%esp),%eax
+	andl	$0x80000000,%edx
+	andl	$0x7fffffff,%eax
+	orl	%edx,%eax
+	movl	%eax,8(%esp)
+	fldl	4(%esp)
+	ret
+.size copysign,.-copysign
+
+libc_hidden_def(copysign)
+
--- /dev/null
+++ b/libc/sysdeps/linux/i386/s_copysignf.S
@@ -0,0 +1,25 @@
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#define _ERRNO_H	1
+#include <features.h>
+#include <bits/errno.h>
+
+.text
+.global copysignf
+.type   copysignf,%function
+copysignf:
+	movl	8(%esp),%edx
+	movl	4(%esp),%eax
+	andl	$0x80000000,%edx
+	andl	$0x7fffffff,%eax
+	orl	%edx,%eax
+	movl	%eax,4(%esp)
+	flds	4(%esp)
+	ret
+.size copysignf,.-copysignf
+
+libc_hidden_def(copysignf)
+
--- /dev/null
+++ b/libc/sysdeps/linux/i386/s_copysignl.S
@@ -0,0 +1,26 @@
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Changes for long double by Ulrich Drepper <drepper@cygnus.com>
+ * Public domain.
+ */
+
+#define _ERRNO_H	1
+#include <features.h>
+#include <bits/errno.h>
+
+.text
+.global copysignl
+.type   copysignl,%function
+copysignl:
+	movl	24(%esp),%edx
+	movl	12(%esp),%eax
+	andl	$0x8000,%edx
+	andl	$0x7fff,%eax
+	orl	%edx,%eax
+	movl	%eax,12(%esp)
+	fldt	4(%esp)
+	ret
+.size copysignl,.-copysignl
+
+libc_hidden_def(copysignl)
+