diff options
author | das <das@FreeBSD.org> | 2011-10-21 06:40:36 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2011-10-21 06:40:36 +0000 |
commit | 9373f7b9c4f30f6577adcbbba17be55d53f114b6 (patch) | |
tree | c48465604c7967f5162a2c5f32ab24721a37e96c /lib/libc/amd64 | |
parent | 35a6cd64927e8d5f815012b9b8ac9e5efed5aa9a (diff) | |
download | FreeBSD-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/amd64')
-rw-r--r-- | lib/libc/amd64/Symbol.map | 1 | ||||
-rw-r--r-- | lib/libc/amd64/gen/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/amd64/gen/modf.S | 91 |
3 files changed, 1 insertions, 93 deletions
diff --git a/lib/libc/amd64/Symbol.map b/lib/libc/amd64/Symbol.map index ab85781..9997cc2 100644 --- a/lib/libc/amd64/Symbol.map +++ b/lib/libc/amd64/Symbol.map @@ -26,7 +26,6 @@ FBSD_1.0 { __infinity; __nan; makecontext; - modf; rfork_thread; setjmp; longjmp; diff --git a/lib/libc/amd64/gen/Makefile.inc b/lib/libc/amd64/gen/Makefile.inc index 38fe7e1..30fb05f 100644 --- a/lib/libc/amd64/gen/Makefile.inc +++ b/lib/libc/amd64/gen/Makefile.inc @@ -2,7 +2,7 @@ # $FreeBSD$ SRCS+= _setjmp.S _set_tp.c rfork_thread.S setjmp.S sigsetjmp.S \ - fabs.S modf.S \ + fabs.S \ infinity.c ldexp.c makecontext.c signalcontext.c \ flt_rounds.c fpgetmask.c fpsetmask.c fpgetprec.c fpsetprec.c \ fpgetround.c fpsetround.c fpgetsticky.c diff --git a/lib/libc/amd64/gen/modf.S b/lib/libc/amd64/gen/modf.S deleted file mode 100644 index 691aad8..0000000 --- a/lib/libc/amd64/gen/modf.S +++ /dev/null @@ -1,91 +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. - * - * from: @(#)modf.s 5.5 (Berkeley) 3/18/91 - */ - -#include <machine/asm.h> -#if defined(LIBC_SCCS) - RCSID("$NetBSD: modf.S,v 1.5 1997/07/16 14:37:18 christos Exp $") -#endif -__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) - - /* - * Set chop mode. - */ - fnstcw -12(%rsp) - movw -12(%rsp),%dx - orw $3072,%dx - movw %dx,-16(%rsp) - fldcw -16(%rsp) - - /* - * Get integral part. - */ - movsd %xmm0,-24(%rsp) - fldl -24(%rsp) - frndint - fstpl -8(%rsp) - - /* - * Restore control word. - */ - fldcw -12(%rsp) - - /* - * Store integral part. - */ - movsd -8(%rsp),%xmm0 - movsd %xmm0,(%rdi) - - /* - * Get fractional part and return it. - */ - fldl -24(%rsp) - fsubl -8(%rsp) - fstpl -8(%rsp) - movsd -8(%rsp),%xmm0 - - ret -END(modf) - - .section .note.GNU-stack,"",%progbits |