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: PATCH, rs6000 (alpha?) long const --verbose


On Sat, Dec 29, 2001 at 11:42:37PM -0600, Tom Rix wrote:
>           try_split (PATTERN (insn), insn, 0);   << --splitting the r1 =

Hum.  I'm of the opinion that this is fairly dodgy.  Try this.


r~



Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.270
diff -c -p -d -r1.270 rs6000.c
*** rs6000.c	2001/12/29 09:07:56	1.270
--- rs6000.c	2001/12/30 06:49:38
*************** rs6000_emit_set_const (dest, mode, sourc
*** 1951,1963 ****
  {
    HOST_WIDE_INT c0, c1;
  
!   if (mode == QImode || mode == HImode || mode == SImode)
      {
-       if (dest == NULL)
-         dest = gen_reg_rtx (mode);
        emit_insn (gen_rtx_SET (VOIDmode, dest, source));
        return dest;
      }
  
    if (GET_CODE (source) == CONST_INT)
      {
--- 1951,1976 ----
  {
    HOST_WIDE_INT c0, c1;
  
!   if (dest == NULL)
!     dest = gen_reg_rtx (mode);
! 
!   if (num_insns_constant (source, mode) == 1)
      {
        emit_insn (gen_rtx_SET (VOIDmode, dest, source));
        return dest;
      }
+   else if (mode == SImode)
+     {
+       if (GET_CODE (source) != CONST_INT)
+ 	abort ();
+       c0 = INTVAL (source);
+       emit_insn (gen_rtx_SET (VOIDmode, dest,
+ 			      GEN_INT (c0 & ~ (HOST_WIDE_INT) 0xffff)));
+       emit_insn (gen_rtx_SET (VOIDmode, dest,
+ 			      gen_rtx_IOR (mode, dest,
+ 				      	   GEN_INT (c0 & 0xffff))));
+       return dest;
+     }
  
    if (GET_CODE (source) == CONST_INT)
      {
*************** rs6000_emit_allocate_stack (size, copy_r
*** 7755,7769 ****
    if (TARGET_UPDATE)
      {
        if (size > 32767)
! 	{
! 	  /* Need a note here so that try_split doesn't get confused.  */
! 	  if (get_last_insn() == NULL_RTX)
! 	    emit_note (0, NOTE_INSN_DELETED);
! 	  insn = emit_move_insn (tmp_reg, todec);
! 	  try_split (PATTERN (insn), insn, 0);
! 	  todec = tmp_reg;
! 	}
!       
        if (Pmode == SImode)
  	insn = emit_insn (gen_movsi_update (stack_reg, stack_reg, 
  					    todec, stack_reg));
--- 7768,7775 ----
    if (TARGET_UPDATE)
      {
        if (size > 32767)
! 	todec = rs6000_emit_set_const (tmp_reg, Pmode, todec, 5);
! 
        if (Pmode == SImode)
  	insn = emit_insn (gen_movsi_update (stack_reg, stack_reg, 
  					    todec, stack_reg));


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