This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Puzzle about macro MIPS_PROLOGUE_TEMP_REGNUM


"Amker.Cheng" <amker.cheng@gmail.com> writes:

>    I found the temp register used for saving registers when expanding
> prologue is defined by
> macro MIPS_PROLOGUE_TEMP_REGNUM on mips target, like:
>
> #define MIPS_PROLOGUE_TEMP_REGNUM \
>   (cfun->machine->interrupt_handler_p ? K0_REG_NUM : GP_REG_FIRST + 3)
>
> I don't understand why using registers starting from $3?
> in my application, I have to save DFmode fpu regs through gpr regs,
> that is $3,$4 in this case,
> just like :
>     mfc1  $3,  $fpr
>     sw     $3,  addr
>     mfc1  $4,  $fpr+1
>     sw     $4,  addr+4
>
> apparently this would crush the argument in $4.

Why not use $3 in all cases?  Why switch to $4?

> why don't use $8 for MIPS_PROLOGUE_TEMP_REGNUM like EPILOGUE_TEMP?

$8 can hold an argument value.  I think $13 would be a possibility,
but I don't see anything wrong with $3.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]