From owner-freebsd-current Sat Jan 11 22:28:55 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF13637B401; Sat, 11 Jan 2003 22:28:53 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C20143F18; Sat, 11 Jan 2003 22:28:52 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id RAA12586; Sun, 12 Jan 2003 17:28:34 +1100 Date: Sun, 12 Jan 2003 17:29:04 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Kris Kennaway Cc: sparc@FreeBSD.ORG, Subject: Re: fpsetmask on sparc64 In-Reply-To: <20030112031626.GA15783@rot13.obsecurity.org> Message-ID: <20030112165423.K5527-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 11 Jan 2003, Kris Kennaway wrote: > fpsetmask is not defined in or > on sparc64 (it is on i386): > > /usr/include/machine/floatingpoint.h:#define fpsetmask(m) ((fp_except_t) \ > /usr/include/ieeefp.h:extern fp_except_t fpsetmask(fp_except_t); > /usr/include/floatingpoint.h:#define fpsetmask(m) ((fp_except_t) > > This appears to cause the following port failures/warnings: > > amphetamine-0.8.10.log:src/Main.cpp:79: `fpsetmask' undeclared (first use this function) > ... > 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 . 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 would have to use to suppport FreeBSD-2.x since didn't exist until FreeBSD-3.1. FreeBSD-4.0 and later hide FP errors by default. 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. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message