From owner-freebsd-sparc Sun Jan 12 0:26:49 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA9A637B401; Sun, 12 Jan 2003 00:26:47 -0800 (PST) Received: from soulshock.mail.pas.earthlink.net (soulshock.mail.pas.earthlink.net [207.217.120.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B94243F18; Sun, 12 Jan 2003 00:26:47 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from stork (stork.mail.pas.earthlink.net [207.217.120.188]) by soulshock.mail.pas.earthlink.net (8.11.6+Sun/8.11.6) with ESMTP id h0C8POH17473; Sun, 12 Jan 2003 00:25:24 -0800 (PST) Received: from pool0159.cvx22-bradley.dialup.earthlink.net ([209.179.198.159] helo=mindspring.com) by stork with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 18XdQS-0006dC-00; Sun, 12 Jan 2003 00:25:01 -0800 Message-ID: <3E21260E.CF088513@mindspring.com> Date: Sun, 12 Jan 2003 00:23:42 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Bruce Evans Cc: Kris Kennaway , sparc@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: fpsetmask on sparc64 References: <20030112165423.K5527-100000@gamplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4411abf1b3574f4005d4d48b8b0b44a0f666fa475841a1c7a350badd9bab72f9c350badd9bab72f9c Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Bruce Evans wrote: > > Is this an omission, or are the ports wrong? > > First answer: > This is a bug in the ports. The non-i386 arches are apparently including > instead of the documented interface . Wow, gotta disagree with that; the problem doesn't magically go away when you include the standard header file. > I think the ports are only meddling the FP mask to hide their FP errors > when running under FreeBSD-3.x and earlier anyway. They are meddling with it because the FreeBSD default, while it is permitted by the standard, is different from what most software expects the default to be. Yeah, it'd be nice if it weren't there, but the man page itself specifically uses fpsetmask() in an example (to prevent some trap). > Second answer: > Ports should use the C99 interfaces fe{get,set}*() from , and then > only if C99 is supported. There might be problems with this too: > - C99 isn't supported yet. > - C99 doesn't have fesetmask(). This is partly because it would be > very unportable. It is not an IEEE FP feature. C99 only has > fesetenv(FE_DFL_ENV) to recover from any meddling with the FP > environment. > - Non-default FP environments should only be used in small sections > of code, since large parts of libraries, etc. are entitled to assume > that the environment is the default. So changing the FP mask to a > non-default value at program startup time would give undefined > behaviour if it were possible. This is also really arguable, IMO. The problem with this is that the assumption that they are "entitled to assume that the environment is the default" is really bogus. What this really comes down to is that Intel FP hardware sucks, and should be redesigned to raise exceptions when they occur, instead of on the next operation. It's like the old VT100's, or other therminals with the "AM" attribute which is true, and they wrap before the 81st character, rather than after the 80th. I understand the pipeline stall that would happen on an exception, if this is how they were handed; on the other hand, it's a little bogus to assume that exceptions aren't going to be rare, what with them being "exceptional" and all. 8-). The C99 soapbox is a nice place to stand, if you want to criticize all other implementations; but as you point out, C99 is not really there yet, and even if it were, you could not really expect all code to be changed to conform to it (or any other standard, for that matter, considering the amount of legacy code everywhere). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message