pa.c: Include expr.h before c-tree.h.
authorJ. David Anglin <dave@hiauly1.hia.nrc.ca>
Thu, 7 Dec 2000 01:06:47 +0000 (01:06 +0000)
committerJeff Law <law@gcc.gnu.org>
Thu, 7 Dec 2000 01:06:47 +0000 (18:06 -0700)
        * pa.c: Include expr.h before c-tree.h.
        (remove_useless_addtr_insns): Use reverse_condition_maybe_unordered
        instead of reverse_condition.
        (print_operand): Correct predicates for GT, GE, LT and LE.  Add
        predicates for LTGT, UNLE, UNLT, UNGE, UNGT, UNEQ, UNORDERED and
        ORDERED.
        (cmpib_comparison_operator): Add GEU and LTU codes.
        * pa.h (PREDICATE_CODES): Add codes for cmpib_comparison_operator.
        * pa.md (bltgt, bunle, bunlt, bunge, bungt, buneq, bunordered,
        bordered): New float conditional branch patterns.

From-SVN: r38082

gcc/ChangeLog
gcc/config/pa/pa.c
gcc/config/pa/pa.h
gcc/config/pa/pa.md

index b731a4a..cd11dd8 100644 (file)
@@ -1,3 +1,16 @@
+2000-11-06  J. David Anglin  <dave@hiauly1.hia.nrc.ca>
+
+       * pa.c: Include expr.h before c-tree.h.
+       (remove_useless_addtr_insns): Use reverse_condition_maybe_unordered
+       instead of reverse_condition.
+       (print_operand): Correct predicates for GT, GE, LT and LE.  Add
+       predicates for LTGT, UNLE, UNLT, UNGE, UNGT, UNEQ, UNORDERED and
+       ORDERED.
+       (cmpib_comparison_operator): Add GEU and LTU codes.
+       * pa.h (PREDICATE_CODES): Add codes for cmpib_comparison_operator.
+       * pa.md (bltgt, bunle, bunlt, bunge, bungt, buneq, bunordered,
+       bordered): New float conditional branch patterns.
+
 Wed Dec  6 21:03:41 2000  J"orn Rennecke <amylaar@redhat.com>
 
        * final.c (final_addr_vec_align): Fix clipping to BIGGEST_ALIGNMENT.
index 6a4f989..e9211ee 100644 (file)
@@ -34,9 +34,9 @@ Boston, MA 02111-1307, USA.  */
 #include "flags.h"
 #include "tree.h"
 #include "reload.h"
+#include "expr.h"
 #include "c-tree.h"
 #include "function.h"
-#include "expr.h"
 #include "obstack.h"
 #include "toplev.h"
 #include "ggc.h"
@@ -2642,7 +2642,8 @@ remove_useless_addtr_insns (insns, check_notes)
                  /* Reverse our condition.  */
                  tmp = PATTERN (insn);
                  PUT_CODE (XEXP (tmp, 1),
-                           reverse_condition (GET_CODE (XEXP (tmp, 1))));
+                   reverse_condition_maybe_unordered (GET_CODE (XEXP (tmp,
+                     1))));
                }
            }
        }
@@ -3921,8 +3922,8 @@ print_operand (file, x, code)
          abort ();
        }
       return;
-    /* For floating point comparisons.  Need special conditions to deal
-       with NaNs properly.  */
+    /* For floating point comparisons. Note that the output predicates are the
+       complement of the desired mode. */
     case 'Y':
       switch (GET_CODE (x))
        {
@@ -3931,13 +3932,29 @@ print_operand (file, x, code)
        case NE:
          fputs ("=", file);  break;
        case GT:
-         fputs ("<=", file);  break;
+         fputs ("!>", file);  break;
        case GE:
-         fputs ("<", file);  break;
+         fputs ("!>=", file);  break;
        case LT:
-         fputs (">=", file);  break;
+         fputs ("!<", file);  break;
        case LE:
+         fputs ("!<=", file);  break;
+       case LTGT:
+         fputs ("!<>", file);  break;
+       case UNLE:
          fputs (">", file);  break;
+       case UNLT:
+         fputs (">=", file);  break;
+       case UNGE:
+         fputs ("<", file);  break;
+       case UNGT:
+         fputs ("<=", file);  break;
+       case UNEQ:
+         fputs ("<>", file);  break;
+       case UNORDERED:
+         fputs ("<=>", file);  break;
+       case ORDERED:
+         fputs ("!<=>", file);  break;
        default:
          abort ();
        }
@@ -7046,9 +7063,11 @@ cmpib_comparison_operator (op, mode)
           && (GET_CODE (op) == EQ
              || GET_CODE (op) == NE
              || GET_CODE (op) == GT
-             || GET_CODE (op) == GE
              || GET_CODE (op) == GTU
+             || GET_CODE (op) == GE
+             || GET_CODE (op) == GEU
              || GET_CODE (op) == LT
+             || GET_CODE (op) == LTU
              || GET_CODE (op) == LE
              || GET_CODE (op) == LEU));
 }
