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: stormy16: limit SI reload regs


> X-Original-To: geoffk@foam.wonderslug.com
> Date: Wed, 30 Apr 2003 15:28:45 -0400
> From: DJ Delorie <dj@redhat.com>
> X-OriginalArrivalTime: 30 Apr 2003 19:28:18.0593 (UTC) FILETIME=[A757F110:01C30F4E]
> 
> 
> > I'm trying a variant now where we set the reload preference to
> > SEVEN_REGS but the constraint to EIGHT_REGS.
> 
> Ok, this patch works with some tests now passing and no regressions:

That won't work in general; sometimes you'll just happen to have a
variable in the wrong register, and reload won't reload it because it
fits the constraint even though it's not preferred.

> 2003-04-30  DJ Delorie  <dj@redhat.com>
> 
> 	* config/stormy16/stormy16.h: Add SEVEN_REGS class.
> 	* config/stormy16/stormy16.c (xstormy16_secondary_reload_class): Use it.
> 	(xstormy16_preferred_reload_class): Use it.
> 
> Index: stormy16.c
> ===================================================================
> RCS file: /cvs/uberbaum/gcc/config/stormy16/stormy16.c,v
> retrieving revision 1.38
> diff -p -2 -r1.38  stormy16.c
> *** stormy16.c	17 Apr 2003 10:35:08 -0000	1.38
> --- stormy16.c	30 Apr 2003 19:26:57 -0000
> *************** xstormy16_secondary_reload_class (class,
> *** 524,528 ****
>   	       || true_regnum (x) >= FIRST_PSEUDO_REGISTER)))
>         && ! reg_class_subset_p (class, EIGHT_REGS))
> !     return EIGHT_REGS;
>   
>     /* When reloading a PLUS, the carry register will be required
> --- 524,528 ----
>   	       || true_regnum (x) >= FIRST_PSEUDO_REGISTER)))
>         && ! reg_class_subset_p (class, EIGHT_REGS))
> !     return GET_MODE (x) == SImode ? SEVEN_REGS : EIGHT_REGS;
>   
>     /* When reloading a PLUS, the carry register will be required
> *************** xstormy16_preferred_reload_class (x, cla
> *** 576,580 ****
>     if (class == GENERAL_REGS
>         && GET_CODE (x) == MEM)
> !     return EIGHT_REGS;
>   
>     return class;
> --- 576,580 ----
>     if (class == GENERAL_REGS
>         && GET_CODE (x) == MEM)
> !     return GET_MODE (x) == SImode ? SEVEN_REGS : EIGHT_REGS;
>   
>     return class;
> Index: stormy16.h
> ===================================================================
> RCS file: /cvs/uberbaum/gcc/config/stormy16/stormy16.h,v
> retrieving revision 1.73
> diff -p -2 -r1.73  stormy16.h
> *** stormy16.h	17 Apr 2003 10:35:08 -0000	1.73
> --- stormy16.h	30 Apr 2003 19:26:58 -0000
> *************** enum reg_class
> *** 405,408 ****
> --- 405,409 ----
>     TWO_REGS,
>     R2_REGS,
> +   SEVEN_REGS,
>     EIGHT_REGS,
>     R8_REGS,
> *************** enum reg_class
> *** 428,431 ****
> --- 429,433 ----
>     "TWO_REGS",					\
>     "R2_REGS",					\
> +   "SEVEN_REGS",					\
>     "EIGHT_REGS",					\
>     "R8_REGS",					\
> *************** enum reg_class
> *** 453,456 ****
> --- 455,459 ----
>     { 0x00003 },					\
>     { 0x00004 },					\
> +   { 0x0007F },					\
>     { 0x000FF },					\
>     { 0x00100 },					\
> *************** enum reg_class
> *** 468,471 ****
> --- 471,475 ----
>      : (REGNO) == 1 ? R1_REGS			\
>      : (REGNO) == 2 ? R2_REGS			\
> +    : (REGNO) < 7  ? SEVEN_REGS			\
>      : (REGNO) < 8  ? EIGHT_REGS			\
>      : (REGNO) == 8 ? R8_REGS			\
> 


-- 
- Geoffrey Keating <geoffk@geoffk.org>


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