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]

Re: Temporarily disable -frename-registers on d30v, add help strings


On Wed, Nov 22, 2000 at 03:28:41PM -0800, Richard Henderson wrote:
> On Wed, Nov 22, 2000 at 01:19:53PM -0500, Michael Meissner wrote:
> > Right now, -frename-registers doesn't work on the d30v...
> 
> Is this still true as of yesterday?  The one abort I could see
> happening regularly was turning into "stop optimizing".

Yes, the following patch that I installed fixes the problems that ultimately
were caused by operand/operator numbers having holes in them, and some cases
where the wrong constraint was used.  While I was at it, I rewrote the code to
use COND_EXEC and fix some warnings.

2000-11-27  Michael Meissner  <meissner@redhat.com>

	* d30v-protos.h (srelational_si_operator): Correctly spell
	function.
	(urelational_si_operator): Ditto.
	(relational_si_operator): Ditto.
	(d30v_expand_prologue): Add prototype.
	(d30v_expand_epilogue): Ditto.

	* d30v.h (OPTIMIZATION_OPTIONS): Undo November 22nd change.

	* d30v.md (movcccc_*): Delete now unused patterns.
	(64 bit comparison splitters): Rewrite to use COND_EXEC instead of
	IF_THEN_ELSE.
	(define_cond_exec): Use 'b' to select branch flags.

*** gcc/config/d30v/d30v-protos.h.~1~	Sat Aug 19 18:27:11 2000
--- gcc/config/d30v/d30v-protos.h	Mon Nov 27 00:21:01 2000
*************** extern int branch_zero_operator		PARAMS 
*** 65,73 ****
  extern int cond_move_dest_operand	PARAMS ((rtx, enum machine_mode));
  extern int cond_move_operand		PARAMS ((rtx, enum machine_mode));
  extern int cond_exec_operand		PARAMS ((rtx, enum machine_mode));
! extern int srelational_si_operand	PARAMS ((rtx, enum machine_mode));
! extern int urelational_si_operand	PARAMS ((rtx, enum machine_mode));
! extern int relational_di_operand	PARAMS ((rtx, enum machine_mode));
  #endif
  extern d30v_stack_t *d30v_stack_info	PARAMS ((void));
  extern int direct_return		PARAMS ((void));
--- 65,73 ----
  extern int cond_move_dest_operand	PARAMS ((rtx, enum machine_mode));
  extern int cond_move_operand		PARAMS ((rtx, enum machine_mode));
  extern int cond_exec_operand		PARAMS ((rtx, enum machine_mode));
! extern int srelational_si_operator	PARAMS ((rtx, enum machine_mode));
! extern int urelational_si_operator	PARAMS ((rtx, enum machine_mode));
! extern int relational_di_operator	PARAMS ((rtx, enum machine_mode));
  #endif
  extern d30v_stack_t *d30v_stack_info	PARAMS ((void));
  extern int direct_return		PARAMS ((void));
*************** extern rtx d30v_expand_builtin_va_arg	PA
*** 111,117 ****
--- 111,119 ----
  #endif	/* TREE_CODE */
  
  extern void d30v_function_prologue	PARAMS ((FILE *, int));
+ extern void d30v_expand_prologue	PARAMS ((void));
  extern void d30v_function_epilogue	PARAMS ((FILE *, int));
+ extern void d30v_expand_epilogue	PARAMS ((void));
  extern void d30v_function_profiler	PARAMS ((FILE *, int));
  #ifdef RTX_CODE
  extern void d30v_split_double		PARAMS ((rtx, rtx *, rtx *));
*** gcc/config/d30v/d30v.h.~1~	Wed Nov 22 13:04:16 2000
--- gcc/config/d30v/d30v.h	Mon Nov 27 01:05:53 2000
*************** extern int target_flags;
*** 545,556 ****
     *Do not examine `write_symbols' in this macro!* The debugging options are
     *not supposed to alter the generated code.  */
  
! /* -frename-registers seems to abort on d30v, turn off until fixed.  */
! #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) 				\
! do {									\
!   if (LEVEL >= 3)							\
!     flag_rename_registers = 0;						\
! } while (0)
  
  /* Define this macro if debugging can be performed even without a frame
     pointer.  If this macro is defined, GNU CC will turn on the
--- 545,551 ----
     *Do not examine `write_symbols' in this macro!* The debugging options are
     *not supposed to alter the generated code.  */
  
