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]

ia64 unordered fp comparisons


        * config/ia64/ia64.c (ia64_print_operand) [case D]: Emit
        completers for UNORDERED and ORDERED as well.
        * config/ia64/ia64.md (bunordered, bordered): New.
        (sunordered, sordered): New.

Index: ia64.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ia64/ia64.c,v
retrieving revision 1.27
diff -c -p -d -r1.27 ia64.c
*** ia64.c	2000/06/23 08:35:58	1.27
--- ia64.c	2000/06/27 17:25:45
*************** ia64_print_operand (file, x, code)
*** 1777,1782 ****
--- 1777,1784 ----
       rtx    x;
       int    code;
  {
+   const char *str;
+ 
    switch (code)
      {
      case 0:
*************** ia64_print_operand (file, x, code)
*** 1796,1802 ****
        }
  
      case 'D':
!       fputs (GET_CODE (x) == NE ? "neq" : GET_RTX_NAME (GET_CODE (x)), file);
        return;
  
      case 'E':
--- 1798,1819 ----
        }
  
      case 'D':
!       switch (GET_CODE (x))
! 	{
! 	case NE:
! 	  str = "neq";
! 	  break;
! 	case UNORDERED:
! 	  str = "unord";
! 	  break;
! 	case ORDERED:
! 	  str = "ord";
! 	  break;
! 	default:
! 	  str = GET_RTX_NAME (GET_CODE (x));
! 	  break;
! 	}
!       fputs (str, file);
        return;
  
      case 'E':
*************** ia64_print_operand (file, x, code)
*** 1805,1817 ****
  
      case 'F':
        if (x == CONST0_RTX (GET_MODE (x)))
! 	fputs (reg_names [FR_REG (0)], file);
        else if (x == CONST1_RTX (GET_MODE (x)))
! 	fputs (reg_names [FR_REG (1)], file);
        else if (GET_CODE (x) == REG)
! 	fputs (reg_names [REGNO (x)], file);
        else
  	abort ();
        return;
  
      case 'I':
--- 1822,1835 ----
  
      case 'F':
        if (x == CONST0_RTX (GET_MODE (x)))
! 	str = reg_names [FR_REG (0)];
        else if (x == CONST1_RTX (GET_MODE (x)))
! 	str = reg_names [FR_REG (1)];
        else if (GET_CODE (x) == REG)
! 	str = reg_names [REGNO (x)];
        else
  	abort ();
+       fputs (str, file);
        return;
  
      case 'I':
Index: ia64.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ia64/ia64.md,v
retrieving revision 1.19
diff -c -p -d -r1.19 ia64.md
*** ia64.md	2000/06/23 08:35:58	1.19
--- ia64.md	2000/06/27 17:25:46
***************
*** 2153,2158 ****
--- 2153,2192 ----
    operands[3] = ia64_compare_op1;
  }")
  
+ (define_expand "bunordered"
+   [(set (match_dup 1)
+ 	(unordered:CC (match_dup 2)
+ 		      (match_dup 3)))
+    (set (pc)
+ 	(if_then_else (ne:CC (match_dup 1)
+ 			     (const_int 0))
+ 		      (label_ref (match_operand 0 "" ""))
+ 		      (pc)))]
+   ""
+   "
+ {
+   operands[1] = gen_reg_rtx (CCmode);
+   operands[2] = ia64_compare_op0;
+   operands[3] = ia64_compare_op1;
+ }")
+ 
+ (define_expand "bordered"
+   [(set (match_dup 1)
+ 	(ordered:CC (match_dup 2)
+ 		      (match_dup 3)))
+    (set (pc)
+ 	(if_then_else (ne:CC (match_dup 1)
+ 			     (const_int 0))
+ 		      (label_ref (match_operand 0 "" ""))
+ 		      (pc)))]
+   ""
+   "
+ {
+   operands[1] = gen_reg_rtx (CCmode);
+   operands[2] = ia64_compare_op0;
+   operands[3] = ia64_compare_op1;
+ }")
+ 
  (define_insn "*br_true"
    [(set (pc)
  	(if_then_else (match_operator 0 "predicate_operator"
***************
*** 2313,2318 ****
--- 2347,2380 ----
    [(set (match_dup 1)
  	(geu:CC (match_dup 2)
  		(match_dup 3)))
+    (set (match_operand:DI 0 "register_operand" "")
+ 	(ne:DI (match_dup 1) (const_int 0)))]
+   ""
+   "
+ {
+   operands[1] = gen_reg_rtx (CCmode);
+   operands[2] = ia64_compare_op0;
+   operands[3] = ia64_compare_op1;
+ }")
+ 
+ (define_expand "sunordered"
+   [(set (match_dup 1)
+ 	(unordered:CC (match_dup 2)
+ 		      (match_dup 3)))
+    (set (match_operand:DI 0 "register_operand" "")
+ 	(ne:DI (match_dup 1) (const_int 0)))]
+   ""
+   "
+ {
+   operands[1] = gen_reg_rtx (CCmode);
+   operands[2] = ia64_compare_op0;
+   operands[3] = ia64_compare_op1;
+ }")
+ 
+ (define_expand "sordered"
+   [(set (match_dup 1)
+ 	(ordered:CC (match_dup 2)
+ 		      (match_dup 3)))
     (set (match_operand:DI 0 "register_operand" "")
  	(ne:DI (match_dup 1) (const_int 0)))]
    ""

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