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]
Other format: [Raw text]

Re: VRP wrapping MULT_EXPR


On Fri, 3 Aug 2012, Richard Guenther wrote:

+/* Some quadruple precision helpers.  */
+static int
+quad_int_cmp (double_int l0, double_int h0,
+             double_int l1, double_int h1, bool uns)
+{
+  int c = double_int_cmp (h0, h1, uns);
+  if (c != 0) return c;
+  return double_int_ucmp (l0, l1);
+}

I suppose that's appropriate for double-int.h as static inline function.


Ok with or without moving it (we can do that as followup anyway) if
testing is ok.

Thanks, I applied it without moving, and am now doing a quick bootstrap of the following (to make sure I didn't forget a ';' during the copy-paste).


2012-08-03 Marc Glisse <marc.glisse@inria.fr>

	* tree-vrp.c (quad_int_cmp): Move ...
	* double-int.h (quad_int_cmp): ... here.

--
Marc Glisse
Index: tree-vrp.c
===================================================================
--- tree-vrp.c	(revision 190125)
+++ tree-vrp.c	(working copy)
@@ -2181,30 +2181,21 @@ extract_range_from_multiplicative_op_1 (
     {
       /* If the new range has its limits swapped around (MIN > MAX),
 	 then the operation caused one of them to wrap around, mark
 	 the new range VARYING.  */
       set_value_range_to_varying (vr);
     }
   else
     set_value_range (vr, type, min, max, NULL);
 }
 
-/* Some quadruple precision helpers.  */
-static int
-quad_int_cmp (double_int l0, double_int h0,
-	      double_int l1, double_int h1, bool uns)
-{
-  int c = double_int_cmp (h0, h1, uns);
-  if (c != 0) return c;
-  return double_int_ucmp (l0, l1);
-}
-
+/* Quadruple precision helper.  */
 static void
 quad_int_pair_sort (double_int *l0, double_int *h0,
 		    double_int *l1, double_int *h1, bool uns)
 {
   if (quad_int_cmp (*l0, *h0, *l1, *h1, uns) > 0)
     {
       double_int tmp;
       tmp = *l0; *l0 = *l1; *l1 = tmp;
       tmp = *h0; *h0 = *h1; *h1 = tmp;
     }
Index: double-int.h
===================================================================
--- double-int.h	(revision 190125)
+++ double-int.h	(working copy)
@@ -219,20 +219,29 @@ double_int double_int_rrotate (double_in
 static inline bool
 double_int_negative_p (double_int cst)
 {
   return cst.high < 0;
 }
 
 int double_int_cmp (double_int, double_int, bool);
 int double_int_scmp (double_int, double_int);
 int double_int_ucmp (double_int, double_int);
 
+static inline int
+quad_int_cmp (double_int l0, double_int h0,
+	      double_int l1, double_int h1, bool uns)
+{
+  int c = double_int_cmp (h0, h1, uns);
+  if (c != 0) return c;
+  return double_int_ucmp (l0, l1);
+}
+
 double_int double_int_max (double_int, double_int, bool);
 double_int double_int_smax (double_int, double_int);
 double_int double_int_umax (double_int, double_int);
 
 double_int double_int_min (double_int, double_int, bool);
 double_int double_int_smin (double_int, double_int);
 double_int double_int_umin (double_int, double_int);
 
 void dump_double_int (FILE *, double_int, bool);
 

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