[patch] avr port: fix loading constants 1 and 2

Marek Michalkiewicz marekm@linux.org.pl
Thu Oct 12 11:59:00 GMT 2000


2000-10-12  Marek Michalkiewicz  <marekm@linux.org.pl>

	* config/avr/avr.c (output_movhi, output_movsisf): Fix loading
	constants 1 and 2 to NO_LD_REGS.

diff -rc3p orig/egcs/gcc/config/avr/avr.c egcs/gcc/config/avr/avr.c
*** orig/egcs/gcc/config/avr/avr.c	Wed Oct 11 18:20:56 2000
--- egcs/gcc/config/avr/avr.c	Thu Oct 12 19:33:42 2000
*************** output_movhi (insn, operands, l)
*** 1616,1624 ****
  		      return AS1 (inc,%0 ; reg_was_0);
  		    }
  
! 		  *l = 2;
! 		  return (AS1 (clr,%0) CR_TAB
! 			  AS1 (inc,%0));
  		}
  	      else if (src == const2_rtx)
  		{
--- 1616,1625 ----
  		      return AS1 (inc,%0 ; reg_was_0);
  		    }
  
! 		  *l = 3;
! 		  return (AS1 (clr,%A0) CR_TAB
! 			  AS1 (clr,%B0) CR_TAB
! 			  AS1 (inc,%A0));
  		}
  	      else if (src == const2_rtx)
  		{
*************** output_movhi (insn, operands, l)
*** 1629,1638 ****
  			      AS1 (inc,%0));
  		    }
  
! 		  *l = 3;
! 		  return (AS1 (clr,%0) CR_TAB
! 			  AS1 (inc,%0) CR_TAB
! 			  AS1 (inc,%0));
  		}
  	      else if (src == constm1_rtx)
  		{
--- 1630,1640 ----
  			      AS1 (inc,%0));
  		    }
  
! 		  *l = 4;
! 		  return (AS1 (clr,%A0) CR_TAB
! 			  AS1 (clr,%B0) CR_TAB
! 			  AS1 (inc,%A0) CR_TAB
! 			  AS1 (inc,%A0));
  		}
  	      else if (src == constm1_rtx)
  		{
*************** output_movsisf(insn, operands, l)
*** 2280,2290 ****
  		      *l = 1;
  		      return AS1 (inc,%A0 ; reg_was_0);
  		    }
! 
! 		  *l = 4;
! 		  return (AS1 (clr,%D0) CR_TAB
  			  AS1 (clr,%B0) CR_TAB
  			  AS1 (clr,%C0) CR_TAB
  			  AS1 (inc,%A0));
  		}
  	      else if (src == const2_rtx)
--- 2282,2300 ----
  		      *l = 1;
  		      return AS1 (inc,%A0 ; reg_was_0);
  		    }
! 		  if (AVR_ENHANCED)
! 		    {
! 		      *l = 4;
! 		      return (AS1 (clr,%A0) CR_TAB
! 			      AS1 (clr,%B0) CR_TAB
! 			      AS2 (movw,%C0,%A0) CR_TAB
! 			      AS1 (inc,%A0));
! 		    }
! 		  *l = 5;
! 		  return (AS1 (clr,%A0) CR_TAB
  			  AS1 (clr,%B0) CR_TAB
  			  AS1 (clr,%C0) CR_TAB
+ 			  AS1 (clr,%D0) CR_TAB
  			  AS1 (inc,%A0));
  		}
  	      else if (src == const2_rtx)



More information about the Gcc-patches mailing list