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]

[3.3, mainline] Updated patch for GCC misscompilation with -march=pentium4


Hi,
the discussion on this patch apparently got suck.  Here is version
updated for current tree with the changes to mips/sh and documentation
Richard requested last time.
It does not iterate over classes instead of registers as it won't work
as I've explained in followup to original patch.

Regtested/bootstrapped i386, compiled mips and sh.
Hona

Fri Dec 13 12:44:19 CET 2002  Jan Hubicka  <jh@suse.cz>

	* combine.c (simplify_set): Reverse order of ragumetns to
	REG_CANNOT_CHANGE_MODE_P
	* df.c (df_def_record_1): Likewise.
	* recog.c (register_operand): Likewise.
	* simplify-rtx.c (simplify_subreg): Likewise.
	* hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): Update use of
	CANNOT_CHANGE_MODE_CLASS.
	* regclass.c (cannot_change_mode_set_regs, invalid_mode_change_p):
	Likewise.
	* reload.c (push_reload): Likewise.
	* alpha.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
	* ia64.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
	* mips.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
	* mips-protos.h (mips_cannot_change_mode_class): Update prototype.
	* mips.c (mips_cannot_change_mode_class): Update.
	* pa64-regs.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
	* rs6000.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
	* s390.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
	* sh.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
	* sh-protos.h (sh_cannot_change_mode_class): Update prototype.
	* sh.c (sh_cannot_change_mode_class): Update.
	* i386.h (CANNOT_CHANGE_MODE_CLASS): New.
	* tm.texi (CANNOT_CHANGE_MODE_CLASS): Update documentation.

Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.327
diff -c -3 -p -r1.327 combine.c
*** combine.c	10 Jan 2003 23:36:17 -0000	1.327
--- combine.c	18 Jan 2003 15:07:21 -0000
*************** simplify_set (x)
*** 5238,5245 ****
  #ifdef CANNOT_CHANGE_MODE_CLASS
        && ! (GET_CODE (dest) == REG && REGNO (dest) < FIRST_PSEUDO_REGISTER
  	    && REG_CANNOT_CHANGE_MODE_P (REGNO (dest),
! 					 GET_MODE (src), 
! 					 GET_MODE (SUBREG_REG (src))))
  #endif
        && (GET_CODE (dest) == REG
  	  || (GET_CODE (dest) == SUBREG
--- 5238,5245 ----
  #ifdef CANNOT_CHANGE_MODE_CLASS
        && ! (GET_CODE (dest) == REG && REGNO (dest) < FIRST_PSEUDO_REGISTER
  	    && REG_CANNOT_CHANGE_MODE_P (REGNO (dest),
! 					 GET_MODE (SUBREG_REG (src)), 
! 					 GET_MODE (src)))
  #endif
        && (GET_CODE (dest) == REG
  	  || (GET_CODE (dest) == SUBREG
Index: df.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/df.c,v
retrieving revision 1.41
diff -c -3 -p -r1.41 df.c
*** df.c	19 Dec 2002 05:18:04 -0000	1.41
--- df.c	18 Jan 2003 15:07:22 -0000
*************** df_def_record_1 (df, x, bb, insn)
*** 945,952 ****
  
  #ifdef CLASS_CANNOT_CHANGE_MODE
    if (GET_CODE (dst) == SUBREG
!       && CLASS_CANNOT_CHANGE_MODE_P (GET_MODE (dst),
! 				     GET_MODE (SUBREG_REG (dst))))
      flags |= DF_REF_MODE_CHANGE;
  #endif
  
--- 945,952 ----
  
  #ifdef CLASS_CANNOT_CHANGE_MODE
    if (GET_CODE (dst) == SUBREG
!       && CLASS_CANNOT_CHANGE_MODE_P (GET_MODE (SUBREG_REG (dst)),
! 				     GET_MODE (dst)))
      flags |= DF_REF_MODE_CHANGE;
  #endif
  
*************** df_def_record_1 (df, x, bb, insn)
*** 966,973 ****
  	}
  #ifdef CLASS_CANNOT_CHANGE_MODE
        if (GET_CODE (dst) == SUBREG
! 	  && CLASS_CANNOT_CHANGE_MODE_P (GET_MODE (dst),
! 				         GET_MODE (SUBREG_REG (dst))))
          flags |= DF_REF_MODE_CHANGE;
  #endif
        loc = &XEXP (dst, 0);
--- 966,973 ----
  	}
  #ifdef CLASS_CANNOT_CHANGE_MODE
        if (GET_CODE (dst) == SUBREG
! 	  && CLASS_CANNOT_CHANGE_MODE_P (GET_MODE (SUBREG_REG (dst)),
! 				         GET_MODE (dst)))
          flags |= DF_REF_MODE_CHANGE;
  #endif
        loc = &XEXP (dst, 0);
Index: hard-reg-set.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/hard-reg-set.h,v
retrieving revision 1.18
diff -c -3 -p -r1.18 hard-reg-set.h
*** hard-reg-set.h	16 Nov 2002 17:52:53 -0000	1.18
--- hard-reg-set.h	18 Jan 2003 15:07:22 -0000
*************** extern const char * reg_names[FIRST_PSEU
*** 491,498 ****
  /* Given a hard REGN a FROM mode and a TO mode, return nonzero if
     REGN cannot change modes between the specified modes.  */
  #define REG_CANNOT_CHANGE_MODE_P(REGN, FROM, TO)                          \
!         (TEST_HARD_REG_BIT                                                \
!           (reg_class_contents[(int) CANNOT_CHANGE_MODE_CLASS (FROM, TO)],  \
!            REGN))
  
  #endif /* ! GCC_HARD_REG_SET_H */
--- 491,496 ----
  /* Given a hard REGN a FROM mode and a TO mode, return nonzero if
     REGN cannot change modes between the specified modes.  */
  #define REG_CANNOT_CHANGE_MODE_P(REGN, FROM, TO)                          \
!          CANNOT_CHANGE_MODE_CLASS (FROM, TO, REGNO_REG_CLASS (REGN))
  
  #endif /* ! GCC_HARD_REG_SET_H */
Index: recog.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/recog.c,v
retrieving revision 1.173
diff -c -3 -p -r1.173 recog.c
*** recog.c	16 Jan 2003 15:13:14 -0000	1.173
--- recog.c	18 Jan 2003 15:07:23 -0000
*************** register_operand (op, mode)
*** 1088,1094 ****
  #ifdef CANNOT_CHANGE_MODE_CLASS
        if (GET_CODE (sub) == REG
  	  && REGNO (sub) < FIRST_PSEUDO_REGISTER
! 	  && REG_CANNOT_CHANGE_MODE_P (REGNO (sub), mode, GET_MODE (sub))
  	  && GET_MODE_CLASS (GET_MODE (sub)) != MODE_COMPLEX_INT
  	  && GET_MODE_CLASS (GET_MODE (sub)) != MODE_COMPLEX_FLOAT)
  	return 0;
--- 1088,1094 ----
  #ifdef CANNOT_CHANGE_MODE_CLASS
        if (GET_CODE (sub) == REG
  	  && REGNO (sub) < FIRST_PSEUDO_REGISTER
! 	  && REG_CANNOT_CHANGE_MODE_P (REGNO (sub), GET_MODE (sub), mode)
  	  && GET_MODE_CLASS (GET_MODE (sub)) != MODE_COMPLEX_INT
  	  && GET_MODE_CLASS (GET_MODE (sub)) != MODE_COMPLEX_FLOAT)
  	return 0;
Index: regclass.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regclass.c,v
retrieving revision 1.165
diff -c -3 -p -r1.165 regclass.c
*** regclass.c	16 Jan 2003 15:13:15 -0000	1.165
--- regclass.c	18 Jan 2003 15:07:24 -0000
*************** cannot_change_mode_set_regs (used, from,
*** 2628,2636 ****
    for (to = VOIDmode; to < MAX_MACHINE_MODE; ++to)
      if (REGNO_REG_SET_P (&subregs_of_mode[to], regno))
        {
!         class = CANNOT_CHANGE_MODE_CLASS (from, to);
!         if (class != NO_REGS)
!           IOR_HARD_REG_SET (*used, reg_class_contents [(int) class]);
        }
  }
  
--- 2628,2638 ----
    for (to = VOIDmode; to < MAX_MACHINE_MODE; ++to)
      if (REGNO_REG_SET_P (&subregs_of_mode[to], regno))
        {
! 	int i;
! 	for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
!           if (! TEST_HARD_REG_BIT (*used, i)
! 	      && REG_CANNOT_CHANGE_MODE_P (from, to, i))
! 	    SET_HARD_REG_BIT (*used, i);
        }
  }
  
*************** invalid_mode_change_p (regno, class, fro
*** 2647,2654 ****
  
    for (to_mode = 0; to_mode < NUM_MACHINE_MODES; ++to_mode)
      if (REGNO_REG_SET_P (&subregs_of_mode[(int) to_mode], regno)
! 	&& reg_classes_intersect_p 
! 	     (class, CANNOT_CHANGE_MODE_CLASS (from_mode, to_mode)))
        return 1;
    return 0;
  }
--- 2649,2655 ----
  
    for (to_mode = 0; to_mode < NUM_MACHINE_MODES; ++to_mode)
      if (REGNO_REG_SET_P (&subregs_of_mode[(int) to_mode], regno)
! 	&& CANNOT_CHANGE_MODE_CLASS (from_mode, to_mode, class))
        return 1;
    return 0;
  }
Index: reload.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload.c,v
retrieving revision 1.204
diff -c -3 -p -r1.204 reload.c
*** reload.c	16 Jan 2003 15:13:16 -0000	1.204
--- reload.c	18 Jan 2003 15:07:27 -0000
*************** push_reload (in, out, inloc, outloc, cla
*** 975,983 ****
    if (in != 0 && GET_CODE (in) == SUBREG
        && (subreg_lowpart_p (in) || strict_low)
  #ifdef CANNOT_CHANGE_MODE_CLASS
!       && !reg_classes_intersect_p 
! 	   (class, CANNOT_CHANGE_MODE_CLASS (GET_MODE (SUBREG_REG (in)),
! 					     inmode))
  #endif
        && (CONSTANT_P (SUBREG_REG (in))
  	  || GET_CODE (SUBREG_REG (in)) == PLUS
--- 975,981 ----
    if (in != 0 && GET_CODE (in) == SUBREG
        && (subreg_lowpart_p (in) || strict_low)
  #ifdef CANNOT_CHANGE_MODE_CLASS
!       && !CANNOT_CHANGE_MODE_CLASS (GET_MODE (SUBREG_REG (in)), inmode, class)
  #endif
        && (CONSTANT_P (SUBREG_REG (in))
  	  || GET_CODE (SUBREG_REG (in)) == PLUS
*************** push_reload (in, out, inloc, outloc, cla
*** 1087,1095 ****
    if (out != 0 && GET_CODE (out) == SUBREG
        && (subreg_lowpart_p (out) || strict_low)
  #ifdef CANNOT_CHANGE_MODE_CLASS
!       && !reg_classes_intersect_p 
! 	    (class, CANNOT_CHANGE_MODE_CLASS (GET_MODE (SUBREG_REG (out)),
! 					      outmode))
  #endif
        && (CONSTANT_P (SUBREG_REG (out))
  	  || strict_low
--- 1085,1091 ----
    if (out != 0 && GET_CODE (out) == SUBREG
        && (subreg_lowpart_p (out) || strict_low)
  #ifdef CANNOT_CHANGE_MODE_CLASS
!       && !CANNOT_CHANGE_MODE_CLASS (GET_MODE (SUBREG_REG (out)), outmode, class)
  #endif
        && (CONSTANT_P (SUBREG_REG (out))
  	  || strict_low
Index: simplify-rtx.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/simplify-rtx.c,v
retrieving revision 1.128
diff -c -3 -p -r1.128 simplify-rtx.c
*** simplify-rtx.c	24 Dec 2002 08:30:31 -0000	1.128
--- simplify-rtx.c	18 Jan 2003 15:07:29 -0000
*************** simplify_subreg (outermode, op, innermod
*** 2544,2550 ****
  	  || ! rtx_equal_function_value_matters)
        && REGNO (op) < FIRST_PSEUDO_REGISTER
  #ifdef CANNOT_CHANGE_MODE_CLASS
!       && ! (REG_CANNOT_CHANGE_MODE_P (REGNO (op), outermode, innermode)
  	    && GET_MODE_CLASS (innermode) != MODE_COMPLEX_INT
  	    && GET_MODE_CLASS (innermode) != MODE_COMPLEX_FLOAT)
  #endif
--- 2544,2550 ----
  	  || ! rtx_equal_function_value_matters)
        && REGNO (op) < FIRST_PSEUDO_REGISTER
  #ifdef CANNOT_CHANGE_MODE_CLASS
!       && ! (REG_CANNOT_CHANGE_MODE_P (REGNO (op), innermode, outermode)
  	    && GET_MODE_CLASS (innermode) != MODE_COMPLEX_INT
  	    && GET_MODE_CLASS (innermode) != MODE_COMPLEX_FLOAT)
  #endif
Index: config/alpha/alpha.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.h,v
retrieving revision 1.188
diff -c -3 -p -r1.188 alpha.h
*** config/alpha/alpha.h	10 Jan 2003 23:54:34 -0000	1.188
--- config/alpha/alpha.h	18 Jan 2003 15:07:32 -0000
*************** enum reg_class {
*** 866,873 ****
  
  /* Return the class of registers that cannot change mode from FROM to TO.  */
  
! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO) \
!   (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) ? FLOAT_REGS : NO_REGS)
  
  /* Define the cost of moving between registers of various classes.  Moving
     between FLOAT_REGS and anything else except float regs is expensive. 
--- 866,874 ----
  
  /* Return the class of registers that cannot change mode from FROM to TO.  */
  
! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)		\
!   (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)			\
!    ? reg_classes_intersect_p (FLOAT_REGS, CLASS) : 0)
  
  /* Define the cost of moving between registers of various classes.  Moving
     between FLOAT_REGS and anything else except float regs is expensive. 
Index: config/i386/i386.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.h,v
retrieving revision 1.313
diff -c -3 -p -r1.313 i386.h
*** config/i386/i386.h	26 Dec 2002 18:45:03 -0000	1.313
--- config/i386/i386.h	18 Jan 2003 15:07:34 -0000
*************** enum reg_class
*** 1558,1563 ****
--- 1558,1577 ----
     || ((CLASS) == SIREG)						\
     || ((CLASS) == DIREG))
  
+ /* Return a class of registers that cannot change FROM mode to TO mode.
+   
+    x87 registers can't do subreg as all values are reformated to extended
+    precision.  XMM registers does not support with nonzero offsets equal
+    to 4, 8 and 12 otherwise valid for integer registers. Since we can't
+    determine these, prohibit all nonparadoxical subregs changing size.  */
+ 
+ #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)	\
+   (GET_MODE_SIZE (TO) < GET_MODE_SIZE (FROM)		\
+    ? reg_classes_intersect_p (FLOAT_SSE_REGS, (CLASS))	\
+      || MAYBE_MMX_CLASS_P (CLASS) 			\
+    : GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)		\
+    ? reg_classes_intersect_p (FLOAT_REGS, (CLASS)) : 0)
+ 
  /* A C statement that adds to CLOBBERS any hard regs the port wishes
     to automatically clobber for all asms.
  
Index: config/ia64/ia64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.h,v
retrieving revision 1.138
diff -c -3 -p -r1.138 ia64.h
*** config/ia64/ia64.h	9 Jan 2003 23:15:30 -0000	1.138
--- config/ia64/ia64.h	18 Jan 2003 15:07:43 -0000
*************** enum reg_class
*** 1036,1043 ****
  /* In FP regs, we can't change FP values to integer values and vice
     versa, but we can change e.g. DImode to SImode.  */
  
! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO) 	\
!   (GET_MODE_CLASS (FROM) != GET_MODE_CLASS (TO) ? FR_REGS : NO_REGS)
  
  /* A C expression that defines the machine-dependent operand constraint
     letters (`I', `J', `K', .. 'P') that specify particular ranges of
--- 1036,1044 ----
  /* In FP regs, we can't change FP values to integer values and vice
     versa, but we can change e.g. DImode to SImode.  */
  
! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) 	\
!   (GET_MODE_CLASS (FROM) != GET_MODE_CLASS (TO)		\
!    ? reg_classes_intersect_p (CLASS, FR_REGS) : 0)
  
  /* A C expression that defines the machine-dependent operand constraint
     letters (`I', `J', `K', .. 'P') that specify particular ranges of
Index: config/mips/mips-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips-protos.h,v
retrieving revision 1.31
diff -c -3 -p -r1.31 mips-protos.h
*** config/mips/mips-protos.h	16 Dec 2002 18:21:35 -0000	1.31
--- config/mips/mips-protos.h	18 Jan 2003 15:07:43 -0000
*************** extern int              mips_adjust_insn
*** 122,129 ****
  extern enum reg_class	mips_secondary_reload_class PARAMS ((enum reg_class,
  							     enum machine_mode,
  							     rtx, int));
! extern enum reg_class	mips_cannot_change_mode_class 
! 			  PARAMS ((enum machine_mode, enum machine_mode));
  extern int              mips_class_max_nregs PARAMS ((enum reg_class,
  						      enum machine_mode));
  extern int              mips_register_move_cost PARAMS ((enum machine_mode,
--- 122,130 ----
  extern enum reg_class	mips_secondary_reload_class PARAMS ((enum reg_class,
  							     enum machine_mode,
  							     rtx, int));
! extern bool		mips_cannot_change_mode_class 
! 			  PARAMS ((enum machine_mode, enum machine_mode,
! 				   enum reg_class));
  extern int              mips_class_max_nregs PARAMS ((enum reg_class,
  						      enum machine_mode));
  extern int              mips_register_move_cost PARAMS ((enum machine_mode,
Index: config/mips/mips.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.246
diff -c -3 -p -r1.246 mips.c
*** config/mips/mips.c	9 Jan 2003 09:43:22 -0000	1.246
--- config/mips/mips.c	18 Jan 2003 15:07:46 -0000
*************** function_arg_pass_by_reference (cum, mod
*** 8405,8423 ****
     We can't allow 64-bit float registers to change from a 32-bit
     mode to a 64-bit mode.  */
  
! enum reg_class
! mips_cannot_change_mode_class (from, to)
       enum machine_mode from, to;
  {
    if (GET_MODE_SIZE (from) != GET_MODE_SIZE (to))
      {
        if (TARGET_BIG_ENDIAN)
!         return FP_REGS;
        if (TARGET_FLOAT64)
!         return HI_AND_FP_REGS;
!       return HI_REG;
      }
!   return NO_REGS;
  }
  
  /* This function returns the register class required for a secondary
--- 8405,8424 ----
     We can't allow 64-bit float registers to change from a 32-bit
     mode to a 64-bit mode.  */
  
! bool
! mips_cannot_change_mode_class (from, to, class)
       enum machine_mode from, to;
+      enum reg_class class;
  {
    if (GET_MODE_SIZE (from) != GET_MODE_SIZE (to))
      {
        if (TARGET_BIG_ENDIAN)
! 	return reg_classes_intersect_p (FP_REGS, class)
        if (TARGET_FLOAT64)
! 	return reg_classes_intersect_p (HI_AND_FP_REGS, class)
!       return reg_classes_intersect_p (HI_REG, class)
      }
!   return false;
  }
  
  /* This function returns the register class required for a secondary
Index: config/mips/mips.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.h,v
retrieving revision 1.233
diff -c -3 -p -r1.233 mips.h
*** config/mips/mips.h	17 Jan 2003 05:00:23 -0000	1.233
--- config/mips/mips.h	18 Jan 2003 15:07:49 -0000
*************** extern enum reg_class mips_char_to_class
*** 2354,2361 ****
  
  #define CLASS_MAX_NREGS(CLASS, MODE) mips_class_max_nregs (CLASS, MODE)
  
! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO) \
!   mips_cannot_change_mode_class (FROM, TO)
  
  /* Stack layout; function entry, exit and calling.  */
  
--- 2354,2361 ----
  
  #define CLASS_MAX_NREGS(CLASS, MODE) mips_class_max_nregs (CLASS, MODE)
  
! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
!   mips_cannot_change_mode_class (FROM, TO, CLASS)
  
  /* Stack layout; function entry, exit and calling.  */
  
Index: config/pa/pa64-regs.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa64-regs.h,v
retrieving revision 1.11
diff -c -3 -p -r1.11 pa64-regs.h
*** config/pa/pa64-regs.h	4 Nov 2002 16:57:08 -0000	1.11
--- config/pa/pa64-regs.h	18 Jan 2003 15:07:49 -0000
*************** enum reg_class { NO_REGS, R1_REGS, GENER
*** 240,248 ****
     we inhibit changes from SImode unless they are to a mode that is
     identical in size.  */
  
! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO)			\
    ((FROM) == SImode && GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)       \
!    ? FP_REGS : NO_REGS)
  
  /* Return the class number of the smallest class containing
     reg number REGNO.  This could be a conditional expression
--- 240,248 ----
     we inhibit changes from SImode unless they are to a mode that is
     identical in size.  */
  
! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)		\
    ((FROM) == SImode && GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)       \
!    ? reg_classes_intersect_p (CLASS, FP_REGS) : 0)
  
  /* Return the class number of the smallest class containing
     reg number REGNO.  This could be a conditional expression
Index: config/rs6000/rs6000.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.h,v
retrieving revision 1.245
diff -c -3 -p -r1.245 rs6000.h
*** config/rs6000/rs6000.h	16 Jan 2003 18:09:21 -0000	1.245
--- config/rs6000/rs6000.h	18 Jan 2003 15:07:52 -0000
*************** enum reg_class
*** 1329,1338 ****
  
  /* Return a class of registers that cannot change FROM mode to TO mode.  */
  
! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO)				 \
!   (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) ? FLOAT_REGS		 \
!    : (SPE_VECTOR_MODE (FROM) + SPE_VECTOR_MODE (TO)) == 1 ? GENERAL_REGS \
!    : NO_REGS)
  
  /* Stack layout; function entry, exit and calling.  */
  
