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]

rs6000 patch for movsi/movdi.



This fixes various problems in the movdi and movsi expanders.  There
are some other problems which seem to be caused by recent reload
changes, I am still looking at those.

I will commit this shortly (unless someone objects).

Tested with bootstrap on rs6000-ibm-aix4.3.3.0 (both normal and
-maix64) and tested on powerpc-eabisim (normal, -fpic, -fPIC).

-- 
- Geoffrey Keating <geoffk@cygnus.com>

===File ~/cygnus/patches/rs6000-64bugs-mov.patch============
2000-05-13  Geoffrey Keating  <geoffk@cygnus.com>

	* config/rs6000/rs6000.md (movsi): Don't modify RTL in-place.
	(movdi): Make similar to movsi.
	* config/rs6000/rs6000.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): There
	is no such thing as a DImode CONST_DOUBLE.
	* config/rs6000/rs6000.c (output_toc): Likewise.
	
Index: config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.120
diff -c -p -r1.120 rs6000.c
*** rs6000.c	2000/05/06 04:31:16	1.120
--- rs6000.c	2000/05/13 19:57:55
*************** output_toc (file, x, labelno)
*** 6227,6233 ****
  	  return;
  	}
      }
!   else if (GET_MODE (x) == DImode
  	   && (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE)
  	   && ! (TARGET_NO_FP_IN_TOC && ! TARGET_MINIMAL_TOC))
      {
--- 6221,6227 ----
  	  return;
  	}
      }
!   else if (GET_MODE (x) == VOIDmode
  	   && (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE)
  	   && ! (TARGET_NO_FP_IN_TOC && ! TARGET_MINIMAL_TOC))
      {
Index: config/rs6000/rs6000.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.h,v
retrieving revision 1.77
diff -c -p -r1.77 rs6000.h
*** rs6000.h	2000/05/06 04:31:16	1.77
--- rs6000.h	2000/05/13 19:57:56
*************** extern int toc_initialized;
*** 2355,2361 ****
         || (! (TARGET_NO_FP_IN_TOC && ! TARGET_MINIMAL_TOC)		\
  	   && GET_CODE (X) == CONST_DOUBLE				\
  	   && (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT		\
! 	       || (TARGET_POWERPC64 && GET_MODE (X) == DImode)))))
  #if 0
  	   && BITS_PER_WORD == HOST_BITS_PER_INT)))
  #endif
--- 2355,2361 ----
         || (! (TARGET_NO_FP_IN_TOC && ! TARGET_MINIMAL_TOC)		\
  	   && GET_CODE (X) == CONST_DOUBLE				\
  	   && (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT		\
! 	       || TARGET_POWERPC64))))
  #if 0
  	   && BITS_PER_WORD == HOST_BITS_PER_INT)))
  #endif
Index: config/rs6000/rs6000.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.85
diff -c -p -r1.85 rs6000.md
*** rs6000.md	2000/05/04 22:15:23	1.85
--- rs6000.md	2000/05/13 19:57:57
***************
*** 8087,8093 ****
  	  && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (
  		XEXP (operands[1], 0))))
  	{
! 	  XEXP (operands[1], 0) = create_TOC_reference (XEXP (operands[1], 0));
  	  MEM_ALIAS_SET (operands[1]) = get_TOC_alias_set ();	
  	  RTX_UNCHANGING_P (operands[1]) = 1;
  	}
--- 7539,7546 ----
  	  && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (
  		XEXP (operands[1], 0))))
  	{
! 	  operands[1] = gen_rtx_MEM (SImode,
! 			     create_TOC_reference (XEXP (operands[1], 0)));
  	  MEM_ALIAS_SET (operands[1]) = get_TOC_alias_set ();	
  	  RTX_UNCHANGING_P (operands[1]) = 1;
  	}
***************
*** 8709,8735 ****
  	}
  
        operands[1] = force_const_mem (DImode, operands[1]);
!       if (TARGET_TOC && CONSTANT_POOL_EXPR_P (XEXP (operands[1], 0)))
  	{
! 	  XEXP (operands[1], 0) = create_TOC_reference (XEXP (operands[1], 0));
  	  MEM_ALIAS_SET (operands[1]) = get_TOC_alias_set ();	
  	  RTX_UNCHANGING_P (operands[1]) = 1;
  	}	
        if (! memory_address_p (DImode, XEXP (operands[1], 0))
  	  && ! reload_in_progress)
  	operands[1] = change_address (operands[1], DImode,
  				      XEXP (operands[1], 0));
      }
- 
-   if (TARGET_TOC 
-      && GET_CODE (operands[1]) == MEM 
-      && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
-     {
-       XEXP (operands[1], 0) = create_TOC_reference (XEXP (operands[1], 0));
-       MEM_ALIAS_SET (operands[1]) = get_TOC_alias_set ();	
-       RTX_UNCHANGING_P (operands[1]) = 1;
-     }
- 
  }")
  
  (define_insn "*movdi_32"
--- 8162,8185 ----
  	}
  
        operands[1] = force_const_mem (DImode, operands[1]);
! 
!       if (TARGET_TOC 
! 	  && CONSTANT_POOL_EXPR_P (XEXP (operands[1], 0))
! 	  && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (
! 		XEXP (operands[1], 0))))
  	{
! 	  operands[1] = gen_rtx_MEM (DImode,
! 			     create_TOC_reference (XEXP (operands[1], 0)));
! 
  	  MEM_ALIAS_SET (operands[1]) = get_TOC_alias_set ();	
  	  RTX_UNCHANGING_P (operands[1]) = 1;
  	}	
+ 
        if (! memory_address_p (DImode, XEXP (operands[1], 0))
  	  && ! reload_in_progress)
  	operands[1] = change_address (operands[1], DImode,
  				      XEXP (operands[1], 0));
      }
  }")
  
  (define_insn "*movdi_32"
============================================================

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