From owner-freebsd-hackers Mon Mar 15 21:27: 0 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from m4.c2.telstra-mm.net.au (m4.c2.telstra-mm.net.au [24.192.3.19]) by hub.freebsd.org (Postfix) with ESMTP id 2829A1509A for ; Mon, 15 Mar 1999 21:25:47 -0800 (PST) (envelope-from andrew@lake.com.au) Received: from m5.c2.telstra-mm.net.au (m5.c2.telstra-mm.net.au [24.192.3.20]) by m4.c2.telstra-mm.net.au (8.8.6 (PHNE_14041)/8.8.6) with ESMTP id QAA01995 for ; Tue, 16 Mar 1999 16:25:27 +1100 (EDT) Received: from areilly.bpc-users.org (CPE-24-192-50-137.nsw.bigpond.net.au [24.192.50.137]) by m5.c2.telstra-mm.net.au (8.8.6 (PHNE_14041)/8.8.6) with SMTP id QAA07606 for ; Tue, 16 Mar 1999 16:25:25 +1100 (EDT) Received: (qmail 40663 invoked by uid 1000); 16 Mar 1999 05:25:24 -0000 Message-ID: <19990316052524.40662.qmail@areilly.bpc-users.org> From: "Andrew Reilly" Date: Tue, 16 Mar 1999 16:25:23 +1100 (EST) Subject: Re: Use of "register" in code To: dillon@apollo.backplane.com Cc: andrew@lake.com.au, sjr@home.net, freebsd-hackers@FreeBSD.ORG In-Reply-To: <199903160509.VAA06242@apollo.backplane.com> MIME-Version: 1.0 Content-Type: TEXT/plain; CHARSET=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Matthew Dillon said: > Let me extend this with another example: Protection against aliasing > is not usually an issue with stack variables. Of course it is. It's one of the principle reasons that Fortran can still generate tighter inner loop code than straight-forward C. The handbook of numerical C code says in big letters: fetch to register temporaries if a value is to be re-used, and use register variables for all pointers and indices. > On the otherhand, it is > something that would be much more useful with structural fields > or globals. Not sure why you would want that. Gcc has tweaks to allow you to put globals in specific machine registers, but that's hardly standard C or useful. > I don't know a single programmer who uses 'register' to mean 'alias > protection'. Well, you've met one now :-) -- Andrew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message