From owner-freebsd-current Mon Jan 13 12:45: 6 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 DA79B37B401; Mon, 13 Jan 2003 12:45:03 -0800 (PST) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id CCFAB43F13; Mon, 13 Jan 2003 12:45:02 -0800 (PST) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.6/8.12.6) with ESMTP id h0DKiu2G043503; Mon, 13 Jan 2003 12:44:57 -0800 (PST) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.6/8.12.6) with ESMTP id h0DKj6mY000953; Mon, 13 Jan 2003 12:45:06 -0800 (PST) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.6/8.12.6/Submit) id h0DKj6Hs000952; Mon, 13 Jan 2003 12:45:06 -0800 (PST) (envelope-from marcel) Date: Mon, 13 Jan 2003 12:45:05 -0800 From: Marcel Moolenaar To: Bruce Evans Cc: Terry Lambert , Jake Burkholder , sparc@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: [PATCH] Re: fpsetmask on sparc64 Message-ID: <20030113204505.GA798@dhcp01.pn.xcllnt.net> References: <20030113100558.GA3423@dhcp01.pn.xcllnt.net> <20030113211536.E11945-100000@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030113211536.E11945-100000@gamplex.bde.org> User-Agent: Mutt/1.5.1i 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 Mon, Jan 13, 2003 at 10:21:59PM +1100, Bruce Evans wrote: > > > > This part is what makes me opt for moving the prototypes to the > > MD header. These functions are trivial most of the time that > > inlining them makes sense. I don't see why other platforms can't > > or won't inline in the future. > > Hand-inlining things rarely makes sense, especially for little-used > compatibility-cruft functions like these. Aahh.. But by hand-inlining compatibility cruft, you remove them from the ABI! You only have them in the API, which is the lesser evil of the two when you want to remove the compatibility cruft completely. > A technical reason for not inlining some of them is that they may need > to interact with signal handling. I don't see how this is related. The only advantage of not inlining is the ability to declare the functions as weak so that they can be overridden. In all other cases it's just an implementation detail that should not affect the functionality. > We currently avoid most signal-handling > problems related to changing the FP environment by switching the critical > part of the environment in setjmp/longjmp, at least on i386's, but C99 > seems to forbid this. I think the functions that change the FP environment > need to save their setting somehwere so that longjmp() can restore the > default FP environment (not necessarily the one when setjmp() was called). > I don't know how to do this properly reentrantly. On ia64 the FP environment is callee saved and thus put in jmpbuf. The general modus operandi seems that functions either use the settings as inherited, or otherwise explicitly set them. This also applies to signal handlers. Thus when the FP environment is changed at function entry, the only action required is to restore the FP environment at function exit. > > Also, it appears to me that we always have to provide non-inlined > > versions in libc for when inlining is disabled. See ctype.h. > > I may misinterpret the comment though... > > Non-inline versions are needed for at least calling functions through > function pointers if this is supported, and C requires it to be supported > for most functions including the ctype 1's. This requirement causes > some of the implementation complications in . I see. Using static inline functions rather than macros should mostly solve this. Function pointer comparison will not work though, but I don't know if it has to. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message