diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2011-08-01 21:53:07 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2011-08-01 21:53:07 +0000 |
commit | 3c67fd9c30f45017fb3b490162fce106d37b7cbe (patch) | |
tree | b283fc957cb0e873ede675b16d01fe03cbf1bd48 /gcc/hwint.h | |
parent | 4bbff96e369cf96ee1c6bd3fd9f7728c08e05da8 (diff) | |
download | gcc-3c67fd9c30f45017fb3b490162fce106d37b7cbe.zip gcc-3c67fd9c30f45017fb3b490162fce106d37b7cbe.tar.gz gcc-3c67fd9c30f45017fb3b490162fce106d37b7cbe.tar.bz2 |
Makefile.in (hwint.o): Depend on DIAGNOSTIC_CORE_H.
2011-08-01 Sebastian Pop <sebastian.pop@amd.com>
Joseph Myers <joseph@codesourcery.com>
* Makefile.in (hwint.o): Depend on DIAGNOSTIC_CORE_H.
* hwint.c: Include diagnostic-core.h.
(abs_hwi): New.
(gcd): Moved here...
(pos_mul_hwi): New.
(mul_hwi): New.
(least_common_multiple): Moved here...
* hwint.h (gcd): ... from here.
(least_common_multiple): ... from here.
(HOST_WIDE_INT_MIN): New.
(HOST_WIDE_INT_MAX): New.
(abs_hwi): Declared.
(gcd): Declared.
(pos_mul_hwi): Declared.
(mul_hwi): Declared.
(least_common_multiple): Declared.
* omega.c (check_pos_mul): Removed.
(check_mul): Removed.
(omega_solve_geq): Use pos_mul_hwi instead of check_pos_mul and
mul_hwi instead of check_mul.
Co-Authored-By: Joseph Myers <joseph@codesourcery.com>
From-SVN: r177075
Diffstat (limited to 'gcc/hwint.h')
-rw-r--r-- | gcc/hwint.h | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/gcc/hwint.h b/gcc/hwint.h index 1eadd45..fa77b11 100644 --- a/gcc/hwint.h +++ b/gcc/hwint.h @@ -228,33 +228,14 @@ 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)); -} +#define HOST_WIDE_INT_MIN (HOST_WIDE_INT) \ + ((unsigned HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1)) +#define HOST_WIDE_INT_MAX (~(HOST_WIDE_INT_MIN)) + +extern HOST_WIDE_INT abs_hwi (HOST_WIDE_INT); +extern HOST_WIDE_INT gcd (HOST_WIDE_INT, HOST_WIDE_INT); +extern HOST_WIDE_INT pos_mul_hwi (HOST_WIDE_INT, HOST_WIDE_INT); +extern HOST_WIDE_INT mul_hwi (HOST_WIDE_INT, HOST_WIDE_INT); +extern HOST_WIDE_INT least_common_multiple (HOST_WIDE_INT, HOST_WIDE_INT); #endif /* ! GCC_HWINT_H */ |