--- 1329,1340 ----
  
  /* Return a class of registers that cannot change FROM mode to TO mode.  */
  
! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)			\
!   (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)				\
!    ? reg_classes_intersect_p (FLOAT_REGS, CLASS)			\
!    : (SPE_VECTOR_MODE (FROM) + SPE_VECTOR_MODE (TO)) == 1		\
!    ? reg_classes_intersect_p (GENERAL_REGS, CLASS) 			\
!    : 0)
  
  /* Stack layout; function entry, exit and calling.  */
  
Index: config/s390/s390.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.h,v
retrieving revision 1.58
diff -c -3 -p -r1.58 s390.h
*** config/s390/s390.h	13 Jan 2003 21:37:13 -0000	1.58
--- config/s390/s390.h	18 Jan 2003 15:07:53 -0000
*************** do								\
*** 370,377 ****
  /* If a 4-byte value is loaded into a FPR, it is placed into the
     *upper* half of the register, not the lower.  Therefore, we
     cannot use SUBREGs to switch between modes in FP registers.  */
! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO)		\
!   (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) ? FP_REGS : NO_REGS)
  
  /* Register classes.  */
   
--- 370,378 ----
  /* If a 4-byte value is loaded into a FPR, it is placed into the
     *upper* half of the register, not the lower.  Therefore, we
     cannot use SUBREGs to switch between modes in FP registers.  */
! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)		\
!   (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)			\
!    ? reg_classes_intersect_p (FP_REGS, CLASS) : 0)
  
  /* Register classes.  */
   
Index: config/sh/sh-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh-protos.h,v
retrieving revision 1.37
diff -c -3 -p -r1.37 sh-protos.h
*** config/sh/sh-protos.h	1 Jan 2003 20:23:02 -0000	1.37
--- config/sh/sh-protos.h	18 Jan 2003 15:07:53 -0000
*************** extern int sh_pr_n_sets PARAMS ((void));
*** 127,134 ****
  extern int sh_hard_regno_rename_ok PARAMS ((unsigned int, unsigned int));
  extern int sh_cfun_interrupt_handler_p PARAMS ((void));
  extern void sh_initialize_trampoline PARAMS ((rtx, rtx, rtx));
! extern enum reg_class sh_cannot_change_mode_class
! 	      PARAMS ((enum machine_mode, enum machine_mode));
  extern void sh_mark_label PARAMS ((rtx, int));
  extern int sh_register_move_cost
    PARAMS ((enum machine_mode mode, enum reg_class, enum reg_class));
--- 127,134 ----
  extern int sh_hard_regno_rename_ok PARAMS ((unsigned int, unsigned int));
  extern int sh_cfun_interrupt_handler_p PARAMS ((void));
  extern void sh_initialize_trampoline PARAMS ((rtx, rtx, rtx));
