aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/sparc64
diff options
context:
space:
mode:
authorDavid Schultz <das@FreeBSD.org>2005-03-15 15:53:39 +0000
committerDavid Schultz <das@FreeBSD.org>2005-03-15 15:53:39 +0000
commit7b74e4a7591fc381c47b1674892cbec7c001f8a1 (patch)
treea1bfb572c907050387aa5e2ecbe459453b78ea36 /lib/libc/sparc64
parentd2f389f5e4df709185e33e45eff8446f8b1689c0 (diff)
downloadsrc-7b74e4a7591fc381c47b1674892cbec7c001f8a1.tar.gz
src-7b74e4a7591fc381c47b1674892cbec7c001f8a1.zip
Remove fpsetsticky(). This was added for SysV compatibility, but due
to mistakes from day 1, it has always had semantics inconsistent with SVR4 and its successors. In particular, given argument M: - On Solaris and FreeBSD/{alpha,sparc64}, it clobbers the old flags and *sets* the new flag word to M. (NetBSD, too?) - On FreeBSD/{amd64,i386}, it *clears* the flags that are specified in M and leaves the remaining flags unchanged (modulo a small bug on amd64.) - On FreeBSD/ia64, it is not implemented. There is no way to fix fpsetsticky() to DTRT for both old FreeBSD apps and apps ported from other operating systems, so the best approach seems to be to kill the function and fix any apps that break. I couldn't find any ports that use it, and any such ports would already be broken on FreeBSD/ia64 and Linux anyway. By the way, the routine has always been undocumented in FreeBSD, except for an MLINK to a manpage that doesn't describe it. This manpage has stated since 5.3-RELEASE that the functions it describes are deprecated, so that must mean that functions that it is *supposed* to describe but doesn't are even *more* deprecated. ;-) Note that fpresetsticky() has been retained on FreeBSD/i386. As far as I can tell, no other operating systems or ports of FreeBSD implement it, so there's nothing for it to be inconsistent with. PR: 75862 Suggested by: bde
Notes
Notes: svn path=/head/; revision=143658
Diffstat (limited to 'lib/libc/sparc64')
-rw-r--r--lib/libc/sparc64/gen/Makefile.inc2
-rw-r--r--lib/libc/sparc64/gen/fpsetsticky.c30
2 files changed, 1 insertions, 31 deletions
diff --git a/lib/libc/sparc64/gen/Makefile.inc b/lib/libc/sparc64/gen/Makefile.inc
index c228fc033037..979c1822ad6c 100644
--- a/lib/libc/sparc64/gen/Makefile.inc
+++ b/lib/libc/sparc64/gen/Makefile.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
SRCS+= _ctx_start.S _setjmp.S fabs.S fixunsdfsi.S flt_rounds.c fpgetmask.c \
- fpgetround.c fpgetsticky.c fpsetmask.c fpsetround.c fpsetsticky.c \
+ fpgetround.c fpgetsticky.c fpsetmask.c fpsetround.c \
infinity.c ldexp.c makecontext.c modf.S \
signalcontext.c setjmp.S sigsetjmp.S _set_tp.c
diff --git a/lib/libc/sparc64/gen/fpsetsticky.c b/lib/libc/sparc64/gen/fpsetsticky.c
deleted file mode 100644
index 61d3d1bf3472..000000000000
--- a/lib/libc/sparc64/gen/fpsetsticky.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* $NetBSD: fpsetsticky.c,v 1.2 2002/01/13 21:45:51 thorpej Exp $ */
-
-/*
- * Written by J.T. Conklin, Apr 10, 1995
- * Public domain.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <machine/fsr.h>
-#include <ieeefp.h>
-
-fp_except_t
-fpsetsticky(sticky)
- fp_except_t sticky;
-{
- unsigned int old;
- unsigned int new;
-
- __asm__("st %%fsr,%0" : "=m" (old));
-
- new = old;
- new &= ~FSR_AEXC_MASK;
- new |= FSR_AEXC(sticky & FSR_EXC_MASK);
-
- __asm__("ld %0,%%fsr" : : "m" (new));
-
- return (FSR_GET_AEXC(old));
-}