diff options
author | Anatoly Sokolov <aesok@post.ru> | 2010-07-05 22:45:40 +0400 |
---|---|---|
committer | Anatoly Sokolov <aesok@gcc.gnu.org> | 2010-07-05 22:45:40 +0400 |
commit | 88e06841144bd5612bc3411a657094c2fb39575f (patch) | |
tree | 57d6c25d9e2e26c53247cf44ec59628e7d5a7f44 /gcc/double-int.c | |
parent | 92eb4438684a217e0f6968d0ab996424c7af055f (diff) | |
download | gcc-88e06841144bd5612bc3411a657094c2fb39575f.tar.gz |
double-int.h (fit_double_type): Remove declaration.
* double-int.h (fit_double_type): Remove declaration.
* double-int.c (fit_double_type): Remove function.
* tree.h (int_fits_type_p): Adjust prototype.
* tree.c (int_fits_type_p): Return bool. Use double_int_fits_to_tree_p
instead of fit_double_type.
(build_int_cst_type): Use double_int_to_tree and shwi_to_double_int
instead of fit_double_type and build_int_cst_wide.
* builtins.c (): Use double_int_fits_to_tree_p and double_int_to_tree
instead of fit_double_type and build_int_cst_wide.
(fold_builtin_object_size): Use double_int_fits_to_tree_p instead
of fit_double_type.
From-SVN: r161847
Diffstat (limited to 'gcc/double-int.c')
-rw-r--r-- | gcc/double-int.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/gcc/double-int.c b/gcc/double-int.c index 0bfe514238d..924e91b6c90 100644 --- a/gcc/double-int.c +++ b/gcc/double-int.c @@ -69,71 +69,6 @@ decode (HOST_WIDE_INT *words, unsigned HOST_WIDE_INT *low, *hi = words[2] + words[3] * BASE; } -/* Force the double-word integer L1, H1 to be within the range of the - integer type TYPE. Stores the properly truncated and sign-extended - double-word integer in *LV, *HV. Returns true if the operation - overflows, that is, argument and result are different. */ - -int -fit_double_type (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, - unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, const_tree type) -{ - unsigned HOST_WIDE_INT low0 = l1; - HOST_WIDE_INT high0 = h1; - unsigned int prec = TYPE_PRECISION (type); - int sign_extended_type; - - /* Size types *are* sign extended. */ - sign_extended_type = (!TYPE_UNSIGNED (type) - || (TREE_CODE (type) == INTEGER_TYPE - && TYPE_IS_SIZETYPE (type))); - - /* First clear all bits that are beyond the type's precision. */ - if (prec >= 2 * HOST_BITS_PER_WIDE_INT) - ; - else if (prec > HOST_BITS_PER_WIDE_INT) - h1 &= ~((HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT)); - else - { - h1 = 0; - if (prec < HOST_BITS_PER_WIDE_INT) - l1 &= ~((HOST_WIDE_INT) (-1) << prec); - } - - /* Then do sign extension if necessary. */ - if (!sign_extended_type) - /* No sign extension */; - else if (prec >= 2 * HOST_BITS_PER_WIDE_INT) - /* Correct width already. */; - else if (prec > HOST_BITS_PER_WIDE_INT) - { - /* Sign extend top half? */ - if (h1 & ((unsigned HOST_WIDE_INT)1 - << (prec - HOST_BITS_PER_WIDE_INT - 1))) - h1 |= (HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT); - } - else if (prec == HOST_BITS_PER_WIDE_INT) - { - if ((HOST_WIDE_INT)l1 < 0) - h1 = -1; - } - else - { - /* Sign extend bottom half? */ - if (l1 & ((unsigned HOST_WIDE_INT)1 << (prec - 1))) - { - h1 = -1; - l1 |= (HOST_WIDE_INT)(-1) << prec; - } - } - - *lv = l1; - *hv = h1; - - /* If the value didn't fit, signal overflow. */ - return l1 != low0 || h1 != high0; -} - /* Add two doubleword integers with doubleword result. Return nonzero if the operation overflows according to UNSIGNED_P. Each argument is given as two `HOST_WIDE_INT' pieces. |