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]

Make mips to not abort on unordered conditional moves


Hi,
with this and previous patch the mips backend will hopefully bootstrap again...

Honza
Thu Mar  8 19:52:32 CET 2001  Jan Hubicka  <jh@suse.cz>
	* mips-protos.h (gen_conditional_move): Return int.
	* mips.c (gen_conditional_move): Return 0 on unordered
	compares, 1 otherwise.
	* mips.md (gen_conditional_move calls): Update.

Index: mips-protos.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/mips-protos.h,v
retrieving revision 1.5
diff -c -3 -p -r1.5 mips-protos.h
*** mips-protos.h	2000/09/12 18:40:58	1.5
--- mips-protos.h	2001/03/08 18:53:55
*************** extern struct rtx_def * gen_int_relation
*** 77,83 ****
  extern void		init_cumulative_args PARAMS ((CUMULATIVE_ARGS *c, tree, rtx));
  #endif /* TREE_CODE */
  extern void		gen_conditional_branch PARAMS ((rtx[], enum rtx_code));
! extern void		gen_conditional_move PARAMS ((rtx *));
  extern void		mips_gen_conditional_trap PARAMS ((rtx *));
  extern int		large_int PARAMS ((rtx, enum machine_mode));
  extern void		machine_dependent_reorg PARAMS ((rtx));
--- 77,83 ----
  extern void		init_cumulative_args PARAMS ((CUMULATIVE_ARGS *c, tree, rtx));
  #endif /* TREE_CODE */
  extern void		gen_conditional_branch PARAMS ((rtx[], enum rtx_code));
! extern int		gen_conditional_move PARAMS ((rtx *));
  extern void		mips_gen_conditional_trap PARAMS ((rtx *));
  extern int		large_int PARAMS ((rtx, enum machine_mode));
  extern void		machine_dependent_reorg PARAMS ((rtx));
Index: mips.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/mips.c,v
retrieving revision 1.111
diff -c -3 -p -r1.111 mips.c
*** mips.c	2001/02/27 01:26:26	1.111
--- mips.c	2001/03/08 18:54:28
*************** gen_conditional_branch (operands, test_c
*** 3083,3089 ****
  /* Emit the common code for conditional moves.  OPERANDS is the array
     of operands passed to the conditional move defined_expand.  */
  
! void
  gen_conditional_move (operands)
       rtx *operands;
  {
--- 3083,3089 ----
  /* Emit the common code for conditional moves.  OPERANDS is the array
     of operands passed to the conditional move defined_expand.  */
  
! int
  gen_conditional_move (operands)
       rtx *operands;
  {
*************** gen_conditional_move (operands)
*** 3141,3146 ****
--- 3141,3156 ----
  	  op1 = branch_cmp[0];
  	  move_code = EQ;
  	  break;
+ 	case UNLT:
+ 	case UNGT:
+ 	case UNLE:
+ 	case UNGE:
+ 	case UNEQ:
+ 	case LTGT:
+ 	case ORDERED:
+ 	case UNORDERED:
+ 	  /* We should support unordered compares too, but we don't yet.  */
+ 	  return 0;
  	default:
  	  abort ();
  	}
*************** gen_conditional_move (operands)
*** 3165,3170 ****
--- 3175,3181 ----
  							 cmp_reg,
  							 CONST0_RTX (SImode)),
  						operands[2], operands[3])));
+   return 1;
  }
  
  /* Emit the common code for conditional moves.  OPERANDS is the array
Index: mips.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/mips.md,v
retrieving revision 1.88
diff -c -3 -p -r1.88 mips.md
*** mips.md	2001/03/07 19:29:39	1.88
--- mips.md	2001/03/08 18:55:17
*************** ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j
*** 10197,10203 ****
    "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE"
    "
  {
!   gen_conditional_move (operands);
    DONE;
  }")
  
--- 10197,10204 ----
    "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE"
    "
  {
!   if (!gen_conditional_move (operands))
!     FAIL;
    DONE;
  }")
  
*************** ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j
*** 10210,10216 ****
    "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE" 
    "
  {
!   gen_conditional_move (operands);
    DONE;
  }")
  
--- 10211,10218 ----
    "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE" 
    "
  {
!   if (!gen_conditional_move (operands))
!     FAIL;
    DONE;
  }")
  
*************** ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j
*** 10223,10229 ****
    "ISA_HAS_CONDMOVE && TARGET_HARD_FLOAT"
    "
  {
!   gen_conditional_move (operands);
    DONE;
  }")
  
--- 10225,10232 ----
    "ISA_HAS_CONDMOVE && TARGET_HARD_FLOAT"
    "
  {
!   if (!gen_conditional_move (operands))
!     FAIL;
    DONE;
  }")
  
*************** ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j
*** 10236,10242 ****
    "ISA_HAS_CONDMOVE && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
    "
  {
!   gen_conditional_move (operands);
    DONE;
  }")
  
--- 10239,10246 ----
    "ISA_HAS_CONDMOVE && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
    "
  {
!   if (!gen_conditional_move (operands))
!     FAIL;
    DONE;
  }")
  


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