! /* #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) */
  
  /* Define this macro if debugging can be performed even without a frame
     pointer.  If this macro is defined, GNU CC will turn on the
*** gcc/config/d30v/d30v.md.~1~	Tue May 30 13:06:12 2000
--- gcc/config/d30v/d30v.md	Mon Nov 27 01:02:19 2000
***************
*** 2037,2096 ****
    [(set_attr "length" "4,8")
     (set_attr "type" "scmp,lcmp")])
  
- ;; Code used after splitting DI compares
- 
- (define_insn "*movcccc_signed_true"
-   [(set (match_operand:CC 0 "flag_operand" "=f,f")
- 	(if_then_else:CC (match_operand:CC 1 "br_flag_operand" "f,f")
- 			 (match_operator:CC 3 "srelational_si_operator"
- 					    [(match_operand:SI 4 "gpr_operand" "d,d")
- 					     (match_operand:SI 5 "gpr_or_constant_operand" "dI,i")])
- 			 (match_dup 0)))]
-   ""
-   "%R3%T1 %0,%4,%5"
-   [(set_attr "length" "4,8")
-    (set_attr "type" "scmp,lcmp")
-    (set_attr "predicable" "no")])
- 
- (define_insn "*movcccc_signed_false"
-   [(set (match_operand:CC 0 "flag_operand" "=f,f")
- 	(if_then_else:CC (match_operand:CC 1 "br_flag_operand" "f,f")
- 			 (match_dup 0)
- 			 (match_operator:CC 3 "srelational_si_operator"
- 					    [(match_operand:SI 4 "gpr_operand" "d,d")
- 					     (match_operand:SI 5 "gpr_or_constant_operand" "dI,i")])))]
-   ""
-   "%R3%F1 %0,%4,%5"
-   [(set_attr "length" "4,8")
-    (set_attr "type" "scmp,lcmp")
-    (set_attr "predicable" "no")])
- 
- (define_insn "*movcccc_unsigned_true"
-   [(set (match_operand:CC 0 "flag_operand" "=f,f")
- 	(if_then_else:CC (match_operand:CC 1 "br_flag_operand" "f,f")
- 			 (match_operator:CC 3 "urelational_si_operator"
- 					    [(match_operand:SI 4 "gpr_operand" "d,d")
- 					     (match_operand:SI 5 "gpr_or_constant_operand" "dJP,i")])
- 			 (match_dup 0)))]
-   ""
-   "%R3%T1 %0,%4,%5"
-   [(set_attr "length" "4,8")
-    (set_attr "type" "scmp,lcmp")
-    (set_attr "predicable" "no")])
- 
- (define_insn "*movcccc_unsigned_false"
-   [(set (match_operand:CC 0 "flag_operand" "=f,f")
- 	(if_then_else:CC (match_operand:CC 1 "br_flag_operand" "f,f")
- 			 (match_dup 0)
- 			 (match_operator:CC 3 "urelational_si_operator"
- 					    [(match_operand:SI 4 "gpr_operand" "d,d")
- 					     (match_operand:SI 5 "gpr_or_constant_operand" "dJP,i")])))]
-   ""
-   "%R3%F1 %0,%4,%5"
-   [(set_attr "length" "4,8")
-    (set_attr "type" "scmp,lcmp")
-    (set_attr "predicable" "no")])
- 
  ;; 64 bit integer tests
  (define_insn "*eqdi_internal"
    [(set (match_operand:CC 0 "br_flag_operand" "=b,b,b")
--- 2037,2042 ----
***************
*** 2109,2119 ****
    [(set (match_dup 0)
  	(eq:CC (match_dup 3)
  	       (match_dup 4)))
!    (set (match_dup 0)
! 	(if_then_else:CC (match_dup 0)
! 			 (eq:CC (match_dup 5)
! 				(match_dup 6))
! 			 (match_dup 0)))]
    "
  {
    d30v_split_double (operands[1], &operands[3], &operands[5]);
--- 2055,2066 ----
    [(set (match_dup 0)
  	(eq:CC (match_dup 3)
  	       (match_dup 4)))
!    (cond_exec
!     (eq:CC (match_dup 0)
! 	   (const_int 0))
!     (set (match_dup 0)
! 	 (eq:CC (match_dup 5)
! 		(match_dup 6))))]
    "
  {
    d30v_split_double (operands[1], &operands[3], &operands[5]);
***************
*** 2137,2147 ****
    [(set (match_dup 0)
  	(ne:CC (match_dup 3)
  	       (match_dup 4)))
!    (set (match_dup 0)
! 	(if_then_else:CC (match_dup 0)
! 			 (match_dup 0)
! 			 (ne:CC (match_dup 5)
! 				(match_dup 6))))]
    "
  {
    d30v_split_double (operands[1], &operands[3], &operands[5]);
--- 2084,2095 ----
    [(set (match_dup 0)
  	(ne:CC (match_dup 3)
  	       (match_dup 4)))
!    (cond_exec
!     (ne:CC (match_dup 0)
! 	   (const_int 0))
!     (set (match_dup 0)
! 	 (ne:CC (match_dup 5)
! 		(match_dup 6))))]
    "
  {
    d30v_split_double (operands[1], &operands[3], &operands[5]);
***************
*** 2268,2290 ****
    d30v_split_double (operands[2], &high[0], &low[0]);
    d30v_split_double (operands[3], &high[1], &low[1]);
  
!   operands[5] = gen_rtx (SET, VOIDmode,
! 			 tmpflag,
! 			 gen_rtx (EQ, CCmode, high[0], high[1]));
! 
!   operands[6] = gen_rtx (SET, VOIDmode,
! 			 outflag,
! 			 gen_rtx (IF_THEN_ELSE, CCmode,
! 				  tmpflag,
! 				  outflag,
! 				  gen_rtx (cond, CCmode, high[0], high[1])));
! 
!   operands[7] = gen_rtx (SET, VOIDmode,
! 			 outflag,
! 			 gen_rtx (IF_THEN_ELSE, CCmode,
! 				  tmpflag,
! 				  gen_rtx (ucond, CCmode, low[0], low[1]),
! 				  outflag));
  }")
  
  
--- 2216,2238 ----
    d30v_split_double (operands[2], &high[0], &low[0]);
    d30v_split_double (operands[3], &high[1], &low[1]);
  
!   operands[5] = gen_rtx_SET (VOIDmode,
! 			     tmpflag,
! 			     gen_rtx_EQ (CCmode, high[0], high[1]));
! 
!   operands[6] = gen_rtx_COND_EXEC (VOIDmode,
! 				   gen_rtx_NE (CCmode, tmpflag, const0_rtx),
! 				   gen_rtx_SET (VOIDmode, outflag,
! 						gen_rtx_fmt_ee (cond, CCmode,
! 								high[0],
! 								high[1])));
! 
!   operands[7] = gen_rtx_COND_EXEC (VOIDmode,
! 				   gen_rtx_EQ (CCmode, tmpflag, const0_rtx),
! 				   gen_rtx_SET (VOIDmode, outflag,
! 						gen_rtx_fmt_ee (ucond, CCmode,
! 								low[0],
! 								low[1])));
  }")
  
  
***************
*** 3407,3413 ****
  
  (define_cond_exec
    [(match_operator:CC 0 "condexec_test_operator"
!      [(match_operand:CC 1 "br_flag_operand" "f")
        (const_int 0)])]
    ""
    "")
--- 3355,3361 ----
  
  (define_cond_exec
    [(match_operator:CC 0 "condexec_test_operator"
!      [(match_operand:CC 1 "br_flag_operand" "b")
        (const_int 0)])]
    ""
    "")


-- 
Michael Meissner, Red Hat, Inc.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482

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