]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
hwint.c (abs_hwi, absu_hwi): Move to ...
authorJan Hubicka <hubicka@ucw.cz>
Tue, 16 Dec 2014 19:59:56 +0000 (20:59 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 16 Dec 2014 19:59:56 +0000 (19:59 +0000)
* hwint.c (abs_hwi, absu_hwi): Move to ...
* hwint.h (abs_hwi, absu_hwi): ... here; make inline.

From-SVN: r218791

gcc/ChangeLog
gcc/hwint.c
gcc/hwint.h

index b399b6ebadeacd83ae35fc3f4bb40f8363f666f3..b8009b181906ea65fbf64ba857f253e9eb4d718e 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-16  Jan Hubicka  <hubicka@ucw.cz>
+
+       * hwint.c (abs_hwi, absu_hwi): Move to ...
+       * hwint.h (abs_hwi, absu_hwi): ... here; make inline.
+
 2014-12-16  Marek Polacek  <polacek@redhat.com>
 
        PR middle-end/64309
index 9d0569b7583fcd3c86e7d82bfc44b146ae91de38..405118e124ab77f0710ddfcdb729badffdfb4af6 100644 (file)
@@ -124,22 +124,6 @@ popcount_hwi (unsigned HOST_WIDE_INT x)
 
 #endif /* GCC_VERSION < 3004 */
 
-/* Compute the absolute value of X.  */
-
-HOST_WIDE_INT
-abs_hwi (HOST_WIDE_INT x)
-{
-  gcc_checking_assert (x != HOST_WIDE_INT_MIN);
-  return x >= 0 ? x : -x;
-}
-
-/* Compute the absolute value of X as an unsigned type.  */
-
-unsigned HOST_WIDE_INT
-absu_hwi (HOST_WIDE_INT x)
-{
-  return x >= 0 ? (unsigned HOST_WIDE_INT)x : -(unsigned HOST_WIDE_INT)x;
-}
 
 /* Compute the greatest common divisor of two numbers A and B using
    Euclid's algorithm.  */
index fd961fd91da4758f7ff62abeaff1280fe23e9009..8e1c8f5ae77f7e64701372a9cbf04b88deadf557 100644 (file)
@@ -264,4 +264,21 @@ zext_hwi (unsigned HOST_WIDE_INT src, unsigned int prec)
     }
 }
 
+/* Compute the absolute value of X.  */
+
+inline HOST_WIDE_INT
+abs_hwi (HOST_WIDE_INT x)
+{
+  gcc_checking_assert (x != HOST_WIDE_INT_MIN);
+  return x >= 0 ? x : -x;
+}
+
+/* Compute the absolute value of X as an unsigned type.  */
+
+inline unsigned HOST_WIDE_INT
+absu_hwi (HOST_WIDE_INT x)
+{
+  return x >= 0 ? (unsigned HOST_WIDE_INT)x : -(unsigned HOST_WIDE_INT)x;
+}
+
 #endif /* ! GCC_HWINT_H */