This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Illegal insn due to system register
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: "Rakesh Kumar - Software, Noida" <rakeshku at noida dot hcltech dot com>
- Cc: bug-gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 20 May 2003 16:52:00 +0100
- Subject: Re: Illegal insn due to system register
- Organization: SuperH UK Ltd.
- References: <E04CF3F88ACBD5119EFE00508BBB2121095BDAD7@exch-01.noida.hcltech.com>
"Rakesh Kumar - Software, Noida" wrote:
> I am not so familiar with reload internals.
> What exactly should be happening here?
On closer inspection, the actual problem turned
out to be a too low REGISTER_MOVE_COST.
I've attached the patch I'v just checked in to fix this.
> Also I am curious to know what is the advantage of
> allowing SImode for floating point registers (in the patch)?
When you handle vector moves, you have to decompose them at
some point into individual register loads / stores.
The generic code uses integer modes for this purpose; if
we don't allow these modes in flaoting point registers,
that means FP vectors would be moved through general purpuse
registers for loads, stores and copies.
--
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658
2003-05-20 J"orn Rennecke <joern.rennecke@superh.com>
* sh.c (sh_register_move_cost): Add clase for moving between
FP registers and MAC registers.
Index: config/sh/sh.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/sh/sh.c,v
retrieving revision 1.212
diff -p -r1.212 sh.c
*** config/sh/sh.c 14 May 2003 07:29:52 -0000 1.212
--- config/sh/sh.c 20 May 2003 15:45:46 -0000
*************** sh_register_move_cost (mode, srcclass, d
*** 8243,8248 ****
--- 8243,8252 ----
&& REGCLASS_HAS_FP_REG (dstclass))
return 4;
+ if ((REGCLASS_HAS_FP_REG (dstclass) && srcclass == MAC_REGS)
+ || (dstclass== MAC_REGS && REGCLASS_HAS_FP_REG (srcclass)))
+ return 9;
+
if ((REGCLASS_HAS_FP_REG (dstclass)
&& REGCLASS_HAS_GENERAL_REG (srcclass))
|| (REGCLASS_HAS_GENERAL_REG (dstclass)