Attachment 'clang-bootstrap-r212105-1-ldexp.diff'
Download 1 diff --git a/lib/libc/i386/gen/Makefile.inc b/lib/libc/i386/gen/Makefile.inc
2 index 89319c8..d0a58d7 100644
3 --- a/lib/libc/i386/gen/Makefile.inc
4 +++ b/lib/libc/i386/gen/Makefile.inc
5 @@ -2,5 +2,5 @@
6 # $FreeBSD$
7
8 SRCS+= _ctx_start.S _setjmp.S _set_tp.c fabs.S \
9 - flt_rounds.c infinity.c ldexp.c makecontext.c modf.S \
10 + flt_rounds.c infinity.c ldexp.S makecontext.c modf.S \
11 rfork_thread.S setjmp.S signalcontext.c sigsetjmp.S
12 diff --git a/lib/libc/i386/gen/ldexp.S b/lib/libc/i386/gen/ldexp.S
13 new file mode 100644
14 index 0000000..1570026
15 --- /dev/null
16 +++ b/lib/libc/i386/gen/ldexp.S
17 @@ -0,0 +1,39 @@
18 +/*
19 + * Copyright (c) 2010 Dimitry Andric <dimitry@andric.com>
20 + * All rights reserved.
21 + *
22 + * Redistribution and use in source and binary forms, with or without
23 + * modification, are permitted provided that the following conditions
24 + * are met:
25 + * 1. Redistributions of source code must retain the above copyright
26 + * notice, this list of conditions and the following disclaimer.
27 + * 2. Neither the name of the author nor the names of its contributors
28 + * may be used to endorse or promote products derived from this software
29 + * without specific prior written permission.
30 + *
31 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
32 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
35 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
39 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
40 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
41 + * SUCH DAMAGE.
42 + */
43 +
44 +#include <machine/asm.h>
45 +__FBSDID("$FreeBSD$");
46 +
47 +/*
48 + * double ldexp(double value, int exp): return value * (2 ** exp).
49 + */
50 +ENTRY(ldexp)
51 + fildl 12(%esp)
52 + fldl 4(%esp)
53 + fscale
54 + fstp %st(1)
55 + ret
56 +END(ldexp)
57 diff --git a/lib/libc/i386/gen/ldexp.c b/lib/libc/i386/gen/ldexp.c
58 deleted file mode 100644
59 index 88bbb04..0000000
60 --- a/lib/libc/i386/gen/ldexp.c
61 +++ /dev/null
62 @@ -1,64 +0,0 @@
63 -/*-
64 - * Copyright (c) 1990, 1993
65 - * The Regents of the University of California. All rights reserved.
66 - *
67 - * This code is derived from software contributed to Berkeley by
68 - * Sean Eric Fagan.
69 - *
70 - * Redistribution and use in source and binary forms, with or without
71 - * modification, are permitted provided that the following conditions
72 - * are met:
73 - * 1. Redistributions of source code must retain the above copyright
74 - * notice, this list of conditions and the following disclaimer.
75 - * 2. Redistributions in binary form must reproduce the above copyright
76 - * notice, this list of conditions and the following disclaimer in the
77 - * documentation and/or other materials provided with the distribution.
78 - * 4. Neither the name of the University nor the names of its contributors
79 - * may be used to endorse or promote products derived from this software
80 - * without specific prior written permission.
81 - *
82 - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
83 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
84 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
85 - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
86 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
87 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
88 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
89 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
90 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
91 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
92 - * SUCH DAMAGE.
93 - */
94 -
95 -#if defined(LIBC_SCCS) && !defined(lint)
96 -static char sccsid[] = "@(#)ldexp.c 8.1 (Berkeley) 6/4/93";
97 -#endif /* LIBC_SCCS and not lint */
98 -#include <sys/cdefs.h>
99 -__FBSDID("$FreeBSD$");
100 -
101 -#include <math.h>
102 -
103 -/*
104 - * ldexp(value, exp): return value * (2 ** exp).
105 - *
106 - * Written by Sean Eric Fagan (sef@kithrup.COM)
107 - * Sun Mar 11 20:27:09 PST 1990
108 - */
109 -
110 -/*
111 - * We do the conversion in C to let gcc optimize it away, if possible.
112 - */
113 -double
114 -ldexp (double value, int exp)
115 -{
116 - double temp, texp, temp2;
117 - texp = exp;
118 -#ifdef __GNUC__
119 - __asm ("fscale "
120 - : "=u" (temp2), "=t" (temp)
121 - : "0" (texp), "1" (value));
122 -#else
123 -#error unknown asm
124 -#endif
125 - return (temp);
126 -}
127
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.