! extern bool sh_cannot_change_mode_class
! 	      PARAMS ((enum machine_mode, enum machine_mode, enum reg_class));
  extern void sh_mark_label PARAMS ((rtx, int));
  extern int sh_register_move_cost
    PARAMS ((enum machine_mode mode, enum reg_class, enum reg_class));
Index: config/sh/sh.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.c,v
retrieving revision 1.191
diff -c -3 -p -r1.191 sh.c
*** config/sh/sh.c	17 Jan 2003 00:26:53 -0000	1.191
--- config/sh/sh.c	18 Jan 2003 15:07:59 -0000
*************** sh_expand_binop_v2sf (code, op0, op1, op
*** 7870,7876 ****
  
  /* Return the class of registers for which a mode change from FROM to TO
     is invalid.  */
! enum reg_class 
  sh_cannot_change_mode_class (from, to)
       enum machine_mode from, to;
  {
--- 7870,7876 ----
  
  /* Return the class of registers for which a mode change from FROM to TO
     is invalid.  */
! bool
  sh_cannot_change_mode_class (from, to)
       enum machine_mode from, to;
  {
*************** sh_cannot_change_mode_class (from, to)
*** 7879,7893 ****
         if (TARGET_LITTLE_ENDIAN)
           {
  	   if (GET_MODE_SIZE (to) < 8 || GET_MODE_SIZE (from) < 8)
! 	     return DF_REGS;
  	 }
         else
  	 {
  	   if (GET_MODE_SIZE (from) < 8)
! 	     return DF_HI_REGS;
  	 }
      }
!   return NO_REGS;
  }
  
  
--- 7879,7893 ----
         if (TARGET_LITTLE_ENDIAN)
           {
  	   if (GET_MODE_SIZE (to) < 8 || GET_MODE_SIZE (from) < 8)
! 	     return reg_class_intersect_p (DF_REGS, class);
  	 }
         else
  	 {
  	   if (GET_MODE_SIZE (from) < 8)
! 	     return reg_class_intersect_p (DF_HI_REGS, class);
  	 }
      }
