SH2A: "RTV/N Rn" implementation
Naveen H.S.
naveen.hs@kpitcummins.com
Tue Jul 24 10:05:00 GMT 2007
Hi,
>> This is actually what I had in mind. You just need to also modify
>> the epilogue expander to use that insn:
>> sh_expand_epilogue (0);
>> if (HAVE_return_rtv)
>> emit_jump_insn (gen_return_rtv (gen_rtx_REG (SImode, R0_REG)));
>> else
>> emit_jump_insn (gen_return ());
Thanks for your valuable suggestion.
We modified the epilogue as per your suggestions. RTV/N Rn instruction
was generated with the operand as R0 in most of the case. The redundant
transfer of register Rn to R0 before the epilogue is still generated.
So RTV/N does not lead to any optimization in the code size.
We masked this transfer when return type of the function is INTEGER_TYPE
in the function expand_value_return (rtx val) in gcc/stmt.c. This
resulted in some regression FAIL. RTV/N Rn is generated only when
return type of the function is INTEGER_TYPE. How to avoid redundant move
without any regression failures?
We tried to get the register Rn from the function expand_value_return
(rtx val) in gcc/stmt.c. The register Rn can be used as the operand in
"return_rtv". The Rn register obtained from the above function is a
PSEUDO register. Kindly suggest a way to get HARD register instead of a
PSEUDO register?
Regards,
Naveen.H.S.
KPIT Cummins Infosystems Ltd,
Pune (INDIA)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH, H8, R8C, M16C
and M32C Series. The following site also offers free technical support
to its users. Visit http://www.kpitgnutools.com for details.
Latest versions of KPIT GNU tools were released on June 1, 2007.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
More information about the Gcc
mailing list