Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site mips.UUCP
Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!decwrl!Glacier!mips!jmoore
From: jmoore@mips.UUCP (Jim Moore)
Newsgroups: net.lang.c
Subject: Re: register variables
Message-ID: <146@mips.UUCP>
Date: Wed, 26-Jun-85 09:37:28 EDT
Article-I.D.: mips.146
Posted: Wed Jun 26 09:37:28 1985
Date-Received: Thu, 27-Jun-85 08:15:43 EDT
References: <472@crystal.UUCP> <551@ucsfcgl.UUCP> <409@umcp-cs.UUCP>
Distribution: net
Organization: MIPS Computer Systems, Mountain View, CA
Lines: 24

> You have an infinite number of registers.  No, seriously, this is the
> way to think about it.  You should declare EVERYTHING which you don't
> have to take the address of to be a register. [...] Just be somewhat
> careful to declare things in the order you care about.

This is the method I always use in the procedures I write. I am
accustomed to programming a 68k based machine and it does not take
many references to a variable to justify any additional cost in making
it a register on that architecture.

Using this declaration method seems to be saying that the register
hint given the compiler contains no information (other than promising
not to take its address). What I really want is for the compiler to
assign as many variables to registers as it can. I would also like it
to assign to "right" variables to registers, including globals.
In this scenerio, register declarations should act as over-rides to
the compilers register allocation policy. This would result in code
with fewer register declarations, but with more information contained
in each one.

Jim Moore
MIPS Computer Systems
Mountain View, CA
ucbvax!decwrl!mips!jmoore