Richi has asked the we break the wide-int patch so that the individual port and 
front end maintainers can review their parts without have to go through the 
entire patch.    This patch covers the arc port.

Ok?

        * config/arc/arc.c
        (arc_can_use_doloop_p): Use wide-int interfaces.


diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 77932ce..5ad807e 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -392,7 +392,8 @@ static bool arc_return_in_memory (const_tree, const_tree);
 static void arc_init_simd_builtins (void);
 static bool arc_vector_mode_supported_p (enum machine_mode);
 
-static bool arc_can_use_doloop_p (double_int, double_int, unsigned int, bool);
+static bool arc_can_use_doloop_p (const widest_int &, const widest_int &,
+                                 unsigned int, bool);
 static const char *arc_invalid_within_doloop (const_rtx);
 
 static void output_short_suffix (FILE *file);
@@ -5697,7 +5698,7 @@ arc_pass_by_reference (cumulative_args_t ca_v 
ATTRIBUTE_UNUSED,
 /* Implement TARGET_CAN_USE_DOLOOP_P.  */
 
 static bool
-arc_can_use_doloop_p (double_int iterations, double_int,
+arc_can_use_doloop_p (const widest_int &iterations, const widest_int &,
                      unsigned int loop_depth, bool entered_at_top)
 {
   if (loop_depth > 1)
@@ -5705,9 +5706,8 @@ arc_can_use_doloop_p (double_int iterations, double_int,
   /* Setting up the loop with two sr instructions costs 6 cycles.  */
   if (TARGET_ARC700
       && !entered_at_top
-      && iterations.high == 0
-      && iterations.low > 0
-      && iterations.low <= (flag_pic ? 6 : 3))
+      && wi::gtu_p (iterations, 0)
+      && wi::leu_p (iterations, flag_pic ? 6 : 3))
     return false;
   return true;
 }

Reply via email to