This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [committed] Add support for MIPS16e save/restore instructions
- From: Richard Sandiford <richard at codesourcery dot com>
- To: Nigel Stephens <nigel at mips dot com>
- Cc: gcc-patches at gcc dot gnu dot org, sandra at codesourcery dot com, davidu at mips dot com
- Date: Mon, 02 Jul 2007 16:29:31 +0100
- Subject: Re: [committed] Add support for MIPS16e save/restore instructions
- References: <87tzsm6f0x.fsf@firetop.home> <4689147B.4000204@mips.com>
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