Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are shadow registers in MIPS and how are they used?

When I read about MIPS architecture, I came across shadow registers which are said to be copies of general purpose registers.

I couldn't understand the following: When are shadow registers used?

like image 935
sniper Avatar asked Jul 15 '15 05:07

sniper


1 Answers

MIPS shadow registers are used to reduce register load/store overhead in handling interrupts. An interrupt to which a shadow register set is assigned does not need to save any of the existing context to provide free registers or load any interrupt-specific data stored in the shadow registers at entry to the interrupt handler; at exit of the interrupt handler no saving of the interrupt handler context or restoring of the previous context is necessary.

ARM provides a similar functionality with what it calls banked registers. (For ARM, only some of the GPRs are replicated.)

The MIPS Multithreading Application Specific Extension extends the use of shadow register sets to become thread contexts. (Shadow register sets in effect support a very limited form of switch-on-event-multithreading where the extra threads are conceptually limited to interrupt handlers and the events to interrupts.)

like image 77
Paul A. Clayton Avatar answered Nov 06 '22 14:11

Paul A. Clayton