This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: SH2A: "RTV/N Rn" implementation
- From: "Naveen H.S." <naveen dot hs at kpitcummins dot com>
- To: "Rask Ingemann Lambertsen" <rask at sygehus dot dk>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 24 Jul 2007 15:32:03 +0530
- Subject: RE: SH2A: "RTV/N Rn" implementation
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.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~