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: [PATCH 5/5] Remove the lambda framework and make -ftree-loop-linear an alias of -floop-interchange.


On Tue, Jan 18, 2011 at 04:12, Richard Guenther <rguenther@suse.de> wrote:
> Hm. ?gcd looks like it could go to a more general place. ?Even if it
> doesn't exactly fit hwint.h IMHO moving it there makes more sense.
> Maybe somebody else has a better idea though.

Ok, I will amend the patch with:

From ffdce31ad01856d8c531d4eb50ff72d8b66331af Mon Sep 17 00:00:00 2001
From: Sebastian Pop <sebpop@gmail.com>
Date: Tue, 18 Jan 2011 10:24:58 -0600
Subject: [PATCH] fix

---
 gcc/hwint.h         |   29 +++++++++++++++++++++++++++++
 gcc/tree-data-ref.h |   29 -----------------------------
 2 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/gcc/hwint.h b/gcc/hwint.h
index 8bd7c5e..1eadd45 100644
--- a/gcc/hwint.h
+++ b/gcc/hwint.h
@@ -228,4 +228,33 @@ exact_log2 (unsigned HOST_WIDE_INT x)

 #endif /* GCC_VERSION >= 3004 */

+/* Compute the greatest common divisor of two numbers using
+   Euclid's algorithm.  */
+
+static inline int
+gcd (int a, int b)
+{
+  int x, y, z;
+
+  x = abs (a);
+  y = abs (b);
+
+  while (x > 0)
+    {
+      z = y % x;
+      y = x;
+      x = z;
+    }
+
+  return y;
+}
+
+/* Compute the least common multiple of two numbers A and B .  */
+
+static inline int
+least_common_multiple (int a, int b)
+{
+  return (abs (a) * abs (b) / gcd (a, b));
+}
+
 #endif /* ! GCC_HWINT_H */
diff --git a/gcc/tree-data-ref.h b/gcc/tree-data-ref.h
index 3fd4f47..2e85677 100644
--- a/gcc/tree-data-ref.h
+++ b/gcc/tree-data-ref.h
@@ -674,35 +674,6 @@ DEF_VEC_ALLOC_P (rdgc, heap);
 DEF_VEC_P (bitmap);
 DEF_VEC_ALLOC_P (bitmap, heap);

-/* Compute the greatest common divisor of two numbers using
-   Euclid's algorithm.  */
-
-static inline int
-gcd (int a, int b)
-{
-  int x, y, z;
-
-  x = abs (a);
-  y = abs (b);
-
-  while (x > 0)
-    {
-      z = y % x;
-      y = x;
-      x = z;
-    }
-
-  return y;
-}
-
-/* Compute the least common multiple of two numbers A and B .  */
-
-static inline int
-least_common_multiple (int a, int b)
-{
-  return (abs (a) * abs (b) / gcd (a, b));
-}
-
 /* Compute the greatest common divisor of a VECTOR of SIZE numbers.  */

 static inline int
-- 
1.7.1


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