This is the mail archive of the gcc-patches@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: [committed] Add support for MIPS16e save/restore instructions


Nigel Stephens <nigel@mips.com> writes:
> Richard Sandiford wrote:
>> It remains to be seen whether:
>>
>>   /* In mips16 mode, we permit the $t temporary registers to be used
>>      for reload.  We prohibit the unused $s registers, since they
>>      are caller saved, and saving them via a mips16 register would
>>      probably waste more time than just reloading the value.  */
>>   if (TARGET_MIPS16)
>>     {
>>       fixed_regs[18] = call_used_regs[18] = 1;
>>       fixed_regs[19] = call_used_regs[19] = 1;
>>       fixed_regs[20] = call_used_regs[20] = 1;
>>       fixed_regs[21] = call_used_regs[21] = 1;
>>       fixed_regs[22] = call_used_regs[22] = 1;
>>       fixed_regs[23] = call_used_regs[23] = 1;
>>       fixed_regs[26] = call_used_regs[26] = 1;
>>       fixed_regs[27] = call_used_regs[27] = 1;
>>       fixed_regs[30] = call_used_regs[30] = 1;
>>     }
>>
>> still makes sense when GENERATE_MIPS16E_SAVE_RESTORE, since saving and
>> restoring these registers is now so cheap.
>
> Yes, we thought so too, but when we tried that in gcc3.4 we got less 
> than impressive results for code size. IIRC this was due to excessive 
> reloads -- because "spilling" to registers wasn't supported in the same 
> way as spilling to stack, instead variables would get allocated to the 
> s2-8 registers and then need reloading to MIPS16 registers before each 
> use. Could be worth trying again in gcc 4 though, in case any 
> improvements to the register allocator help us here.

Ah, OK, thanks for the info.  I'll let that idea sink further down the
to-do list then.

Richard


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