[fpc-devel] How do I find out which registers are actually used in an interrupt procedure and need to get pushed

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Jun 30 15:47:02 CEST 2016


Michael Ring wrote on Thu, 30 Jun 2016:

> So far I understood the fpc code that registers s0-s7 are  
> automagically flagged when used as those are the registers that must  
> be saved in the context of a standard procedure/function call.
>
> Same does apply for some of the Floating Point Registers.
>
> But when I look at the list of registers to be saved the registers  
> like $v0 and $v1 are not included, but usually used.

You'll probably want to modify  
tcpuparamanager.get_volatile_registers_(int/fpu) in  
compiler/mips/cpupara.pas based on the passed calloption.

Volatile registers are registers that do not need to be saved by the  
callee according to the ABI, even if they are modified by the callee.  
For interrupt routines, you'll probably want to return an empty set  
there.


Jonas



More information about the fpc-devel mailing list