summaryrefslogtreecommitdiffstats
path: root/lib/libc/i386
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2011-10-21 06:40:36 +0000
committerdas <das@FreeBSD.org>2011-10-21 06:40:36 +0000
commit9373f7b9c4f30f6577adcbbba17be55d53f114b6 (patch)
treec48465604c7967f5162a2c5f32ab24721a37e96c /lib/libc/i386
parent35a6cd64927e8d5f815012b9b8ac9e5efed5aa9a (diff)
downloadFreeBSD-src-9373f7b9c4f30f6577adcbbba17be55d53f114b6.zip
FreeBSD-src-9373f7b9c4f30f6577adcbbba17be55d53f114b6.tar.gz
Replace a proliferation of buggy MD implementations of modf() with a
working MI one. The MI one only needs to be overridden on machines with non-IEEE754 arithmetic. (The last supported one was the VAX.) It can also be overridden if someone comes up with a faster one that actually passes the regression tests -- but this is harder than it sounds.
Diffstat (limited to 'lib/libc/i386')
-rw-r--r--lib/libc/i386/Symbol.map1
-rw-r--r--lib/libc/i386/gen/Makefile.inc2
-rw-r--r--lib/libc/i386/gen/modf.S87
3 files changed, 1 insertions, 89 deletions
diff --git a/lib/libc/i386/Symbol.map b/lib/libc/i386/Symbol.map
index 9fd9dc2..8a01802 100644
--- a/lib/libc/i386/Symbol.map
+++ b/lib/libc/i386/Symbol.map
@@ -20,7 +20,6 @@ FBSD_1.0 {
__nan;
__infinity;
makecontext;
- modf;
rfork_thread;
setjmp;
longjmp;
diff --git a/lib/libc/i386/gen/Makefile.inc b/lib/libc/i386/gen/Makefile.inc
index 89319c8..45e69ca 100644
--- a/lib/libc/i386/gen/Makefile.inc
+++ b/lib/libc/i386/gen/Makefile.inc
@@ -2,5 +2,5 @@
# $FreeBSD$
SRCS+= _ctx_start.S _setjmp.S _set_tp.c fabs.S \
- flt_rounds.c infinity.c ldexp.c makecontext.c modf.S \
+ flt_rounds.c infinity.c ldexp.c makecontext.c \
rfork_thread.S setjmp.S signalcontext.c sigsetjmp.S
diff --git a/lib/libc/i386/gen/modf.S b/lib/libc/i386/gen/modf.S
deleted file mode 100644
index 33c211f..0000000
--- a/lib/libc/i386/gen/modf.S
+++ /dev/null
@@ -1,87 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Sean Eric Fagan.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
- .asciz "@(#)modf.s 5.5 (Berkeley) 3/18/91"
-#endif /* LIBC_SCCS and not lint */
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-/*
- * modf(value, iptr): return fractional part of value, and stores the
- * integral part into iptr (a pointer to double).
- *
- * Written by Sean Eric Fagan (sef@kithrup.COM)
- * Sun Mar 11 20:27:30 PST 1990
- */
-
-/* With CHOP mode on, frndint behaves as TRUNC does. Useful. */
-
-ENTRY(modf)
- pushl %ebp
- movl %esp,%ebp
- /* Check for Inf/NaN */
- movl 12(%ebp),%eax
- andl $0x7fffffff,%eax
- cmpl $0x7ff00000,%eax
- jae 1f
- /* Finite value */
- subl $16,%esp
- fnstcw -12(%ebp)
- movw -12(%ebp),%dx
- orw $3072,%dx
- movw %dx,-16(%ebp)
- fldcw -16(%ebp)
- fldl 8(%ebp)
- frndint
- fstpl -8(%ebp)
- fldcw -12(%ebp)
- movl 16(%ebp),%eax
- movl -8(%ebp),%edx
- movl -4(%ebp),%ecx
- movl %edx,(%eax)
- movl %ecx,4(%eax)
- fldl 8(%ebp)
- fsubl -8(%ebp)
- leave
- ret
- /* Inf/NaN handling */
-1: fldl 8(%ebp)
- movl 16(%ebp),%edx
- fstl (%edx)
- fldz
- fdivp /* return +/- 0 for +/- Inf, NaN for NaN */
- leave
- ret
-END(modf)
-
- .section .note.GNU-stack,"",%progbits
OpenPOWER on IntegriCloud