!   return 0;
  }
  
  
Index: config/sh/sh.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.h,v
retrieving revision 1.184
diff -c -3 -p -r1.184 sh.h
*** config/sh/sh.h	9 Jan 2003 17:25:29 -0000	1.184
--- config/sh/sh.h	18 Jan 2003 15:08:02 -0000
*************** extern enum reg_class reg_class_from_let
*** 1380,1387 ****
  /* ??? We need to renumber the internal numbers for the frnn registers
     when in little endian in order to allow mode size changes.  */
  
! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO) 			    \
!   sh_cannot_change_mode_class (FROM, TO)
  
  /* Stack layout; function entry, exit and calling.  */
  
--- 1380,1387 ----
  /* ??? We need to renumber the internal numbers for the frnn registers
     when in little endian in order to allow mode size changes.  */
  
! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) 			    \
!   sh_cannot_change_mode_class (FROM, TO, CLASS)
  
  /* Stack layout; function entry, exit and calling.  */
  
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.190
diff -c -3 -p -r1.190 tm.texi
*** doc/tm.texi	9 Jan 2003 23:15:34 -0000	1.190
--- doc/tm.texi	18 Jan 2003 15:08:07 -0000
*************** should be the maximum value of @code{HAR
*** 2598,2607 ****
  This macro helps control the handling of multiple-word values
  in the reload pass.
  
! @item CANNOT_CHANGE_MODE_CLASS(@var{from}, @var{to})
! If defined, a C expression that returns a register class for which
! a change from mode @var{from} to mode @var{to} is invalid, otherwise the
! macro returns @code{NO_REGS}.
  
  For the example, loading 32-bit integer or floating-point objects into
  floating-point registers on the Alpha extends them to 64 bits.
--- 2598,2606 ----
  This macro helps control the handling of multiple-word values
  in the reload pass.
  
! @item CANNOT_CHANGE_MODE_CLASS(@var{from}, @var{to}, @var{class})
! If defined, a C expression that returns nonzero for a @var{class} for which
! a change from mode @var{from} to mode @var{to} is invalid.
  
  For the example, loading 32-bit integer or floating-point objects into
  floating-point registers on the Alpha extends them to 64 bits.
*************** register.  Therefore, @file{alpha.h} def
*** 2611,2618 ****
  as below:
  
  @example
! #define CANNOT_CHANGE_MODE_CLASS \
!   (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) ? FLOAT_REGS : NO_REGS)
  @end example
  @end table
  
--- 2610,2618 ----
  as below:
  
  @example
! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
!   (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \
!    ? reg_classes_intersect_p (FLOAT_REGS, (CLASS)) : 0)
  @end example
  @end table
  


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