Eric Fisher <[EMAIL PROTECTED]> writes:

> I'd like to know why mips doesn't define $30 and $31 as fix registers?
> And when should they be defined true?

Neither register has a use which is fixed by either the hardware or
the ABI.

$30 is generally the frame pointer, but gcc will only use a frame
pointer which it is required to.  When a function does not need a
frame pointer, $30 is available as a caller-saved register.

$31 is used by hardware in a jal instruction, and the ABI requires its
used in a jalr instruction.  However, in code that does not make a
function call, it is perfectly reasonable for gcc to use $31 as a
general caller-saved register, assuming of course that gcc has saved
the address to which the function should return.

Ian

Reply via email to