Re: Multiplexed registers and invalidating the register cache

Orjan Friberg
2004-04-15T10:46:42Z

Daniel Jacobowitz wrote:
>
> I think you should make this change unconditionally - and flush the
> entire frame cache.

Pardon my ignorance, but why should the entire frame cache be flushed,
instead of just invalidating the current set of registers? Is it
because frame pointer/return address registers (or something else
affecting other frames) might change?

> I'm not sure whether it should be in the generic
> code that writes a register or the user-level code triggered by set
> $reg = val, though.

So either something like

target_register_write (regno)

where the target-specific code can do whatever it wants (presumably
calling flush_cached_frames), or a more specialized function

target_flush_register_cache_on_register_write (regno)

and then have whatever calls that function do the actual frame cache
flushing.

> Andrew convinced me that the performance cost associated with this
> would be small in practice.

So, it's not worth the trouble implementing a more fine-grained solution
like "refetch only the modified register".

--
Orjan Friberg
Axis Communications