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]

Patch: mips.h GO_IF_LEGITIMATE_ADDRESS large constant handling



Load too large constants into a register instead of allowing them as
an offset to a base register which is later rejected by the add
pattern.

e.g.
struct sss {char xxx[4][0x1000*2];int yyy[10];};
mmm(p, chan) 
     register struct sss *p;
     int chan;
{return p->yyy[chan];}

This has been approved and bootstrapped on irix.

	* mips.h (GO_IF_LEGITIMATE_ADDRESS): Don't accept large
	register offsets; let LEGITIMIZE_ADDRESS load it into a register.
	(LEGITIMIZE_ADDRESS): Use plus_constant to avoid
	(plus (reg) (const_int 0))
  
Index: config/mips/mips.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/mips/mips.h,v
retrieving revision 1.65
diff -c -2 -p -r1.65 mips.h
*** mips.h	1999/09/14 23:29:31	1.65
--- mips.h	1999/09/22 15:58:06
*************** extern struct rtx_def *mips_va_arg ();
*** 2967,2970 ****
--- 2967,2971 ----
  		  || code1 != CONST					\
  		  || GET_CODE (XEXP (xplus1, 0)) != MINUS)		\
+ 	      && ! (code1 == CONST_INT && ! SMALL_INT (xplus1))         \
  	      && !TARGET_MIPS16)					\
  	    goto ADDR;							\
*************** extern struct rtx_def *mips_va_arg ();
*** 3126,3131 ****
  				  gen_rtx_PLUS (Pmode, xplus0, int_reg))); \
  									\
! 	  X = gen_rtx_PLUS (Pmode, ptr_reg,				\
! 			    GEN_INT (INTVAL (xplus1) & 0x7fff));	\
  	  goto WIN;							\
  	}								\
--- 3127,3131 ----
  				  gen_rtx_PLUS (Pmode, xplus0, int_reg))); \
  									\
! 	  X = plus_constant (ptr_reg, INTVAL (xplus1) & 0x7fff);	\
  	  goto WIN;							\
  	}								\



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