- Save/restore only registers that are used. This includes Callee saved registers and Caller saved registers (arguments and temporaries) for integer and FP registers.
- If there is a call in the interrupt handler, save/restore all Caller saved registers and all FP registers.
- Emit special return instructions depending on "interrupt" attribute type.
Based on initial patch by Zhaoshi Zheng.
Shouldn't these sets include the normal callee-saved registers? (X1, X3, X4, X8, X9). As it stands, I think an interrupt handler with high register pressure would fail to save these registers before dirtying them.