OSDN Git Service

2012-01-27 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / hwint.c
index a128dc1..533133c 100644 (file)
@@ -109,6 +109,14 @@ abs_hwi (HOST_WIDE_INT x)
   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.  */