index 536692b..f920c0f 100644 (file)
@@ -2052,4 +2052,6 @@ while (0)
   {"basereg_operand", {REG}},                                          \
   {"div_operand", {REG, CONST_INT}},                                   \
   {"ireg_operand", {REG}},                                             \
+  {"cmpib_comparison_operator", {EQ, NE, LT, LTU, LE, LEU,             \
+   GT, GTU, GE, GEU}},                                                 \
   {"movb_comparison_operator", {EQ, NE, LT, GE}},
index 3f6f7f7..d2f7ebf 100644 (file)
   operands[2] = hppa_compare_op1;
 }")
 
+(define_expand "bltgt"
+  [(set (pc)
+       (if_then_else (ltgt (match_dup 1) (match_dup 2))
+                     (label_ref (match_operand 0 "" ""))
+                     (pc)))]
+  ""
+  "
+{
+  if (hppa_branch_type == CMP_SI)
+    FAIL;
+  emit_insn (gen_cmp_fp (LTGT, hppa_compare_op0, hppa_compare_op1));
+  emit_bcond_fp (NE, operands[0]);
+  DONE;
+}")
+
+(define_expand "bunle"
+  [(set (pc)
+       (if_then_else (unle (match_dup 1) (match_dup 2))
+                     (label_ref (match_operand 0 "" ""))
+                     (pc)))]
+  ""
+  "
+{
+  if (hppa_branch_type == CMP_SI)
+    FAIL;
+  emit_insn (gen_cmp_fp (UNLE, hppa_compare_op0, hppa_compare_op1));
+  emit_bcond_fp (NE, operands[0]);
+  DONE;
+}")
+
+(define_expand "bunlt"
+  [(set (pc)
+       (if_then_else (unlt (match_dup 1) (match_dup 2))
+                     (label_ref (match_operand 0 "" ""))
+                     (pc)))]
+  ""
+  "
+{
+  if (hppa_branch_type == CMP_SI)
+    FAIL;
+  emit_insn (gen_cmp_fp (UNLT, hppa_compare_op0, hppa_compare_op1));
+  emit_bcond_fp (NE, operands[0]);
+  DONE;
+}")
+
+(define_expand "bunge"
+  [(set (pc)
+       (if_then_else (unge (match_dup 1) (match_dup 2))
+                     (label_ref (match_operand 0 "" ""))
+                     (pc)))]
+  ""
+  "
+{
+  if (hppa_branch_type == CMP_SI)
+    FAIL;
+  emit_insn (gen_cmp_fp (UNGE, hppa_compare_op0, hppa_compare_op1));
+  emit_bcond_fp (NE, operands[0]);
+  DONE;
+}")
+
+(define_expand "bungt"
+  [(set (pc)
+       (if_then_else (ungt (match_dup 1) (match_dup 2))
+                     (label_ref (match_operand 0 "" ""))
+                     (pc)))]
+  ""
+  "
+{
+  if (hppa_branch_type == CMP_SI)
+    FAIL;
+  emit_insn (gen_cmp_fp (UNGT, hppa_compare_op0, hppa_compare_op1));
+  emit_bcond_fp (NE, operands[0]);
+  DONE;
+}")
+
+(define_expand "buneq"
+  [(set (pc)
+       (if_then_else (uneq (match_dup 1) (match_dup 2))
+                     (label_ref (match_operand 0 "" ""))
+                     (pc)))]
+  ""
+  "
+{
+  if (hppa_branch_type == CMP_SI)
+    FAIL;
+  emit_insn (gen_cmp_fp (UNEQ, hppa_compare_op0, hppa_compare_op1));
+  emit_bcond_fp (NE, operands[0]);
+  DONE;
+}")
+
+(define_expand "bunordered"
+  [(set (pc)
+       (if_then_else (unordered (match_dup 1) (match_dup 2))
+                     (label_ref (match_operand 0 "" ""))
+                     (pc)))]
+  ""
+  "
+{
+  if (hppa_branch_type == CMP_SI)
+    FAIL;
+  emit_insn (gen_cmp_fp (UNORDERED, hppa_compare_op0, hppa_compare_op1));
+  emit_bcond_fp (NE, operands[0]);
+  DONE;
+}")
+
+(define_expand "bordered"
+  [(set (pc)
+       (if_then_else (ordered (match_dup 1) (match_dup 2))
+                     (label_ref (match_operand 0 "" ""))
+                     (pc)))]
+  ""
+  "
+{
+  if (hppa_branch_type == CMP_SI)
+    FAIL;
+  emit_insn (gen_cmp_fp (ORDERED, hppa_compare_op0, hppa_compare_op1));
+  emit_bcond_fp (NE, operands[0]);
+  DONE;
+}")
+
 ;; Match the branch patterns.