Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Mar 1999 20:16:52 -0800
From:      Mike Smith <mike@smith.net.au>
To:        "Andrew Reilly" <andrew@lake.com.au>
Cc:        Matthew Dillon <dillon@apollo.backplane.com>, "Stephen J. Roznowski" <sjr@home.net>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: Use of "register" in code 
Message-ID:  <199903160416.UAA02703@dingo.cdrom.com>
In-Reply-To: Your message of "Tue, 16 Mar 1999 15:17:44 %2B1100." <19990316151744.A39973@reilly.home> 

next in thread | previous in thread | raw e-mail | index | archive | help
> On Mon, Mar 15, 1999 at 07:49:45PM -0800, Matthew Dillon wrote:
> > :I've been looking at merging some NetBSD fixes for games, and I noticed
> > :that they have removed the "register" declaration from (at least) this
> > :section of the code tree.
> > :
> > :Are these register declarations useful, or are they just "historical
> > :artifacts"? If they are just historical artifacts, should they be
> > :removed?
> > :
> > :Thanks,
> > :-- 
> > :Stephen J. Roznowski    (sjr@home.net)
> > 
> >     The register declarations are useless historical artifacts.
> 
> Why do you say that?  "register" in a declaration has a specific
> semantic meaning that isn't (to my knowledge) duplicated by any
> other language mechanism, and that is "this variable does not exist
> in the memory space, and so _cannot_ be de-referenced with "&" or
> modified by an asignment through a pointer."  Register pointer
> variables and temporaries are very important for preventing C
> compilers from producing pessimistic inner loop code.

That's not what 'register' means, and unfortunately the use of 
'register' by code authors doesn't help as they're not privy to the 
actual layout of the code at the point where register allocation is 
performed.

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\  msmith@cdrom.com




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903160416.UAA02703>