[comp.arch] Optimizing compiler's view on:

aglew@ccvaxa.UUCP (03/13/87)

>> The problem is, you wouldn't gain much. As you go deeper into the stack,
>> bits in the 'reg-in-use' word would become set, but would never be
>> cleared by anything but a function return. 
>The 'reg-in-use' word could be cleared at function entry.  Since the contents
>of the registers are on the stack, they can be considered no longer in use.

So how do you pop them off? You have to save the reg in use word somewhere.

>Another thing that could be done is the 'reg-in-use' word could set the 
>appropriate bit whenever a register is loaded, (the 'reg-in-use' word should
>be a processor register, though not necessarily addressable) then there would 
>be no compiler support required for the register mask feature.

Something intermediate that I espouse would be something like this register in
use bit automatically set for blocks of registers.

In a machine with a large register set, like a register window stack (although
there are other ways to use extremely large numbers of registers), you don't
want to have to save all those registers at context switch time. But, when
you do a context switch, it may be optimal to load up several register
windows (the result indicating optimality to load/save only one register
window on overflow/underflow only applies to procedure calls). So,
when your next context switch comes around, some of the registers may not
have changed from their image in memory. A modified bit could help
you avoid saving these unnecessarily.

Apllying the modified bit to a block of registers might be a useful
tradeoff.

>Dan Kary
>hp-lsd!kary
>/* End of text from ccvaxa:comp.arch */