This is the mail archive of the
mailing list for the GCC project.
Re: Puzzle about macro MIPS_PROLOGUE_TEMP_REGNUM
- From: Ian Lance Taylor <iant at google dot com>
- To: "Amker.Cheng" <amker dot cheng at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 04 Jun 2010 07:42:15 -0700
- Subject: Re: Puzzle about macro MIPS_PROLOGUE_TEMP_REGNUM
- References: <AANLkTikXfAh3EraTXRwtPtEzI713ektq6vNzvPqmseYc@mail.gmail.com>
"Amker.Cheng" <email@example.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.