optabs.c (expand_abs): Don't call do_jump_by_parts_greater_rtx directly...
authorRoger Sayle <roger@eyesopen.com>
Tue, 14 Feb 2006 02:59:42 +0000 (02:59 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Tue, 14 Feb 2006 02:59:42 +0000 (02:59 +0000)
* optabs.c (expand_abs): Don't call do_jump_by_parts_greater_rtx
directly, instead let do_compare_rtx_and_jump handle this for us.
* expr.c (expand_expr_real_1): Likewise.
* dojump.c (do_jump_by_parts_greater_rtx): Make static.  Move
before do_jump_by_parts_greater.
(do_jump_by_parts_greater): Move after do_jump_by_parts_greater_rtx.
* expr.h (do_jump_by_parts_greater_rtx): Delete prototype.

From-SVN: r110954

gcc/ChangeLog
gcc/dojump.c
gcc/expr.c
gcc/expr.h
gcc/optabs.c

index 53af55e..6ffd332 100644 (file)
@@ -1,3 +1,13 @@
+2006-02-13  Roger Sayle  <roger@eyesopen.com>
+
+       * optabs.c (expand_abs): Don't call do_jump_by_parts_greater_rtx
+       directly, instead let do_compare_rtx_and_jump handle this for us.
+       * expr.c (expand_expr_real_1): Likewise.
+       * dojump.c (do_jump_by_parts_greater_rtx): Make static.  Move
+       before do_jump_by_parts_greater.
+       (do_jump_by_parts_greater): Move after do_jump_by_parts_greater_rtx.
+       * expr.h (do_jump_by_parts_greater_rtx): Delete prototype.
+
 2006-02-13  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        * pa/quadlib.c: Use defines instead of enum qfcmp_magic.
index 86dc6f4..da162d6 100644 (file)
@@ -609,29 +609,11 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
     }
 }
 \f
-/* Given a comparison expression EXP for values too wide to be compared
-   with one insn, test the comparison and jump to the appropriate label.
-   The code of EXP is ignored; we always test GT if SWAP is 0,
-   and LT if SWAP is 1.  */
-
-static void
-do_jump_by_parts_greater (tree exp, int swap, rtx if_false_label,
-                         rtx if_true_label)
-{
-  rtx op0 = expand_normal (TREE_OPERAND (exp, swap));
-  rtx op1 = expand_normal (TREE_OPERAND (exp, !swap));
-  enum machine_mode mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
-  int unsignedp = TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)));
-
-  do_jump_by_parts_greater_rtx (mode, unsignedp, op0, op1, if_false_label,
-                               if_true_label);
-}
-
 /* Compare OP0 with OP1, word at a time, in mode MODE.
    UNSIGNEDP says to do unsigned comparison.
    Jump to IF_TRUE_LABEL if OP0 is greater, IF_FALSE_LABEL otherwise.  */
 
-void
+static void
 do_jump_by_parts_greater_rtx (enum machine_mode mode, int unsignedp, rtx op0,
                              rtx op1, rtx if_false_label, rtx if_true_label)
 {
@@ -677,6 +659,24 @@ do_jump_by_parts_greater_rtx (enum machine_mode mode, int unsignedp, rtx op0,
   if (drop_through_label)
     emit_label (drop_through_label);
 }
+
+/* Given a comparison expression EXP for values too wide to be compared
+   with one insn, test the comparison and jump to the appropriate label.
+   The code of EXP is ignored; we always test GT if SWAP is 0,
+   and LT if SWAP is 1.  */
+
+static void
+do_jump_by_parts_greater (tree exp, int swap, rtx if_false_label,
+                         rtx if_true_label)
+{
+  rtx op0 = expand_normal (TREE_OPERAND (exp, swap));
+  rtx op1 = expand_normal (TREE_OPERAND (exp, !swap));
+  enum machine_mode mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
+  int unsignedp = TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)));
+
+  do_jump_by_parts_greater_rtx (mode, unsignedp, op0, op1, if_false_label,
+                               if_true_label);
+}
 \f
 /* Jump according to whether OP0 is 0.  We assume that OP0 has an integer
    mode, MODE, that is too wide for the available compare insns.  Either
index 537ce1e..92d8d28 100644 (file)
@@ -8184,24 +8184,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
          emit_move_insn (target, op0);
 
        temp = gen_label_rtx ();
-
-       /* If this mode is an integer too wide to compare properly,
-          compare word by word.  Rely on cse to optimize constant cases.  */
-       if (GET_MODE_CLASS (mode) == MODE_INT
-           && ! can_compare_p (GE, mode, ccp_jump))
-         {
-           if (code == MAX_EXPR)
-             do_jump_by_parts_greater_rtx (mode, unsignedp, target, op1,
-                                           NULL_RTX, temp);
-           else
-             do_jump_by_parts_greater_rtx (mode, unsignedp, op1, target,
-                                           NULL_RTX, temp);
-         }
-       else
-         {
-           do_compare_rtx_and_jump (target, cmpop1, comparison_code,
-                                    unsignedp, mode, NULL_RTX, NULL_RTX, temp);
-         }
+       do_compare_rtx_and_jump (target, cmpop1, comparison_code,
+                                unsignedp, mode, NULL_RTX, NULL_RTX, temp);
       }
       emit_move_insn (target, op1);
       emit_label (temp);
index f1cf081..d52d57a 100644 (file)
@@ -743,9 +743,6 @@ extern void init_all_optabs (void);
 /* Call this to initialize an optab function entry.  */
 extern rtx init_one_libfunc (const char *);
 
-extern void do_jump_by_parts_greater_rtx (enum machine_mode, int, rtx, rtx,
-                                         rtx, rtx);
-
 extern int vector_mode_valid_p (enum machine_mode);
 
 #endif /* GCC_EXPR_H */
index bdbb88c..0ab8406 100644 (file)
@@ -2898,15 +2898,8 @@ expand_abs (enum machine_mode mode, rtx op0, rtx target,
   emit_move_insn (target, op0);
   NO_DEFER_POP;
 
-  /* If this mode is an integer too wide to compare properly,
-     compare word by word.  Rely on CSE to optimize constant cases.  */
-  if (GET_MODE_CLASS (mode) == MODE_INT
-      && ! can_compare_p (GE, mode, ccp_jump))
-    do_jump_by_parts_greater_rtx (mode, 0, target, const0_rtx,
-                                 NULL_RTX, op1);
-  else
-    do_compare_rtx_and_jump (target, CONST0_RTX (mode), GE, 0, mode,
-                            NULL_RTX, NULL_RTX, op1);
+  do_compare_rtx_and_jump (target, CONST0_RTX (mode), GE, 0, mode,
+                          NULL_RTX, NULL_RTX, op1);
 
   op0 = expand_unop (mode, result_unsignedp ? neg_optab : negv_optab,
                      target, target, 0);